Class: Transbank::Onepay::RefundCreateResponse
- Inherits:
-
Object
- Object
- Transbank::Onepay::RefundCreateResponse
- Includes:
- Response
- Defined in:
- lib/transbank/sdk/onepay/responses/refund_create_response.rb
Overview
Serializes the response to a RefundCreateRequest
Instance Attribute Summary collapse
-
#external_unique_number ⇒ Object
Returns the value of attribute external_unique_number.
-
#issued_at ⇒ Object
Returns the value of attribute issued_at.
-
#occ ⇒ Object
Returns the value of attribute occ.
-
#reverse_code ⇒ Object
Returns the value of attribute reverse_code.
-
#signature ⇒ Object
Returns the value of attribute signature.
Attributes included from Response
Instance Method Summary collapse
-
#initialize(json) ⇒ RefundCreateResponse
constructor
A new instance of RefundCreateResponse.
Methods included from Response
#full_description, #response_ok?
Methods included from Utils::SignatureUtils
#hmac_sha256, #signature_for, #to_data, #valid_signature?
Methods included from Utils::JSONUtils
included, #jsonify, #transform_hash_keys, #underscore
Constructor Details
#initialize(json) ⇒ RefundCreateResponse
Returns a new instance of RefundCreateResponse.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/transbank/sdk/onepay/responses/refund_create_response.rb', line 9 def initialize(json) unless json.fetch('responseCode').downcase == 'ok' raise Errors::RefundCreateError, "#{json.fetch('responseCode')} : #{json.fetch('description')}" end result = json.fetch('result') @response_code = json.fetch('responseCode') @description = json.fetch('description') @occ = result.fetch('occ') @external_unique_number = result.fetch('externalUniqueNumber') @reverse_code = result.fetch('reverseCode') @issued_at = result.fetch('issuedAt') @signature = result.fetch('signature') end |
Instance Attribute Details
#external_unique_number ⇒ Object
Returns the value of attribute external_unique_number.
6 7 8 |
# File 'lib/transbank/sdk/onepay/responses/refund_create_response.rb', line 6 def external_unique_number @external_unique_number end |
#issued_at ⇒ Object
Returns the value of attribute issued_at.
6 7 8 |
# File 'lib/transbank/sdk/onepay/responses/refund_create_response.rb', line 6 def issued_at @issued_at end |
#occ ⇒ Object
Returns the value of attribute occ.
6 7 8 |
# File 'lib/transbank/sdk/onepay/responses/refund_create_response.rb', line 6 def occ @occ end |
#reverse_code ⇒ Object
Returns the value of attribute reverse_code.
6 7 8 |
# File 'lib/transbank/sdk/onepay/responses/refund_create_response.rb', line 6 def reverse_code @reverse_code end |
#signature ⇒ Object
Returns the value of attribute signature.
6 7 8 |
# File 'lib/transbank/sdk/onepay/responses/refund_create_response.rb', line 6 def signature @signature end |