Class: ActiveMerchant::Billing::Integrations::Paydollar::Notification
- Inherits:
-
Notification
- Object
- Notification
- ActiveMerchant::Billing::Integrations::Paydollar::Notification
show all
- Defined in:
- lib/active_merchant/billing/integrations/paydollar/notification.rb
Instance Attribute Summary
Attributes inherited from Notification
#params, #raw
Instance Method Summary
collapse
#amount, #empty!, #gross_cents, #initialize, #test?, #valid_sender?
Instance Method Details
#acknowledge(authcode = nil) ⇒ Object
37
38
39
40
41
42
43
44
45
|
# File 'lib/active_merchant/billing/integrations/paydollar/notification.rb', line 37
def acknowledge(authcode = nil)
hash = @params['secureHash']
if !hash
return false
end
hash.split(',').include? generate_secure_hash
end
|
#complete? ⇒ Boolean
10
11
12
|
# File 'lib/active_merchant/billing/integrations/paydollar/notification.rb', line 10
def complete?
status == 'Completed'
end
|
#currency ⇒ Object
18
19
20
|
# File 'lib/active_merchant/billing/integrations/paydollar/notification.rb', line 18
def currency
CURRENCY_MAP.key(@params['Cur'])
end
|
#gross ⇒ Object
22
23
24
|
# File 'lib/active_merchant/billing/integrations/paydollar/notification.rb', line 22
def gross
@params['Amt']
end
|
#item_id ⇒ Object
14
15
16
|
# File 'lib/active_merchant/billing/integrations/paydollar/notification.rb', line 14
def item_id
@params['Ref']
end
|
#status ⇒ Object
30
31
32
33
34
35
|
# File 'lib/active_merchant/billing/integrations/paydollar/notification.rb', line 30
def status
case @params['successcode']
when '0' then 'Completed'
else 'Failed'
end
end
|
#transaction_id ⇒ Object
26
27
28
|
# File 'lib/active_merchant/billing/integrations/paydollar/notification.rb', line 26
def transaction_id
@params['PayRef']
end
|