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
140
141
142
143
144
145
146
147
148
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 140
def acknowledge(authcode = nil)
hash = @params['secureHash']
if !hash
return false
end
hash.split(',').include? generate_secure_hash
end
|
#complete? ⇒ Boolean
113
114
115
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 113
def complete?
status == 'Completed'
end
|
#currency ⇒ Object
121
122
123
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 121
def currency
CURRENCY_MAP.key(@params['Cur'])
end
|
#gross ⇒ Object
125
126
127
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 125
def gross
@params['Amt']
end
|
#item_id ⇒ Object
117
118
119
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 117
def item_id
@params['Ref']
end
|
#status ⇒ Object
133
134
135
136
137
138
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 133
def status
case @params['successcode']
when '0' then 'Completed'
else 'Failed'
end
end
|
#transaction_id ⇒ Object
129
130
131
|
# File 'lib/offsite_payments/integrations/paydollar.rb', line 129
def transaction_id
@params['PayRef']
end
|