Class: PaysonAPI::Response::Payment
- Inherits:
-
Object
- Object
- PaysonAPI::Response::Payment
- Defined in:
- lib/payson_api/response/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
6 7 8 9 10 |
# File 'lib/payson_api/response/payment.rb', line 6 def initialize(data) @envelope = Envelope.parse(data) @token = data['TOKEN'] @errors = RemoteError.parse(data) end |
Instance Attribute Details
#envelope ⇒ Object
Returns the value of attribute envelope.
4 5 6 |
# File 'lib/payson_api/response/payment.rb', line 4 def envelope @envelope end |
#errors ⇒ Object
Returns the value of attribute errors.
4 5 6 |
# File 'lib/payson_api/response/payment.rb', line 4 def errors @errors end |
#token ⇒ Object
Returns the value of attribute token.
4 5 6 |
# File 'lib/payson_api/response/payment.rb', line 4 def token @token end |
Instance Method Details
#forward_url ⇒ Object
16 17 18 19 |
# File 'lib/payson_api/response/payment.rb', line 16 def forward_url PAYSON_WWW_HOST % (PaysonAPI.test? ? 'test-www' : 'www') + PAYSON_WWW_PAY_FORWARD_URL % @token end |
#success? ⇒ Boolean
12 13 14 |
# File 'lib/payson_api/response/payment.rb', line 12 def success? @envelope.ack == 'SUCCESS' end |