Class: OffsitePayments::Integrations::Dwolla::Return
- Inherits:
-
Return
- Object
- Return
- OffsitePayments::Integrations::Dwolla::Return
show all
- Includes:
- Common
- Defined in:
- lib/offsite_payments/integrations/dwolla.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.
120
121
122
123
124
125
126
127
128
|
# File 'lib/offsite_payments/integrations/dwolla.rb', line 120
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
154
155
156
|
# File 'lib/offsite_payments/integrations/dwolla.rb', line 154
def callback_success?
(params['postback'] != "failure")
end
|
#checkout_id ⇒ Object
142
143
144
|
# File 'lib/offsite_payments/integrations/dwolla.rb', line 142
def checkout_id
params['checkoutId']
end
|
#error ⇒ Object
134
135
136
|
# File 'lib/offsite_payments/integrations/dwolla.rb', line 134
def error
params['error']
end
|
#error_description ⇒ Object
138
139
140
|
# File 'lib/offsite_payments/integrations/dwolla.rb', line 138
def error_description
params['error_description']
end
|
#success? ⇒ Boolean
130
131
132
|
# File 'lib/offsite_payments/integrations/dwolla.rb', line 130
def success?
(self.error.nil? && self.callback_success?)
end
|
#test? ⇒ Boolean
150
151
152
|
# File 'lib/offsite_payments/integrations/dwolla.rb', line 150
def test?
params['test'] != nil
end
|
#transaction ⇒ Object
146
147
148
|
# File 'lib/offsite_payments/integrations/dwolla.rb', line 146
def transaction
params['transaction']
end
|