Class: Bancard::SingleBuyInit
- Inherits:
-
Object
- Object
- Bancard::SingleBuyInit
- Includes:
- Utils
- Defined in:
- lib/bancard/single_buy_init.rb
Constant Summary collapse
- ENDPOINT =
'/vpos/api/0.3/single_buy'
Instance Attribute Summary collapse
-
#given_params ⇒ Object
Returns the value of attribute given_params.
-
#private_key ⇒ Object
Returns the value of attribute private_key.
-
#public_key ⇒ Object
Returns the value of attribute public_key.
Instance Method Summary collapse
-
#initialize(given_params = {}) ⇒ SingleBuyInit
constructor
A new instance of SingleBuyInit.
- #operation_params ⇒ Object
- #request_params ⇒ Object
Methods included from Utils
Constructor Details
#initialize(given_params = {}) ⇒ SingleBuyInit
Returns a new instance of SingleBuyInit.
8 9 10 11 12 |
# File 'lib/bancard/single_buy_init.rb', line 8 def initialize(given_params = {}) @given_params = stringify_keys(given_params) @public_key = @given_params.delete('public_key') @private_key = @given_params.delete('private_key') end |
Instance Attribute Details
#given_params ⇒ Object
Returns the value of attribute given_params.
6 7 8 |
# File 'lib/bancard/single_buy_init.rb', line 6 def given_params @given_params end |
#private_key ⇒ Object
Returns the value of attribute private_key.
6 7 8 |
# File 'lib/bancard/single_buy_init.rb', line 6 def private_key @private_key end |
#public_key ⇒ Object
Returns the value of attribute public_key.
6 7 8 |
# File 'lib/bancard/single_buy_init.rb', line 6 def public_key @public_key end |
Instance Method Details
#operation_params ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/bancard/single_buy_init.rb', line 21 def operation_params { amount: formatted_amount, cancel_url: given_params['cancel_url'], currency: currency, description: given_params['description'], return_url: given_params['return_url'], shop_process_id: shop_process_id, token: token, } end |
#request_params ⇒ Object
14 15 16 17 18 19 |
# File 'lib/bancard/single_buy_init.rb', line 14 def request_params { operation: operation_params, public_key: public_key, } end |