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



47
48
49
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 47

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
31
32
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 28

def currency
  # Ruby 1.9 compat
  method = CURRENCY_MAPPING.respond_to?(:key) ? :key : :index
  CURRENCY_MAPPING.send(method, 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



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

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

#test?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 34

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