Class: OffsitePayments::Integrations::Gestpay::Notification
Constant Summary
Constants included
from Common
Common::CURRENCY_MAPPING, Common::DECRYPTION_PATH, Common::DELIMITER, Common::ENCRYPTION_PATH, Common::GestpayEncryptionResponseError, 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, #iso_currency, #valid_sender?
Instance Method Details
#acknowledge(authcode = nil) ⇒ Object
163
164
165
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 163
def acknowledge(authcode = nil)
true
end
|
#complete? ⇒ Boolean
126
127
128
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 126
def complete?
status == 'Completed'
end
|
#currency ⇒ Object
144
145
146
147
148
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 144
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.
140
141
142
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 140
def gross
params['PAY1_AMOUNT']
end
|
#item_id ⇒ Object
131
132
133
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 131
def item_id
params['PAY1_SHOPTRANSACTIONID']
end
|
#status ⇒ Object
154
155
156
157
158
159
160
161
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 154
def status
case params['PAY1_TRANSACTIONRESULT']
when 'OK'
'Completed'
else
'Failed'
end
end
|
#test? ⇒ Boolean
150
151
152
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 150
def test?
false
end
|
#transaction_id ⇒ Object
135
136
137
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 135
def transaction_id
params['PAY1_BANKTRANSACTIONID']
end
|