Class: ActiveMerchant::Billing::Integrations::Dwolla::Return

Inherits:
Return
  • Object
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

Returns:

  • (Boolean)


42
43
44
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 42

def callback_success?
  (params['postback'] != "failure")
end

#checkout_idObject



30
31
32
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 30

def checkout_id
  params['checkoutId']
end

#errorObject



22
23
24
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 22

def error
  params['error']
end

#error_descriptionObject



26
27
28
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 26

def error_description
  params['error_description']
end

#success?Boolean

Returns:

  • (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

Returns:

  • (Boolean)


38
39
40
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 38

def test?
  params['test'] != nil
end

#transactionObject



34
35
36
# File 'lib/active_merchant/billing/integrations/dwolla/return.rb', line 34

def transaction
  params['transaction']
end