Class: ActiveMerchant::Billing::Integrations::Gestpay::Notification

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

Constant Summary

Constants included from Common

Common::CURRENCY_MAPPING, Common::DECRYPTION_PATH, Common::DELIMITER, Common::ENCRYPTION_PATH, Common::VERSION

Instance Attribute Summary

Attributes inherited from Notification

#params, #raw

Instance Method Summary collapse

Methods included from Common

#parse_response, #ssl_get

Methods inherited from Notification

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

Constructor Details

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

Instance Method Details

#acknowledgeObject



45
46
47
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 45

def acknowledge
  true
end

#complete?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 10

def complete?
  status == 'Completed'
end

#currencyObject



28
29
30
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 28

def currency
  CURRENCY_MAPPING.index(params['PAY1_UICCODE'])
end

#grossObject

the money amount we received in X.2 decimal.



24
25
26
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 24

def gross
  params['PAY1_AMOUNT']
end

#item_idObject

The important param



15
16
17
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 15

def item_id
  params['PAY1_SHOPTRANSACTIONID']
end

#statusObject



36
37
38
39
40
41
42
43
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 36

def status
  case params['PAY1_TRANSACTIONRESULT']
  when 'OK'
    'Completed'
  else
    'Failed'
  end
end

#test?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 32

def test?
  false
end

#transaction_idObject



19
20
21
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 19

def transaction_id
  params['PAY1_BANKTRANSACTIONID']
end