Class: Bitex::Payment
- Inherits:
-
Object
- Object
- Bitex::Payment
- Defined in:
- lib/bitex/payment.rb
Overview
Documentation here!
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.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def address @address end |
#amount ⇒ Object
Returns the value of attribute amount.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def amount @amount end |
#confirmed_quantity ⇒ Object
Returns the value of attribute confirmed_quantity.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def confirmed_quantity @confirmed_quantity end |
#currency_id ⇒ Object
Returns the value of attribute currency_id.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def currency_id @currency_id end |
#customer_reference ⇒ Object
Returns the value of attribute customer_reference.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def customer_reference @customer_reference end |
#expected_quantity ⇒ Object
Returns the value of attribute expected_quantity.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def expected_quantity @expected_quantity end |
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def id @id end |
#keep ⇒ Object
Returns the value of attribute keep.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def keep @keep end |
#last_quoted_on ⇒ Object
Returns the value of attribute last_quoted_on.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def last_quoted_on @last_quoted_on end |
#merchant_reference ⇒ Object
Returns the value of attribute merchant_reference.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def merchant_reference @merchant_reference end |
#previous_expected_quantity ⇒ Object
Returns the value of attribute previous_expected_quantity.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def previous_expected_quantity @previous_expected_quantity end |
#quote_valid_until ⇒ Object
Returns the value of attribute quote_valid_until.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def quote_valid_until @quote_valid_until end |
#settlement_amount ⇒ Object
Returns the value of attribute settlement_amount.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def settlement_amount @settlement_amount end |
#settlement_currency_id ⇒ Object
Returns the value of attribute settlement_currency_id.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def settlement_currency_id @settlement_currency_id end |
#status ⇒ Object
Returns the value of attribute status.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def status @status end |
#unconfirmed_quantity ⇒ Object
Returns the value of attribute unconfirmed_quantity.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def unconfirmed_quantity @unconfirmed_quantity end |
#user_id ⇒ Object
Returns the value of attribute user_id.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def user_id @user_id end |
#valid_until ⇒ Object
Returns the value of attribute valid_until.
6 7 8 |
# File 'lib/bitex/payment.rb', line 6 def valid_until @valid_until end |
Class Method Details
.all ⇒ Object
40 41 42 |
# File 'lib/bitex/payment.rb', line 40 def self.all Api.private(:get, base_uri).map { |payment| from_json(payment) } end |
.create!(params) ⇒ Object
32 33 34 |
# File 'lib/bitex/payment.rb', line 32 def self.create!(params) from_json(Api.private(:post, base_uri, params)) end |
.find(id) ⇒ Object
36 37 38 |
# File 'lib/bitex/payment.rb', line 36 def self.find(id) from_json(Api.private(:get, "#{base_uri}/#{id}")) end |
.from_callback(callback_params) ⇒ Object
Validate a callback and parse the given payment from it. Returns nil if the callback was invalid.
46 47 48 |
# File 'lib/bitex/payment.rb', line 46 def self.from_callback(callback_params) from_json(callback_params['payment']) if callback_params['api_key'] == Bitex.api_key end |