Class: ActiveMerchant::Billing::AdaptivePaymentResponse
- Inherits:
-
Response
- Object
- Response
- ActiveMerchant::Billing::AdaptivePaymentResponse
show all
- Defined in:
- lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb
Constant Summary
collapse
- SUCCESS =
'Success'.freeze
Instance Attribute Summary collapse
-
#json ⇒ Object
(also: #raw)
readonly
Returns the value of attribute json.
Instance Method Summary
collapse
Constructor Details
Returns a new instance of AdaptivePaymentResponse.
13
14
15
16
|
# File 'lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb', line 13
def initialize(json)
@json = json
@response_rash = Hashie::Rash.new(MultiJson.decode(json))
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object
18
19
20
|
# File 'lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb', line 18
def method_missing(method, *args, &block)
@response_rash.send(method, *args, &block)
end
|
Instance Attribute Details
#json ⇒ Object
Also known as:
raw
Returns the value of attribute json.
10
11
12
|
# File 'lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb', line 10
def json
@json
end
|
Instance Method Details
#ack ⇒ Object
def redirect_url_for
Base.gateway_mode == :test ? (TEST_REDIRECT_URL + pay_key) : (REDIRECT_URL + pay_key)
end
26
27
28
|
# File 'lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb', line 26
def ack
response_envelope.ack
end
|
#build ⇒ Object
34
35
36
|
# File 'lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb', line 34
def build
response_envelope.build
end
|
#correlation_id ⇒ Object
Also known as:
correlationId
38
39
40
|
# File 'lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb', line 38
def correlation_id
response_envelope.correlation_id
end
|
#success? ⇒ Boolean
43
44
45
|
# File 'lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb', line 43
def success?
ack == SUCCESS
end
|
#timestamp ⇒ Object
30
31
32
|
# File 'lib/active_merchant/billing/gateways/paypal_adaptive_payments/adaptive_payment_response.rb', line 30
def timestamp
response_envelope.timestamp
end
|