Class: PaysonAPI::V1::Responses::Payment
- Inherits:
-
Object
- Object
- PaysonAPI::V1::Responses::Payment
- Defined in:
- lib/payson_api/v1/responses/payment.rb
Instance Attribute Summary collapse
-
#envelope ⇒ Object
Returns the value of attribute envelope.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
- #forward_url ⇒ Object
-
#initialize(data) ⇒ Payment
constructor
A new instance of Payment.
- #success? ⇒ Boolean
Constructor Details
#initialize(data) ⇒ Payment
Returns a new instance of Payment.
9 10 11 12 13 |
# File 'lib/payson_api/v1/responses/payment.rb', line 9 def initialize(data) @envelope = PaysonAPI::V1::Envelope.parse(data) @token = data['TOKEN'] @errors = PaysonAPI::V1::RemoteError.parse(data) end |
Instance Attribute Details
#envelope ⇒ Object
Returns the value of attribute envelope.
7 8 9 |
# File 'lib/payson_api/v1/responses/payment.rb', line 7 def envelope @envelope end |
#errors ⇒ Object
Returns the value of attribute errors.
7 8 9 |
# File 'lib/payson_api/v1/responses/payment.rb', line 7 def errors @errors end |
#token ⇒ Object
Returns the value of attribute token.
7 8 9 |
# File 'lib/payson_api/v1/responses/payment.rb', line 7 def token @token end |
Instance Method Details
#forward_url ⇒ Object
19 20 21 |
# File 'lib/payson_api/v1/responses/payment.rb', line 19 def forward_url PaysonAPI::V1.forward_url(@token) end |
#success? ⇒ Boolean
15 16 17 |
# File 'lib/payson_api/v1/responses/payment.rb', line 15 def success? @envelope.ack == 'SUCCESS' end |