Class: CyberSourceMergedSpec::PaymentInformation42
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::PaymentInformation42
- Defined in:
- lib/cyber_source_merged_spec/models/payment_information42.rb
Overview
PaymentInformation42 Model.
Instance Attribute Summary collapse
-
#card ⇒ Card129
TODO: Write general description for this method.
-
#customer ⇒ Customer60
TODO: Write general description for this method.
-
#instrument_identifier ⇒ InstrumentIdentifier
TODO: Write general description for this method.
-
#payment_instrument ⇒ PaymentInstrument
TODO: Write general description for this method.
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(card: SKIP, customer: SKIP, payment_instrument: SKIP, instrument_identifier: SKIP, additional_properties: nil) ⇒ PaymentInformation42
constructor
A new instance of PaymentInformation42.
-
#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(card: SKIP, customer: SKIP, payment_instrument: SKIP, instrument_identifier: SKIP, additional_properties: nil) ⇒ PaymentInformation42
Returns a new instance of PaymentInformation42.
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 53 def initialize(card: SKIP, customer: SKIP, payment_instrument: SKIP, instrument_identifier: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @card = card unless card == SKIP @customer = customer unless customer == SKIP @payment_instrument = payment_instrument unless payment_instrument == SKIP @instrument_identifier = instrument_identifier unless instrument_identifier == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#card ⇒ Card129
TODO: Write general description for this method
14 15 16 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 14 def card @card end |
#customer ⇒ Customer60
TODO: Write general description for this method
18 19 20 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 18 def customer @customer end |
#instrument_identifier ⇒ InstrumentIdentifier
TODO: Write general description for this method
26 27 28 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 26 def instrument_identifier @instrument_identifier end |
#payment_instrument ⇒ PaymentInstrument
TODO: Write general description for this method
22 23 24 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 22 def payment_instrument @payment_instrument end |
Class Method Details
.from_element(root) ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 92 def self.from_element(root) card = XmlUtilities.from_element(root, 'Card129', Card129) customer = XmlUtilities.from_element(root, 'Customer60', Customer60) payment_instrument = XmlUtilities.from_element(root, 'PaymentInstrument', PaymentInstrument) instrument_identifier = XmlUtilities.from_element(root, 'InstrumentIdentifier', InstrumentIdentifier) new(card: card, customer: customer, payment_instrument: payment_instrument, instrument_identifier: instrument_identifier, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 66 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. card = Card129.from_hash(hash['card']) if hash['card'] customer = Customer60.from_hash(hash['customer']) if hash['customer'] payment_instrument = PaymentInstrument.from_hash(hash['paymentInstrument']) if hash['paymentInstrument'] instrument_identifier = InstrumentIdentifier.from_hash(hash['instrumentIdentifier']) if hash['instrumentIdentifier'] # 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. PaymentInformation42.new(card: card, customer: customer, payment_instrument: payment_instrument, instrument_identifier: instrument_identifier, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['card'] = 'card' @_hash['customer'] = 'customer' @_hash['payment_instrument'] = 'paymentInstrument' @_hash['instrument_identifier'] = 'instrumentIdentifier' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 39 def self.optionals %w[ card customer payment_instrument instrument_identifier ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
132 133 134 135 136 137 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 132 def inspect class_name = self.class.name.split('::').last "<#{class_name} card: #{@card.inspect}, customer: #{@customer.inspect}, payment_instrument:"\ " #{@payment_instrument.inspect}, instrument_identifier: #{@instrument_identifier.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
124 125 126 127 128 129 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 124 def to_s class_name = self.class.name.split('::').last "<#{class_name} card: #{@card}, customer: #{@customer}, payment_instrument:"\ " #{@payment_instrument}, instrument_identifier: #{@instrument_identifier},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/cyber_source_merged_spec/models/payment_information42.rb', line 108 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'Card129', card) XmlUtilities.add_as_subelement(doc, root, 'Customer60', customer) XmlUtilities.add_as_subelement(doc, root, 'PaymentInstrument', payment_instrument) XmlUtilities.add_as_subelement(doc, root, 'InstrumentIdentifier', instrument_identifier) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |