Class: PayCertify::ThreeDS::Callback
- Inherits:
-
HashWithIndifferentAccess
- Object
- HashWithIndifferentAccess
- PayCertify::ThreeDS::Callback
- Defined in:
- lib/paycertify/three_ds/callback.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
Returns the value of attribute params.
-
#session ⇒ Object
Returns the value of attribute session.
Instance Method Summary collapse
- #authenticate! ⇒ Object
- #authentication? ⇒ Boolean
- #execute_transaction? ⇒ Boolean
- #handshake ⇒ Object
-
#initialize(params = {}, session = {}) ⇒ Callback
constructor
A new instance of Callback.
- #redirect_to(location) ⇒ Object
Constructor Details
#initialize(params = {}, session = {}) ⇒ Callback
7 8 9 10 11 12 |
# File 'lib/paycertify/three_ds/callback.rb', line 7 def initialize(params={}, session={}) self.params = params.to_h self.session = session.to_h super(self.params.merge(self.session)) end |
Instance Attribute Details
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'lib/paycertify/three_ds/callback.rb', line 5 def params @params end |
#session ⇒ Object
Returns the value of attribute session.
5 6 7 |
# File 'lib/paycertify/three_ds/callback.rb', line 5 def session @session end |
Instance Method Details
#authenticate! ⇒ Object
30 31 32 |
# File 'lib/paycertify/three_ds/callback.rb', line 30 def authenticate! PayCertify::ThreeDS.authenticate!(settings: session, callback_params: params) end |
#authentication? ⇒ Boolean
14 15 16 |
# File 'lib/paycertify/three_ds/callback.rb', line 14 def authentication? !execute_transaction? && self['PaRes'].present? end |
#execute_transaction? ⇒ Boolean
18 19 20 |
# File 'lib/paycertify/three_ds/callback.rb', line 18 def execute_transaction? self['_frictionless_3ds_callback'].present? end |
#handshake ⇒ Object
22 23 24 |
# File 'lib/paycertify/three_ds/callback.rb', line 22 def handshake self.slice('cavv', 'eci', 'cavv_algorithm', 'xid') end |
#redirect_to(location) ⇒ Object
26 27 28 |
# File 'lib/paycertify/three_ds/callback.rb', line 26 def redirect_to(location) "<script>window.location.href = '#{location}'</script>" end |