Class: CyberSourceMergedSpec::MerchantInitiatedTransaction1
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::MerchantInitiatedTransaction1
- Defined in:
- lib/cyber_source_merged_spec/models/merchant_initiated_transaction1.rb
Overview
MerchantInitiatedTransaction1 Model.
Instance Attribute Summary collapse
-
#original_authorized_amount ⇒ String
Amount of the original authorization.
-
#previous_transaction_id ⇒ String
Network transaction identifier that was returned in the payment response field processorInformation.transactionID in the reply message for either the original merchant-initiated payment in the series or the previous merchant-initiated payment in the series.
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(previous_transaction_id: SKIP, original_authorized_amount: SKIP, additional_properties: nil) ⇒ MerchantInitiatedTransaction1
constructor
A new instance of MerchantInitiatedTransaction1.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#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(previous_transaction_id: SKIP, original_authorized_amount: SKIP, additional_properties: nil) ⇒ MerchantInitiatedTransaction1
Returns a new instance of MerchantInitiatedTransaction1.
45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/cyber_source_merged_spec/models/merchant_initiated_transaction1.rb', line 45 def initialize(previous_transaction_id: SKIP, original_authorized_amount: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @previous_transaction_id = previous_transaction_id unless previous_transaction_id == SKIP unless == SKIP @original_authorized_amount = end @additional_properties = additional_properties end |
Instance Attribute Details
#original_authorized_amount ⇒ String
Amount of the original authorization.
22 23 24 |
# File 'lib/cyber_source_merged_spec/models/merchant_initiated_transaction1.rb', line 22 def @original_authorized_amount end |
#previous_transaction_id ⇒ String
Network transaction identifier that was returned in the payment response field processorInformation.transactionID in the reply message for either the original merchant-initiated payment in the series or the previous merchant-initiated payment in the series.
18 19 20 |
# File 'lib/cyber_source_merged_spec/models/merchant_initiated_transaction1.rb', line 18 def previous_transaction_id @previous_transaction_id end |
Class Method Details
.from_element(root) ⇒ Object
81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/cyber_source_merged_spec/models/merchant_initiated_transaction1.rb', line 81 def self.from_element(root) previous_transaction_id = XmlUtilities.from_element( root, 'previousTransactionId', String ) = XmlUtilities.from_element( root, 'originalAuthorizedAmount', String ) new(previous_transaction_id: previous_transaction_id, original_authorized_amount: , additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/cyber_source_merged_spec/models/merchant_initiated_transaction1.rb', line 59 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. previous_transaction_id = hash.key?('previousTransactionId') ? hash['previousTransactionId'] : SKIP = hash.key?('originalAuthorizedAmount') ? hash['originalAuthorizedAmount'] : 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. MerchantInitiatedTransaction1.new(previous_transaction_id: previous_transaction_id, original_authorized_amount: , additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 |
# File 'lib/cyber_source_merged_spec/models/merchant_initiated_transaction1.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['previous_transaction_id'] = 'previousTransactionId' @_hash['original_authorized_amount'] = 'originalAuthorizedAmount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/cyber_source_merged_spec/models/merchant_initiated_transaction1.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
33 34 35 36 37 38 |
# File 'lib/cyber_source_merged_spec/models/merchant_initiated_transaction1.rb', line 33 def self.optionals %w[ previous_transaction_id original_authorized_amount ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
116 117 118 119 120 121 |
# File 'lib/cyber_source_merged_spec/models/merchant_initiated_transaction1.rb', line 116 def inspect class_name = self.class.name.split('::').last "<#{class_name} previous_transaction_id: #{@previous_transaction_id.inspect},"\ " original_authorized_amount: #{@original_authorized_amount.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
108 109 110 111 112 113 |
# File 'lib/cyber_source_merged_spec/models/merchant_initiated_transaction1.rb', line 108 def to_s class_name = self.class.name.split('::').last "<#{class_name} previous_transaction_id: #{@previous_transaction_id},"\ " original_authorized_amount: #{@original_authorized_amount}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/cyber_source_merged_spec/models/merchant_initiated_transaction1.rb', line 94 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'previousTransactionId', previous_transaction_id) XmlUtilities.add_as_subelement(doc, root, 'originalAuthorizedAmount', ) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |