Class: ActiveMerchant::Billing::Integrations::Dwolla::Return
- Inherits:
-
Return
- Object
- Return
- ActiveMerchant::Billing::Integrations::Dwolla::Return
show all
- Includes:
- Common
- Defined in:
- lib/active_merchant/billing/integrations/dwolla/return.rb
Instance Attribute Summary
Attributes inherited from Return
#notification, #params
Instance Method Summary
collapse
Methods included from Common
#verify_signature
Methods inherited from Return
#cancelled?, #message, #parse
Constructor Details
#initialize(data, options) ⇒ Return
Returns a new instance of Return.
8
9
10
11
12
13
14
15
16
|
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 8
def initialize(data, options)
params = parse(data)
if params['error'] != 'failure'
verify_signature(params['checkoutId'], params['amount'], params['signature'], options[:credential3])
end
super
end
|
Instance Method Details
#callback_success? ⇒ Boolean
42
43
44
|
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 42
def callback_success?
(params['postback'] != "failure")
end
|
#checkout_id ⇒ Object
30
31
32
|
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 30
def checkout_id
params['checkoutId']
end
|
#error ⇒ Object
22
23
24
|
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 22
def error
params['error']
end
|
#error_description ⇒ Object
26
27
28
|
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 26
def error_description
params['error_description']
end
|
#success? ⇒ Boolean
18
19
20
|
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 18
def success?
(self.error.nil? && self.callback_success?)
end
|
#test? ⇒ Boolean
38
39
40
|
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 38
def test?
params['test'] != nil
end
|
#transaction ⇒ Object
34
35
36
|
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 34
def transaction
params['transaction']
end
|