Class: Portmone::Responses::Finish3DS
- Inherits:
-
Object
- Object
- Portmone::Responses::Finish3DS
- Defined in:
- lib/portmone/responses/finish_3ds.rb
Constant Summary collapse
- SUCCESS_STATUS =
'PAYED'.freeze
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #acs_url ⇒ Object
- #error_code ⇒ Object
- #error_description ⇒ Object
- #http_status ⇒ Object
-
#initialize(faraday_response, currency:, timezone:) ⇒ Finish3DS
constructor
A new instance of Finish3DS.
- #md ⇒ Object
- #pa_req ⇒ Object
- #required_3ds? ⇒ Boolean
- #success? ⇒ Boolean
Constructor Details
#initialize(faraday_response, currency:, timezone:) ⇒ Finish3DS
Returns a new instance of Finish3DS.
6 7 8 9 10 11 |
# File 'lib/portmone/responses/finish_3ds.rb', line 6 def initialize(faraday_response, currency:, timezone:) @response = faraday_response @currency = currency @timezone = timezone @response_body = @response.body.present? ? JSON.parse(@response.body) : { 'result' => {} } end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/portmone/responses/finish_3ds.rb', line 4 def response @response end |
Instance Method Details
#acs_url ⇒ Object
33 34 35 |
# File 'lib/portmone/responses/finish_3ds.rb', line 33 def acs_url result['actionMPI'] end |
#error_code ⇒ Object
21 22 23 |
# File 'lib/portmone/responses/finish_3ds.rb', line 21 def error_code result['errorCode'] end |
#error_description ⇒ Object
25 26 27 |
# File 'lib/portmone/responses/finish_3ds.rb', line 25 def error_description result['error'] end |
#http_status ⇒ Object
13 14 15 |
# File 'lib/portmone/responses/finish_3ds.rb', line 13 def http_status response.status end |
#md ⇒ Object
37 38 39 |
# File 'lib/portmone/responses/finish_3ds.rb', line 37 def md result['md'] end |
#pa_req ⇒ Object
41 42 43 |
# File 'lib/portmone/responses/finish_3ds.rb', line 41 def pa_req result['pareq'] end |
#required_3ds? ⇒ Boolean
29 30 31 |
# File 'lib/portmone/responses/finish_3ds.rb', line 29 def required_3ds? result['isNeed3DS'] == 'Y' end |
#success? ⇒ Boolean
17 18 19 |
# File 'lib/portmone/responses/finish_3ds.rb', line 17 def success? result['status'] == SUCCESS_STATUS && !required_3ds? end |