Class: CyberSourceMergedSpec::PaymentInformation8
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::PaymentInformation8
- Defined in:
- lib/cyber_source_merged_spec/models/payment_information8.rb
Overview
PaymentInformation8 Model.
Instance Attribute Summary collapse
-
#account_features ⇒ AccountFeatures2
TODO: Write general description for this method.
-
#bank ⇒ Bank1
TODO: Write general description for this method.
-
#customer ⇒ Customer
TODO: Write general description for this method.
-
#instrument_identifier ⇒ InstrumentIdentifier2
TODO: Write general description for this method.
-
#payment_instrument ⇒ PaymentInstrument
TODO: Write general description for this method.
-
#shipping_address ⇒ ShippingAddress
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(bank: SKIP, customer: SKIP, payment_instrument: SKIP, instrument_identifier: SKIP, shipping_address: SKIP, account_features: SKIP, additional_properties: nil) ⇒ PaymentInformation8
constructor
A new instance of PaymentInformation8.
-
#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(bank: SKIP, customer: SKIP, payment_instrument: SKIP, instrument_identifier: SKIP, shipping_address: SKIP, account_features: SKIP, additional_properties: nil) ⇒ PaymentInformation8
Returns a new instance of PaymentInformation8.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 65 def initialize(bank: SKIP, customer: SKIP, payment_instrument: SKIP, instrument_identifier: SKIP, shipping_address: SKIP, account_features: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @bank = bank unless bank == SKIP @customer = customer unless customer == SKIP @payment_instrument = payment_instrument unless payment_instrument == SKIP @instrument_identifier = instrument_identifier unless instrument_identifier == SKIP @shipping_address = shipping_address unless shipping_address == SKIP @account_features = account_features unless account_features == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_features ⇒ AccountFeatures2
TODO: Write general description for this method
34 35 36 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 34 def account_features @account_features end |
#bank ⇒ Bank1
TODO: Write general description for this method
14 15 16 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 14 def bank @bank end |
#customer ⇒ Customer
TODO: Write general description for this method
18 19 20 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 18 def customer @customer end |
#instrument_identifier ⇒ InstrumentIdentifier2
TODO: Write general description for this method
26 27 28 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.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_information8.rb', line 22 def payment_instrument @payment_instrument end |
#shipping_address ⇒ ShippingAddress
TODO: Write general description for this method
30 31 32 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 30 def shipping_address @shipping_address end |
Class Method Details
.from_element(root) ⇒ Object
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 113 def self.from_element(root) bank = XmlUtilities.from_element(root, 'Bank1', Bank1) customer = XmlUtilities.from_element(root, 'Customer', Customer) payment_instrument = XmlUtilities.from_element(root, 'PaymentInstrument', PaymentInstrument) instrument_identifier = XmlUtilities.from_element(root, 'InstrumentIdentifier2', InstrumentIdentifier2) shipping_address = XmlUtilities.from_element(root, 'ShippingAddress', ShippingAddress) account_features = XmlUtilities.from_element(root, 'AccountFeatures2', AccountFeatures2) new(bank: bank, customer: customer, payment_instrument: payment_instrument, instrument_identifier: instrument_identifier, shipping_address: shipping_address, account_features: account_features, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 81 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. bank = Bank1.from_hash(hash['bank']) if hash['bank'] customer = Customer.from_hash(hash['customer']) if hash['customer'] payment_instrument = PaymentInstrument.from_hash(hash['paymentInstrument']) if hash['paymentInstrument'] instrument_identifier = InstrumentIdentifier2.from_hash(hash['instrumentIdentifier']) if hash['instrumentIdentifier'] shipping_address = ShippingAddress.from_hash(hash['shippingAddress']) if hash['shippingAddress'] account_features = AccountFeatures2.from_hash(hash['accountFeatures']) if hash['accountFeatures'] # 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. PaymentInformation8.new(bank: bank, customer: customer, payment_instrument: payment_instrument, instrument_identifier: instrument_identifier, shipping_address: shipping_address, account_features: account_features, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 37 def self.names @_hash = {} if @_hash.nil? @_hash['bank'] = 'bank' @_hash['customer'] = 'customer' @_hash['payment_instrument'] = 'paymentInstrument' @_hash['instrument_identifier'] = 'instrumentIdentifier' @_hash['shipping_address'] = 'shippingAddress' @_hash['account_features'] = 'accountFeatures' @_hash end |
.nullables ⇒ Object
An array for nullable fields
61 62 63 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 61 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 49 def self.optionals %w[ bank customer payment_instrument instrument_identifier shipping_address account_features ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
164 165 166 167 168 169 170 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 164 def inspect class_name = self.class.name.split('::').last "<#{class_name} bank: #{@bank.inspect}, customer: #{@customer.inspect}, payment_instrument:"\ " #{@payment_instrument.inspect}, instrument_identifier: #{@instrument_identifier.inspect},"\ " shipping_address: #{@shipping_address.inspect}, account_features:"\ " #{@account_features.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
155 156 157 158 159 160 161 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 155 def to_s class_name = self.class.name.split('::').last "<#{class_name} bank: #{@bank}, customer: #{@customer}, payment_instrument:"\ " #{@payment_instrument}, instrument_identifier: #{@instrument_identifier},"\ " shipping_address: #{@shipping_address}, account_features: #{@account_features},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/cyber_source_merged_spec/models/payment_information8.rb', line 135 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'Bank1', bank) XmlUtilities.add_as_subelement(doc, root, 'Customer', customer) XmlUtilities.add_as_subelement(doc, root, 'PaymentInstrument', payment_instrument) XmlUtilities.add_as_subelement(doc, root, 'InstrumentIdentifier2', instrument_identifier) XmlUtilities.add_as_subelement(doc, root, 'ShippingAddress', shipping_address) XmlUtilities.add_as_subelement(doc, root, 'AccountFeatures2', account_features) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |