Class: OffsitePayments::Integrations::CheckoutFinland::Notification
- Inherits:
-
Notification
- Object
- Notification
- OffsitePayments::Integrations::CheckoutFinland::Notification
- Defined in:
- lib/offsite_payments/integrations/checkout_finland.rb
Instance Attribute Summary
Attributes inherited from Notification
Instance Method Summary collapse
-
#acknowledge(authcode = nil) ⇒ Object
Verify authenticity of returned data.
-
#activation? ⇒ Boolean
Payment requires manual activation (fraud check etc).
-
#cancelled? ⇒ Boolean
Did the customer cancel the payment.
-
#complete? ⇒ Boolean
Payment can be market complete with the following status codes.
-
#delayed? ⇒ Boolean
Did the customer choose delayed payment method.
-
#mac ⇒ Object
Returned Message Authentication Code.
-
#reference ⇒ Object
Reference specified by the client when sending payment.
-
#stamp ⇒ Object
Unique ID assigned by customer.
- #status ⇒ Object
-
#transaction_id ⇒ Object
Unique ID assigned by Checkout.
Methods inherited from Notification
#amount, #empty!, #gross, #gross_cents, #initialize, #iso_currency, #test?, #valid_sender?
Constructor Details
This class inherits a constructor from OffsitePayments::Notification
Instance Method Details
#acknowledge(authcode = nil) ⇒ Object
Verify authenticity of returned data
150 151 152 153 |
# File 'lib/offsite_payments/integrations/checkout_finland.rb', line 150 def acknowledge(authcode = nil) return_authcode = [params["VERSION"], params["STAMP"], params["REFERENCE"], params["PAYMENT"], params["STATUS"], params["ALGORITHM"]].join("&") OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), authcode, return_authcode).upcase == params["MAC"] end |
#activation? ⇒ Boolean
Payment requires manual activation (fraud check etc)
121 122 123 |
# File 'lib/offsite_payments/integrations/checkout_finland.rb', line 121 def activation? params['STATUS'] == "7" end |
#cancelled? ⇒ Boolean
Did the customer cancel the payment
116 117 118 |
# File 'lib/offsite_payments/integrations/checkout_finland.rb', line 116 def cancelled? params['STATUS'] == "-1" end |
#complete? ⇒ Boolean
Payment can be market complete with the following status codes
106 107 108 |
# File 'lib/offsite_payments/integrations/checkout_finland.rb', line 106 def complete? ["2", "5", "6", "8", "9", "10"].include? params["STATUS"] end |
#delayed? ⇒ Boolean
Did the customer choose delayed payment method
111 112 113 |
# File 'lib/offsite_payments/integrations/checkout_finland.rb', line 111 def delayed? params['STATUS'] == "3" end |
#mac ⇒ Object
Returned Message Authentication Code
141 142 143 |
# File 'lib/offsite_payments/integrations/checkout_finland.rb', line 141 def mac params['MAC'] end |
#reference ⇒ Object
Reference specified by the client when sending payment
126 127 128 |
# File 'lib/offsite_payments/integrations/checkout_finland.rb', line 126 def reference params['REFERENCE'] end |
#stamp ⇒ Object
Unique ID assigned by customer
136 137 138 |
# File 'lib/offsite_payments/integrations/checkout_finland.rb', line 136 def stamp params['STAMP'] end |
#status ⇒ Object
145 146 147 |
# File 'lib/offsite_payments/integrations/checkout_finland.rb', line 145 def status params['STATUS'] end |
#transaction_id ⇒ Object
Unique ID assigned by Checkout
131 132 133 |
# File 'lib/offsite_payments/integrations/checkout_finland.rb', line 131 def transaction_id params['PAYMENT'] end |