Class: OffsitePayments::Integrations::Paysbuy::Notification
- Inherits:
-
Notification
- Object
- Notification
- OffsitePayments::Integrations::Paysbuy::Notification
show all
- Defined in:
- lib/offsite_payments/integrations/paysbuy.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, #iso_currency, #test?, #valid_sender?
Instance Method Details
#acknowledge(authcode = nil) ⇒ Object
65
66
67
|
# File 'lib/offsite_payments/integrations/paysbuy.rb', line 65
def acknowledge(authcode = nil)
true
end
|
#complete? ⇒ Boolean
43
44
45
|
# File 'lib/offsite_payments/integrations/paysbuy.rb', line 43
def complete?
status == 'Completed'
end
|
#item_id ⇒ Object
47
48
49
|
# File 'lib/offsite_payments/integrations/paysbuy.rb', line 47
def item_id
params['result'][2..-1]
end
|
#status ⇒ Object
51
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/offsite_payments/integrations/paysbuy.rb', line 51
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
|