Class: CyberSourceMergedSpec::SettlementStatus
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::SettlementStatus
- Defined in:
- lib/cyber_source_merged_spec/models/settlement_status.rb
Overview
Settlement Status Section Values.
Instance Attribute Summary collapse
-
#error_text ⇒ String
errorText.
-
#reason_code ⇒ String
ReasonCode.
-
#request_id ⇒ String
An unique identification number assigned by CyberSource to identify the submitted request.
-
#settlement_time ⇒ DateTime
Settlement Date.
-
#status ⇒ String
Settlement Status.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.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(request_id: SKIP, status: SKIP, settlement_time: SKIP, reason_code: SKIP, error_text: SKIP, additional_properties: nil) ⇒ SettlementStatus
constructor
A new instance of SettlementStatus.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_settlement_time ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ 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(request_id: SKIP, status: SKIP, settlement_time: SKIP, reason_code: SKIP, error_text: SKIP, additional_properties: nil) ⇒ SettlementStatus
Returns a new instance of SettlementStatus.
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 61 def initialize(request_id: SKIP, status: SKIP, settlement_time: SKIP, reason_code: SKIP, error_text: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @request_id = request_id unless request_id == SKIP @status = status unless status == SKIP @settlement_time = settlement_time unless settlement_time == SKIP @reason_code = reason_code unless reason_code == SKIP @error_text = error_text unless error_text == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#error_text ⇒ String
errorText
32 33 34 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 32 def error_text @error_text end |
#reason_code ⇒ String
ReasonCode
28 29 30 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 28 def reason_code @reason_code end |
#request_id ⇒ String
An unique identification number assigned by CyberSource to identify the submitted request.
16 17 18 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 16 def request_id @request_id end |
#settlement_time ⇒ DateTime
Settlement Date
24 25 26 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 24 def settlement_time @settlement_time end |
#status ⇒ String
Settlement Status
20 21 22 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 20 def status @status end |
Class Method Details
.from_element(root) ⇒ Object
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 110 def self.from_element(root) request_id = XmlUtilities.from_element(root, 'requestId', String) status = XmlUtilities.from_element(root, 'status', String) settlement_time = XmlUtilities.from_element(root, 'settlementTime', String, datetime_format: 'rfc3339') reason_code = XmlUtilities.from_element(root, 'reasonCode', String) error_text = XmlUtilities.from_element(root, 'errorText', String) new(request_id: request_id, status: status, settlement_time: settlement_time, reason_code: reason_code, error_text: error_text, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 101 102 103 104 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 76 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. request_id = hash.key?('requestId') ? hash['requestId'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP settlement_time = if hash.key?('settlementTime') (DateTimeHelper.from_rfc3339(hash['settlementTime']) if hash['settlementTime']) else SKIP end reason_code = hash.key?('reasonCode') ? hash['reasonCode'] : SKIP error_text = hash.key?('errorText') ? hash['errorText'] : SKIP # 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. SettlementStatus.new(request_id: request_id, status: status, settlement_time: settlement_time, reason_code: reason_code, error_text: error_text, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
35 36 37 38 39 40 41 42 43 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 35 def self.names @_hash = {} if @_hash.nil? @_hash['request_id'] = 'requestId' @_hash['status'] = 'status' @_hash['settlement_time'] = 'settlementTime' @_hash['reason_code'] = 'reasonCode' @_hash['error_text'] = 'errorText' @_hash end |
.nullables ⇒ Object
An array for nullable fields
57 58 59 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 57 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
46 47 48 49 50 51 52 53 54 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 46 def self.optionals %w[ request_id status settlement_time reason_code error_text ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
152 153 154 155 156 157 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 152 def inspect class_name = self.class.name.split('::').last "<#{class_name} request_id: #{@request_id.inspect}, status: #{@status.inspect},"\ " settlement_time: #{@settlement_time.inspect}, reason_code: #{@reason_code.inspect},"\ " error_text: #{@error_text.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_settlement_time ⇒ Object
106 107 108 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 106 def to_custom_settlement_time DateTimeHelper.to_rfc3339(settlement_time) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
144 145 146 147 148 149 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 144 def to_s class_name = self.class.name.split('::').last "<#{class_name} request_id: #{@request_id}, status: #{@status}, settlement_time:"\ " #{@settlement_time}, reason_code: #{@reason_code}, error_text: #{@error_text},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/cyber_source_merged_spec/models/settlement_status.rb', line 127 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'requestId', request_id) XmlUtilities.add_as_subelement(doc, root, 'status', status) XmlUtilities.add_as_subelement(doc, root, 'settlementTime', settlement_time, datetime_format: 'rfc3339') XmlUtilities.add_as_subelement(doc, root, 'reasonCode', reason_code) XmlUtilities.add_as_subelement(doc, root, 'errorText', error_text) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |