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
161
162
163
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 161
def acknowledge(authcode = nil)
true
end
|
#complete? ⇒ Boolean
124
125
126
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 124
def complete?
status == 'Completed'
end
|
#currency ⇒ Object
142
143
144
145
146
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 142
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.
138
139
140
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 138
def gross
params['PAY1_AMOUNT']
end
|
#item_id ⇒ Object
129
130
131
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 129
def item_id
params['PAY1_SHOPTRANSACTIONID']
end
|
#status ⇒ Object
152
153
154
155
156
157
158
159
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 152
def status
case params['PAY1_TRANSACTIONRESULT']
when 'OK'
'Completed'
else
'Failed'
end
end
|
#test? ⇒ Boolean
148
149
150
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 148
def test?
false
end
|
#transaction_id ⇒ Object
133
134
135
|
# File 'lib/offsite_payments/integrations/gestpay.rb', line 133
def transaction_id
params['PAY1_BANKTRANSACTIONID']
end
|