Class: Bitex::UsdDeposit

Inherits:
Object
  • Object
show all
Defined in:
lib/bitex/usd_deposit.rb

Overview

A deposit of USD to your bitex.la balance.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#amountBigDecimal

Returns Final amount credited to your bitex USD balance.

Returns:

  • (BigDecimal)

    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_bodyObject

Response from astropay if selected as the deposit method. The ‘url’ field should be the astropay payment url for this deposit.



65
66
67
# File 'lib/bitex/usd_deposit.rb', line 65

def astropay_response_body
  @astropay_response_body
end

#countryObject

Country of origin for this deposit.



48
49
50
# File 'lib/bitex/usd_deposit.rb', line 48

def country
  @country
end

#created_atTime

Returns Time when this deposit was announced by you.

Returns:

  • (Time)

    Time when this deposit was announced by you.



10
11
12
# File 'lib/bitex/usd_deposit.rb', line 10

def created_at
  @created_at
end

#currencyObject

Local currency for the country.



52
53
54
# File 'lib/bitex/usd_deposit.rb', line 52

def currency
  @currency
end

#deposit_methodObject

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

#idInteger

Returns This UsdDeposit’s unique ID.

Returns:

  • (Integer)

    This UsdDeposit’s unique ID.



6
7
8
# File 'lib/bitex/usd_deposit.rb', line 6

def id
  @id
end

#kyc_profile_idObject

KYC profile on whose behalf this deposit is being created.



56
57
58
# File 'lib/bitex/usd_deposit.rb', line 56

def kyc_profile_id
  @kyc_profile_id
end

#reasonObject

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.



44
45
46
# File 'lib/bitex/usd_deposit.rb', line 44

def reason
  @reason
end

#request_detailsObject

Details for our account officers about this deposit.



60
61
62
# File 'lib/bitex/usd_deposit.rb', line 60

def request_details
  @request_details
end

#requested_amountBigDecimal

Returns For pre-announced deposits, this is the amount you requested to deposit.

Returns:

  • (BigDecimal)

    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

#statusObject

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.



34
35
36
# File 'lib/bitex/usd_deposit.rb', line 34

def status
  @status
end

#third_party_referenceObject

This deposit’s id as issued by the third party payment processor, if any.



69
70
71
# File 'lib/bitex/usd_deposit.rb', line 69

def third_party_reference
  @third_party_reference
end

Class Method Details

.allObject



124
125
126
# File 'lib/bitex/usd_deposit.rb', line 124

def self.all
  Api.private(:get, "/private/usd/deposits").collect{|x| from_json(x) }
end

.create!(country, amount, currency, method, details, profile = nil) ⇒ Object



104
105
106
107
108
109
110
111
112
113
# File 'lib/bitex/usd_deposit.rb', line 104

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

.find(id) ⇒ Object



115
116
117
# File 'lib/bitex/usd_deposit.rb', line 115

def self.find(id)
  from_json(Api.private(:get, "/private/usd/deposits/#{id}"))
end

Instance Method Details

#cancel!Object



119
120
121
122
# File 'lib/bitex/usd_deposit.rb', line 119

def cancel!
  path = "/private/usd/deposits/#{self.id}/cancel"
  self.class.from_json(Api.private(:post, path), self)
end