Class: Bitex::Payment
- Inherits:
-
Object
- Object
- Bitex::Payment
- Defined in:
- lib/bitex/payment.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#confirmed_quantity ⇒ Object
Returns the value of attribute confirmed_quantity.
-
#currency_id ⇒ Object
Returns the value of attribute currency_id.
-
#customer_reference ⇒ Object
Returns the value of attribute customer_reference.
-
#expected_quantity ⇒ Object
Returns the value of attribute expected_quantity.
-
#id ⇒ Object
Returns the value of attribute id.
-
#keep ⇒ Object
Returns the value of attribute keep.
-
#last_quoted_on ⇒ Object
Returns the value of attribute last_quoted_on.
-
#merchant_reference ⇒ Object
Returns the value of attribute merchant_reference.
-
#previous_expected_quantity ⇒ Object
Returns the value of attribute previous_expected_quantity.
-
#quote_valid_until ⇒ Object
Returns the value of attribute quote_valid_until.
-
#settlement_amount ⇒ Object
Returns the value of attribute settlement_amount.
-
#settlement_currency_id ⇒ Object
Returns the value of attribute settlement_currency_id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#unconfirmed_quantity ⇒ Object
Returns the value of attribute unconfirmed_quantity.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#valid_until ⇒ Object
Returns the value of attribute valid_until.
Class Method Summary collapse
- .all ⇒ Object
- .create!(params) ⇒ Object
- .find(id) ⇒ Object
-
.from_callback(callback_params) ⇒ Object
Validate a callback and parse the given payment from it.
-
.pos_setup!(params) ⇒ Object
Sets up the web-pos.
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
3 4 5 |
# File 'lib/bitex/payment.rb', line 3 def address @address end |
#amount ⇒ Object
Returns the value of attribute amount.
3 4 5 |
# File 'lib/bitex/payment.rb', line 3 def amount @amount end |
#confirmed_quantity ⇒ Object
Returns the value of attribute confirmed_quantity.
3 4 5 |
# File 'lib/bitex/payment.rb', line 3 def confirmed_quantity @confirmed_quantity end |
#currency_id ⇒ Object
Returns the value of attribute currency_id.
3 4 5 |
# File 'lib/bitex/payment.rb', line 3 def currency_id @currency_id end |
#customer_reference ⇒ Object
Returns the value of attribute customer_reference.
3 4 5 |
# File 'lib/bitex/payment.rb', line 3 def customer_reference @customer_reference end |
#expected_quantity ⇒ Object
Returns the value of attribute expected_quantity.
3 4 5 |
# File 'lib/bitex/payment.rb', line 3 def expected_quantity @expected_quantity end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/bitex/payment.rb', line 3 def id @id end |
#keep ⇒ Object
Returns the value of attribute keep.
3 4 5 |
# File 'lib/bitex/payment.rb', line 3 def keep @keep end |
#last_quoted_on ⇒ Object
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_reference ⇒ Object
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_quantity ⇒ Object
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_until ⇒ Object
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_amount ⇒ Object
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_id ⇒ Object
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 |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/bitex/payment.rb', line 3 def status @status end |
#unconfirmed_quantity ⇒ Object
Returns the value of attribute unconfirmed_quantity.
3 4 5 |
# File 'lib/bitex/payment.rb', line 3 def unconfirmed_quantity @unconfirmed_quantity end |
#user_id ⇒ Object
Returns the value of attribute user_id.
3 4 5 |
# File 'lib/bitex/payment.rb', line 3 def user_id @user_id end |
#valid_until ⇒ Object
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
.all ⇒ Object
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 |