Class: VisaAcceptanceMergedSpec::PtsV2CreateBillingAgreementPost400Response1Exception
- Inherits:
-
APIException
- Object
- CoreLibrary::ApiException
- APIException
- VisaAcceptanceMergedSpec::PtsV2CreateBillingAgreementPost400Response1Exception
- Defined in:
- lib/visa_acceptance_merged_spec/exceptions/pts_v2_create_billing_agreement_post400_response1_exception.rb
Overview
ptsV2CreateBillingAgreementPost400Response1 class.
Instance Attribute Summary collapse
-
#details ⇒ Array[Detail]
The detail message related to the status and reason listed above.
-
#id ⇒ String
An unique identification number generated by Visa Acceptance to identify the submitted request.
-
#message ⇒ String
The detail message related to the status and reason listed above.
-
#reason ⇒ String
The reason of the status.
-
#status ⇒ String
The status of the submitted transaction.
-
#submit_time_utc ⇒ String
Time of request in UTC.
Instance Method Summary collapse
-
#initialize(reason, response) ⇒ PtsV2CreateBillingAgreementPost400Response1Exception
constructor
The constructor.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
-
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash.
Constructor Details
#initialize(reason, response) ⇒ PtsV2CreateBillingAgreementPost400Response1Exception
The constructor.
55 56 57 58 59 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_create_billing_agreement_post400_response1_exception.rb', line 55 def initialize(reason, response) super(reason, response) hash = APIHelper.json_deserialize(@response.raw_body) unbox(hash) end |
Instance Attribute Details
#details ⇒ Array[Detail]
The detail message related to the status and reason listed above.
50 51 52 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_create_billing_agreement_post400_response1_exception.rb', line 50 def details @details end |
#id ⇒ String
An unique identification number generated by Visa Acceptance to identify the submitted request. Returned by all services. It is also appended to the endpoint of the resource. On incremental authorizations, this value with be the same as the identification number returned in the original authorization response.
18 19 20 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_create_billing_agreement_post400_response1_exception.rb', line 18 def id @id end |
#message ⇒ String
The detail message related to the status and reason listed above.
46 47 48 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_create_billing_agreement_post400_response1_exception.rb', line 46 def @message end |
#reason ⇒ String
The reason of the status. Possible values:
- MISSING_FIELD
- INVALID_DATA
- DUPLICATE_REQUEST
- INVALID_MERCHANT_CONFIGURATION
- PROCESSOR_UNAVAILABLE
42 43 44 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_create_billing_agreement_post400_response1_exception.rb', line 42 def reason @reason end |
#status ⇒ String
The status of the submitted transaction. Possible values:
- INVALID_REQUEST
32 33 34 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_create_billing_agreement_post400_response1_exception.rb', line 32 def status @status end |
#submit_time_utc ⇒ String
Time of request in UTC. Format: YYYY-MM-DDThh:mm:ssZ
Example 2016-08-11T22:47:57Z equals August 11, 2016, at 22:47:57
(10:47:57 p.m.).
The T separates the date and the time. The Z indicates UTC.
Returned by Visa Acceptance for all services.
26 27 28 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_create_billing_agreement_post400_response1_exception.rb', line 26 def submit_time_utc @submit_time_utc end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
93 94 95 96 97 98 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_create_billing_agreement_post400_response1_exception.rb', line 93 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, submit_time_utc: #{@submit_time_utc.inspect}, status:"\ " #{@status.inspect}, reason: #{@reason.inspect}, message: #{@message.inspect}, details:"\ " #{@details.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
86 87 88 89 90 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_create_billing_agreement_post400_response1_exception.rb', line 86 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, submit_time_utc: #{@submit_time_utc}, status: #{@status},"\ " reason: #{@reason}, message: #{@message}, details: #{@details}>" end |
#unbox(hash) ⇒ Object
Populates this object by extracting properties from a hash. response body.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/visa_acceptance_merged_spec/exceptions/pts_v2_create_billing_agreement_post400_response1_exception.rb', line 64 def unbox(hash) return nil unless hash @id = hash.key?('id') ? hash['id'] : SKIP @submit_time_utc = hash.key?('submitTimeUtc') ? hash['submitTimeUtc'] : SKIP @status = hash.key?('status') ? hash['status'] : SKIP @reason = hash.key?('reason') ? hash['reason'] : SKIP @message = hash.key?('message') ? hash['message'] : SKIP # Parameter is an array, so we need to iterate through it @details = nil unless hash['details'].nil? @details = [] hash['details'].each do |structure| @details << (Detail.from_hash(structure) if structure) end end @details = SKIP unless hash.key?('details') end |