Class: ActiveMerchant::Billing::Integrations::Paysbuy::Notification
- Inherits:
-
Notification
- Object
- Notification
- ActiveMerchant::Billing::Integrations::Paysbuy::Notification
show all
- Defined in:
- lib/active_merchant/billing/integrations/paysbuy/notification.rb
Constant Summary
collapse
- SUCCESS =
'00'
- FAIL =
'99'
- PENDING =
'02'
Instance Attribute Summary
Attributes inherited from Notification
#params, #raw
Instance Method Summary
collapse
#amount, #empty!, #gross, #gross_cents, #initialize, #test?, #valid_sender?
Instance Method Details
#acknowledge(authcode = nil) ⇒ Object
32
33
34
|
# File 'lib/active_merchant/billing/integrations/paysbuy/notification.rb', line 32
def acknowledge(authcode = nil)
true
end
|
#complete? ⇒ Boolean
10
11
12
|
# File 'lib/active_merchant/billing/integrations/paysbuy/notification.rb', line 10
def complete?
status == 'Completed'
end
|
#item_id ⇒ Object
14
15
16
|
# File 'lib/active_merchant/billing/integrations/paysbuy/notification.rb', line 14
def item_id
params['result'][2..-1]
end
|
#status ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/active_merchant/billing/integrations/paysbuy/notification.rb', line 18
def status
status_code = params['result'][0..1]
case status_code
when SUCCESS
'Completed'
when FAIL
'Failed'
when PENDING
'Pending'
else
raise "Unknown status code"
end
end
|