Class: Bancard::SingleBuyInitResponse
- Inherits:
-
Object
- Object
- Bancard::SingleBuyInitResponse
- Defined in:
- lib/bancard/single_buy_init_response.rb
Constant Summary collapse
- REDIRECT_PATH =
'/payment/single_buy'
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
-
#initialize(response) ⇒ SingleBuyInitResponse
constructor
A new instance of SingleBuyInitResponse.
- #message ⇒ Object
- #params ⇒ Object
- #payment_url ⇒ Object
- #process_id ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ SingleBuyInitResponse
Returns a new instance of SingleBuyInitResponse.
9 10 11 12 |
# File 'lib/bancard/single_buy_init_response.rb', line 9 def initialize(response) @original_response = response @body = JSON.parse(response.body) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/bancard/single_buy_init_response.rb', line 6 def body @body end |
Instance Method Details
#message ⇒ Object
30 31 |
# File 'lib/bancard/single_buy_init_response.rb', line 30 def end |
#params ⇒ Object
18 19 20 |
# File 'lib/bancard/single_buy_init_response.rb', line 18 def params body.merge 'payment_url' => payment_url end |
#payment_url ⇒ Object
22 23 24 |
# File 'lib/bancard/single_buy_init_response.rb', line 22 def payment_url Bancard.vpos_url(REDIRECT_PATH) + "?process_id=#{process_id}" end |
#process_id ⇒ Object
26 27 28 |
# File 'lib/bancard/single_buy_init_response.rb', line 26 def process_id body['process_id'] end |
#success? ⇒ Boolean
14 15 16 |
# File 'lib/bancard/single_buy_init_response.rb', line 14 def success? body['status'] == 'success' end |