Class: ActiveMerchant::Billing::Integrations::Paysbuy::Notification

Inherits:
Notification
  • Object
show all
Defined in:
lib/active_merchant/billing/integrations/paysbuy/notification.rb

Constant Summary collapse

SUCCESS =
'00'
FAIL =
'99'

Instance Attribute Summary

Attributes inherited from Notification

#params, #raw

Instance Method Summary collapse

Methods inherited from Notification

#amount, #empty!, #gross, #gross_cents, #initialize, #test?, #valid_sender?

Constructor Details

This class inherits a constructor from ActiveMerchant::Billing::Integrations::Notification

Instance Method Details

#acknowledgeObject



21
22
23
# File 'lib/active_merchant/billing/integrations/paysbuy/notification.rb', line 21

def acknowledge
  true
end

#complete?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/active_merchant/billing/integrations/paysbuy/notification.rb', line 9

def complete?
  status == 'Completed'
end

#item_idObject



13
14
15
# File 'lib/active_merchant/billing/integrations/paysbuy/notification.rb', line 13

def item_id
  params['result'][2..-1]
end

#statusObject



17
18
19
# File 'lib/active_merchant/billing/integrations/paysbuy/notification.rb', line 17

def status
  params['result'][0..1] == SUCCESS ? 'Completed' : 'Failed'
end