Class: GpWebpay::Response
- Inherits:
-
Object
- Object
- GpWebpay::Response
- Defined in:
- lib/gp_webpay/response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#original_response ⇒ Object
Returns the value of attribute original_response.
-
#params ⇒ Object
Returns the value of attribute params.
-
#pr_code ⇒ Object
Returns the value of attribute pr_code.
-
#result_text ⇒ Object
Returns the value of attribute result_text.
-
#sr_code ⇒ Object
Returns the value of attribute sr_code.
-
#status ⇒ Object
Returns the value of attribute status.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(original_response:, result_text:, status:, pr_code:, sr_code:, params:, token: nil, merchant_number: nil) ⇒ Response
constructor
rubocop:disable Metrics/ParameterLists.
- #success? ⇒ Boolean
-
#valid? ⇒ Boolean
rubocop:enable Metrics/ParameterLists.
Constructor Details
#initialize(original_response:, result_text:, status:, pr_code:, sr_code:, params:, token: nil, merchant_number: nil) ⇒ Response
rubocop:disable Metrics/ParameterLists
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gp_webpay/response.rb', line 13 def initialize(original_response:, result_text:, status:, pr_code:, sr_code:, params:, token: nil, merchant_number: nil) @original_response = original_response @result_text = result_text @token = token @status = status @pr_code = pr_code @sr_code = sr_code @params = params @merchant_number = merchant_number @config = GpWebpay.config[merchant_number] || GpWebpay.config.default end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
3 4 5 |
# File 'lib/gp_webpay/response.rb', line 3 def config @config end |
#original_response ⇒ Object
Returns the value of attribute original_response.
3 4 5 |
# File 'lib/gp_webpay/response.rb', line 3 def original_response @original_response end |
#params ⇒ Object
Returns the value of attribute params.
3 4 5 |
# File 'lib/gp_webpay/response.rb', line 3 def params @params end |
#pr_code ⇒ Object
Returns the value of attribute pr_code.
3 4 5 |
# File 'lib/gp_webpay/response.rb', line 3 def pr_code @pr_code end |
#result_text ⇒ Object
Returns the value of attribute result_text.
3 4 5 |
# File 'lib/gp_webpay/response.rb', line 3 def result_text @result_text end |
#sr_code ⇒ Object
Returns the value of attribute sr_code.
3 4 5 |
# File 'lib/gp_webpay/response.rb', line 3 def sr_code @sr_code end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/gp_webpay/response.rb', line 3 def status @status end |
#token ⇒ Object
Returns the value of attribute token.
3 4 5 |
# File 'lib/gp_webpay/response.rb', line 3 def token @token end |
Instance Method Details
#success? ⇒ Boolean
30 31 32 |
# File 'lib/gp_webpay/response.rb', line 30 def success? pr_code == '0' && sr_code == '0' end |
#valid? ⇒ Boolean
rubocop:enable Metrics/ParameterLists
27 28 |
# File 'lib/gp_webpay/response.rb', line 27 def valid? end |