Class: ActiveMerchant::Billing::Integrations::Gestpay::Notification
- Inherits:
-
Notification
- Object
- Notification
- ActiveMerchant::Billing::Integrations::Gestpay::Notification
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
#amount, #empty!, #gross_cents, #initialize, #valid_sender?
Instance Method Details
#acknowledge ⇒ Object
47
48
49
|
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 47
def acknowledge
true
end
|
#complete? ⇒ Boolean
10
11
12
|
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 10
def complete?
status == 'Completed'
end
|
#currency ⇒ Object
28
29
30
31
32
|
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 28
def currency
method = CURRENCY_MAPPING.respond_to?(:key) ? :key : :index
CURRENCY_MAPPING.send(method, params['PAY1_UICCODE'])
end
|
#gross ⇒ Object
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_id ⇒ Object
15
16
17
|
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 15
def item_id
params['PAY1_SHOPTRANSACTIONID']
end
|
#status ⇒ Object
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
34
35
36
|
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 34
def test?
false
end
|
#transaction_id ⇒ Object
19
20
21
|
# File 'lib/active_merchant/billing/integrations/gestpay/notification.rb', line 19
def transaction_id
params['PAY1_BANKTRANSACTIONID']
end
|