Class: Bancard::SingleBuyRollback

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/bancard/single_buy_rollback.rb

Constant Summary collapse

ENDPOINT =
'/vpos/api/0.3/single_buy/rollback'

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#stringify_keys

Constructor Details

#initialize(given_params = {}) ⇒ SingleBuyRollback

Returns a new instance of SingleBuyRollback.



8
9
10
11
12
# File 'lib/bancard/single_buy_rollback.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_paramsObject

Returns the value of attribute given_params.



6
7
8
# File 'lib/bancard/single_buy_rollback.rb', line 6

def given_params
  @given_params
end

#private_keyObject

Returns the value of attribute private_key.



6
7
8
# File 'lib/bancard/single_buy_rollback.rb', line 6

def private_key
  @private_key
end

#public_keyObject

Returns the value of attribute public_key.



6
7
8
# File 'lib/bancard/single_buy_rollback.rb', line 6

def public_key
  @public_key
end

Instance Method Details

#operation_paramsObject



21
22
23
24
25
26
# File 'lib/bancard/single_buy_rollback.rb', line 21

def operation_params
  {
    shop_process_id: shop_process_id,
    token:           token,
  }
end

#request_paramsObject



14
15
16
17
18
19
# File 'lib/bancard/single_buy_rollback.rb', line 14

def request_params
  {
    operation:  operation_params,
    public_key: public_key,
  }
end