Class: VSafe::ResponseError
- Inherits:
-
Object
- Object
- VSafe::ResponseError
- Defined in:
- lib/vsafe/response_error.rb
Constant Summary collapse
- GENERAL_SYSTEM_FAILURE =
1
- PARAMETER_REQUIRED =
510
- PARAMETER_EXCEEDS_MAX_LENGTH =
511
- PARAMETER_IS_NOT_VALID =
512
- PARAMETER_IS_INVALID =
514
- LOGIN_FAILED =
1001
- PAYMENT_NOT_FOUND =
1002
- PAYMENT_IS_ALREADY_CONFIRMED =
1003
- PAYMENT_NOT_AUTHORIZED =
1004
- PARTNER_NOT_ACTIVE =
1005
- AMOUNT_LARGER_THAN_ORIGINAL_AUTHORIZATION =
1006
- AUTHORIZATION_IS_ALREADY_EXPIRED =
1007
- ORIGINAL_TRANSACTION_WAS_FROM_A_DIFFERENT_INTERFACE =
1008
- SUGGESTED_MESSAGES =
{ GENERAL_SYSTEM_FAILURE => "System not available. Please try again later.".freeze, PARAMETER_IS_INVALID => "Please select a correct value.".freeze, LOGIN_FAILED => "System not available. Please try again later.".freeze, PARTNER_NOT_ACTIVE => "System not available. Please try again later.".freeze, AUTHORIZATION_IS_ALREADY_EXPIRED => "Please provide your payment information again.".freeze, ORIGINAL_TRANSACTION_WAS_FROM_A_DIFFERENT_INTERFACE => "Please try again later.".freeze }.freeze
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#suggested_message ⇒ Object
readonly
Returns the value of attribute suggested_message.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(response_body) ⇒ ResponseError
constructor
A new instance of ResponseError.
Constructor Details
#initialize(response_body) ⇒ ResponseError
Returns a new instance of ResponseError.
30 31 32 33 34 |
# File 'lib/vsafe/response_error.rb', line 30 def initialize(response_body) @code = response_body["ResponseCode"].to_i @text = response_body["ResponseText"] @suggested_message = SUGGESTED_MESSAGES[code] end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
26 27 28 |
# File 'lib/vsafe/response_error.rb', line 26 def code @code end |
#suggested_message ⇒ Object (readonly)
Returns the value of attribute suggested_message.
26 27 28 |
# File 'lib/vsafe/response_error.rb', line 26 def @suggested_message end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
26 27 28 |
# File 'lib/vsafe/response_error.rb', line 26 def text @text end |