Class: OffsitePayments::Integrations::Paydollar::Notification
- Inherits:
-
Notification
- Object
- Notification
- OffsitePayments::Integrations::Paydollar::Notification
show all
- Defined in:
- lib/offsite_payments/integrations/paydollar.rb
Instance Attribute Summary
Attributes inherited from Notification
#params, #raw
Instance Method Summary
collapse
#amount, #empty!, #gross_cents, #initialize, #iso_currency, #test?, #valid_sender?
Instance Method Details
#acknowledge(authcode = nil) ⇒ Object
110
111
112
113
114
115
116
117
118
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 110
def acknowledge(authcode = nil)
hash = @params['secureHash']
if !hash
return false
end
hash.split(',').include? generate_secure_hash
end
|
#complete? ⇒ Boolean
83
84
85
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 83
def complete?
status == 'Completed'
end
|
#currency ⇒ Object
91
92
93
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 91
def currency
CURRENCY_MAP.key(@params['Cur'])
end
|
#gross ⇒ Object
95
96
97
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 95
def gross
@params['Amt']
end
|
#item_id ⇒ Object
87
88
89
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 87
def item_id
@params['Ref']
end
|
#status ⇒ Object
103
104
105
106
107
108
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 103
def status
case @params['successcode']
when '0' then 'Completed'
else 'Failed'
end
end
|
#transaction_id ⇒ Object
99
100
101
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 99
def transaction_id
@params['PayRef']
end
|