Class: UspsApi::PaymentResponse1
- Defined in:
- lib/usps_api/models/payment_response1.rb
Overview
Payment validation response details, if available.
Instance Attribute Summary collapse
-
#crid ⇒ String
Customer Registration ID (CRID) of the mail owner.
-
#detail ⇒ Detail1
Details about the payment transaction.
-
#eps_transaction_id ⇒ String
EPS Transaction ID for the payment transaction.
-
#impb ⇒ String
IMpb barcode for the package.
-
#transaction_valid ⇒ Business
Indicates if the dispute has a valid transaction.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(crid: SKIP, impb: SKIP, eps_transaction_id: SKIP, transaction_valid: SKIP, detail: SKIP, additional_properties: nil) ⇒ PaymentResponse1
constructor
A new instance of PaymentResponse1.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(crid: SKIP, impb: SKIP, eps_transaction_id: SKIP, transaction_valid: SKIP, detail: SKIP, additional_properties: nil) ⇒ PaymentResponse1
Returns a new instance of PaymentResponse1.
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/usps_api/models/payment_response1.rb', line 59 def initialize(crid: SKIP, impb: SKIP, eps_transaction_id: SKIP, transaction_valid: SKIP, detail: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @crid = crid unless crid == SKIP @impb = impb unless impb == SKIP @eps_transaction_id = eps_transaction_id unless eps_transaction_id == SKIP @transaction_valid = transaction_valid unless transaction_valid == SKIP @detail = detail unless detail == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#crid ⇒ String
Customer Registration ID (CRID) of the mail owner.
14 15 16 |
# File 'lib/usps_api/models/payment_response1.rb', line 14 def crid @crid end |
#detail ⇒ Detail1
Details about the payment transaction.
30 31 32 |
# File 'lib/usps_api/models/payment_response1.rb', line 30 def detail @detail end |
#eps_transaction_id ⇒ String
EPS Transaction ID for the payment transaction.
22 23 24 |
# File 'lib/usps_api/models/payment_response1.rb', line 22 def eps_transaction_id @eps_transaction_id end |
#impb ⇒ String
IMpb barcode for the package.
18 19 20 |
# File 'lib/usps_api/models/payment_response1.rb', line 18 def impb @impb end |
#transaction_valid ⇒ Business
Indicates if the dispute has a valid transaction. āYā for yes, āNā for no.
26 27 28 |
# File 'lib/usps_api/models/payment_response1.rb', line 26 def transaction_valid @transaction_valid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/usps_api/models/payment_response1.rb', line 74 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. crid = hash.key?('CRID') ? hash['CRID'] : SKIP impb = hash.key?('IMPB') ? hash['IMPB'] : SKIP eps_transaction_id = hash.key?('EPSTransactionID') ? hash['EPSTransactionID'] : SKIP transaction_valid = hash.key?('transactionValid') ? hash['transactionValid'] : SKIP detail = Detail1.from_hash(hash['detail']) if hash['detail'] # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. PaymentResponse1.new(crid: crid, impb: impb, eps_transaction_id: eps_transaction_id, transaction_valid: transaction_valid, detail: detail, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/usps_api/models/payment_response1.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['crid'] = 'CRID' @_hash['impb'] = 'IMPB' @_hash['eps_transaction_id'] = 'EPSTransactionID' @_hash['transaction_valid'] = 'transactionValid' @_hash['detail'] = 'detail' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 |
# File 'lib/usps_api/models/payment_response1.rb', line 55 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 52 |
# File 'lib/usps_api/models/payment_response1.rb', line 44 def self.optionals %w[ crid impb eps_transaction_id transaction_valid detail ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
111 112 113 114 115 116 |
# File 'lib/usps_api/models/payment_response1.rb', line 111 def inspect class_name = self.class.name.split('::').last "<#{class_name} crid: #{@crid.inspect}, impb: #{@impb.inspect}, eps_transaction_id:"\ " #{@eps_transaction_id.inspect}, transaction_valid: #{@transaction_valid.inspect}, detail:"\ " #{@detail.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
103 104 105 106 107 108 |
# File 'lib/usps_api/models/payment_response1.rb', line 103 def to_s class_name = self.class.name.split('::').last "<#{class_name} crid: #{@crid}, impb: #{@impb}, eps_transaction_id: #{@eps_transaction_id},"\ " transaction_valid: #{@transaction_valid}, detail: #{@detail}, additional_properties:"\ " #{@additional_properties}>" end |