Class: Bitex::Payment

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

Overview

Documentation here!

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#addressObject

Returns the value of attribute address.



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

def address
  @address
end

#amountObject

Returns the value of attribute amount.



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

def amount
  @amount
end

#confirmed_quantityObject

Returns the value of attribute confirmed_quantity.



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

def confirmed_quantity
  @confirmed_quantity
end

#currency_idObject

Returns the value of attribute currency_id.



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

def currency_id
  @currency_id
end

#customer_referenceObject

Returns the value of attribute customer_reference.



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

def customer_reference
  @customer_reference
end

#expected_quantityObject

Returns the value of attribute expected_quantity.



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

def expected_quantity
  @expected_quantity
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#keepObject

Returns the value of attribute keep.



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

def keep
  @keep
end

#last_quoted_onObject

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_referenceObject

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_quantityObject

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_untilObject

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_amountObject

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_idObject

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

#statusObject

Returns the value of attribute status.



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

def status
  @status
end

#unconfirmed_quantityObject

Returns the value of attribute unconfirmed_quantity.



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

def unconfirmed_quantity
  @unconfirmed_quantity
end

#user_idObject

Returns the value of attribute user_id.



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

def user_id
  @user_id
end

#valid_untilObject

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

.allObject



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

.pos_setup!(params) ⇒ Object

Sets up the web-pos



51
52
53
# File 'lib/bitex/payment.rb', line 51

def self.pos_setup!(params)
  Api.private(:post, "#{base_uri}/pos_setup", params)
end