Class: Bitex::UsdDeposit
- Inherits:
-
Object
- Object
- Bitex::UsdDeposit
- Defined in:
- lib/bitex/usd_deposit.rb
Overview
A deposit of USD to your bitex.la balance.
Instance Attribute Summary collapse
-
#amount ⇒ BigDecimal
Final amount credited to your bitex USD balance.
-
#astropay_response_body ⇒ Object
Response from astropay if selected as the deposit method.
-
#country ⇒ Object
Country of origin for this deposit.
-
#created_at ⇒ Time
Time when this deposit was announced by you.
-
#currency ⇒ Object
Local currency for the country.
-
#deposit_method ⇒ Object
The method used for this deposit * :astropay * :other.
-
#id ⇒ Integer
This UsdDeposit’s unique ID.
-
#kyc_profile_id ⇒ Object
KYC profile on whose behalf this deposit is being created.
-
#reason ⇒ Object
The reason for cancellation of this deposit, if any.
-
#request_details ⇒ Object
Details for our account officers about this deposit.
-
#requested_amount ⇒ BigDecimal
For pre-announced deposits, this is the amount you requested to deposit.
-
#status ⇒ Object
The status of this deposit.
-
#third_party_reference ⇒ Object
This deposit’s id as issued by the third party payment processor, if any.
Class Method Summary collapse
- .all ⇒ Object
-
.create!(country, amount, currency, method, details, profile = nil) ⇒ Object
rubocop:enable Metrics/AbcSize.
- .deposit_methods ⇒ Object
- .find(id) ⇒ Object
- .reasons ⇒ Object
- .statuses ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#amount ⇒ BigDecimal
Returns Final amount credited to your bitex USD balance.
19 20 21 |
# File 'lib/bitex/usd_deposit.rb', line 19 def amount @amount end |
#astropay_response_body ⇒ Object
Response from astropay if selected as the deposit method. The ‘url’ field should be the astropay payment url for this deposit.
62 63 64 |
# File 'lib/bitex/usd_deposit.rb', line 62 def astropay_response_body @astropay_response_body end |
#country ⇒ Object
Country of origin for this deposit.
45 46 47 |
# File 'lib/bitex/usd_deposit.rb', line 45 def country @country end |
#created_at ⇒ Time
Returns Time when this deposit was announced by you.
11 12 13 |
# File 'lib/bitex/usd_deposit.rb', line 11 def created_at @created_at end |
#currency ⇒ Object
Local currency for the country.
49 50 51 |
# File 'lib/bitex/usd_deposit.rb', line 49 def currency @currency end |
#deposit_method ⇒ Object
The method used for this deposit
-
:astropay
-
:other
25 26 27 |
# File 'lib/bitex/usd_deposit.rb', line 25 def deposit_method @deposit_method end |
#id ⇒ Integer
Returns This UsdDeposit’s unique ID.
7 8 9 |
# File 'lib/bitex/usd_deposit.rb', line 7 def id @id end |
#kyc_profile_id ⇒ Object
KYC profile on whose behalf this deposit is being created.
53 54 55 |
# File 'lib/bitex/usd_deposit.rb', line 53 def kyc_profile_id @kyc_profile_id end |
#reason ⇒ Object
The reason for cancellation of this deposit, if any.
-
:not_cancelled.
-
:did_not_credit funds never arrived to our end.
-
:sender_unknown we could not accept these funds because you’re not the sender.
-
:other we’ll contact you regarding this deposit.
-
:user_cancelled We cancelled this deposit per your request.
41 42 43 |
# File 'lib/bitex/usd_deposit.rb', line 41 def reason @reason end |
#request_details ⇒ Object
Details for our account officers about this deposit.
57 58 59 |
# File 'lib/bitex/usd_deposit.rb', line 57 def request_details @request_details end |
#requested_amount ⇒ BigDecimal
Returns For pre-announced deposits, this is the amount you requested to deposit.
15 16 17 |
# File 'lib/bitex/usd_deposit.rb', line 15 def requested_amount @requested_amount end |
#status ⇒ Object
The status of this deposit.
-
:pending your deposit notice was received, we’re waiting for the funds to credit.
-
:done your deposit credited correctly, the funds are available in your balance.
-
:cancelled your deposit did not credit, check the ‘reason’ field.
32 33 34 |
# File 'lib/bitex/usd_deposit.rb', line 32 def status @status end |
#third_party_reference ⇒ Object
This deposit’s id as issued by the third party payment processor, if any.
66 67 68 |
# File 'lib/bitex/usd_deposit.rb', line 66 def third_party_reference @third_party_reference end |
Class Method Details
.all ⇒ Object
111 112 113 |
# File 'lib/bitex/usd_deposit.rb', line 111 def self.all Api.private(:get, '/private/usd/deposits').map { |d| from_json(d) } end |
.create!(country, amount, currency, method, details, profile = nil) ⇒ Object
rubocop:enable Metrics/AbcSize
87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/bitex/usd_deposit.rb', line 87 def self.create!(country, amount, currency, method, details, profile = nil) from_json( Api.private( :post, '/private/usd/deposits', country: country, amount: amount, currency: currency, deposit_method: method, request_details: details, kyc_profile_id: profile ) ) end |
.deposit_methods ⇒ Object
115 116 117 |
# File 'lib/bitex/usd_deposit.rb', line 115 def self.deposit_methods { 1 => :astropay, 2 => :other } end |
.find(id) ⇒ Object
102 103 104 |
# File 'lib/bitex/usd_deposit.rb', line 102 def self.find(id) from_json(Api.private(:get, "/private/usd/deposits/#{id}")) end |
.reasons ⇒ Object
123 124 125 |
# File 'lib/bitex/usd_deposit.rb', line 123 def self.reasons { 0 => :not_cancelled, 1 => :did_not_credit, 2 => :sender_unknown, 3 => :other, 4 => :user_cancelled } end |
.statuses ⇒ Object
119 120 121 |
# File 'lib/bitex/usd_deposit.rb', line 119 def self.statuses { 1 => :pending, 2 => :done, 3 => :cancelled } end |