Class: Bitex::Payment

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#addressObject

Returns the value of attribute address.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def address
  @address
end

#amountObject

Returns the value of attribute amount.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def amount
  @amount
end

#confirmed_quantityObject

Returns the value of attribute confirmed_quantity.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def confirmed_quantity
  @confirmed_quantity
end

#currency_idObject

Returns the value of attribute currency_id.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def currency_id
  @currency_id
end

#customer_referenceObject

Returns the value of attribute customer_reference.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def customer_reference
  @customer_reference
end

#expected_quantityObject

Returns the value of attribute expected_quantity.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def expected_quantity
  @expected_quantity
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def id
  @id
end

#keepObject

Returns the value of attribute keep.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def keep
  @keep
end

#last_quoted_onObject

Returns the value of attribute last_quoted_on.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def last_quoted_on
  @last_quoted_on
end

#merchant_referenceObject

Returns the value of attribute merchant_reference.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def merchant_reference
  @merchant_reference
end

#previous_expected_quantityObject

Returns the value of attribute previous_expected_quantity.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def previous_expected_quantity
  @previous_expected_quantity
end

#quote_valid_untilObject

Returns the value of attribute quote_valid_until.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def quote_valid_until
  @quote_valid_until
end

#settlement_amountObject

Returns the value of attribute settlement_amount.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def settlement_amount
  @settlement_amount
end

#settlement_currency_idObject

Returns the value of attribute settlement_currency_id.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def settlement_currency_id
  @settlement_currency_id
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def status
  @status
end

#unconfirmed_quantityObject

Returns the value of attribute unconfirmed_quantity.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def unconfirmed_quantity
  @unconfirmed_quantity
end

#user_idObject

Returns the value of attribute user_id.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def user_id
  @user_id
end

#valid_untilObject

Returns the value of attribute valid_until.



3
4
5
# File 'lib/bitex/payment.rb', line 3

def valid_until
  @valid_until
end

Class Method Details

.allObject



33
34
35
# File 'lib/bitex/payment.rb', line 33

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

.create!(params) ⇒ Object



25
26
27
# File 'lib/bitex/payment.rb', line 25

def self.create!(params)
  from_json(Api.private(:post, "/private/payments", params))
end

.find(id) ⇒ Object



29
30
31
# File 'lib/bitex/payment.rb', line 29

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

.from_callback(callback_params) ⇒ Object

Validate a callback and parse the given payment from it. Returns nil if the callback was invalid.



39
40
41
# File 'lib/bitex/payment.rb', line 39

def self.from_callback(callback_params)
  from_json(callback_params["payment"]) if callback_params["api_key"] == Bitex.api_key
end

.pos_setup!(params) ⇒ Object

Sets up the web-pos



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

def self.pos_setup!(params)
  Api.private(:post, "/private/payments/pos_setup", params)
end