Class: PaysonAPI::V1::Responses::Payment

Inherits:
Object
  • Object
show all
Defined in:
lib/payson_api/v1/responses/payment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#envelopeObject

Returns the value of attribute envelope.



7
8
9
# File 'lib/payson_api/v1/responses/payment.rb', line 7

def envelope
  @envelope
end

#errorsObject

Returns the value of attribute errors.



7
8
9
# File 'lib/payson_api/v1/responses/payment.rb', line 7

def errors
  @errors
end

#tokenObject

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_urlObject



19
20
21
# File 'lib/payson_api/v1/responses/payment.rb', line 19

def forward_url
  PaysonAPI::V1.forward_url(@token)
end

#success?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/payson_api/v1/responses/payment.rb', line 15

def success?
  @envelope.ack == 'SUCCESS'
end