Class: CyberSourceMergedSpec::PatchPaymentInstrumentRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::PatchPaymentInstrumentRequest
- Defined in:
- lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb
Overview
PatchPaymentInstrumentRequest Model.
Instance Attribute Summary collapse
-
#bank_account ⇒ BankAccount
The type of Payment Instrument.
-
#bill_to ⇒ BillTo15
The type of Payment Instrument.
-
#buyer_information ⇒ BuyerInformation13
The type of Payment Instrument.
-
#card ⇒ Card13
The type of Payment Instrument.
-
#default ⇒ TrueClass | FalseClass
Flag that indicates whether customer payment instrument is the dafault.
-
#embedded ⇒ Embedded1
Additional resources for the Payment Instrument.
-
#id ⇒ String
The Id of the Payment Instrument Token.
-
#instrument_identifier ⇒ InstrumentIdentifier10
The type of Payment Instrument.
-
#links ⇒ Links20
TODO: Write general description for this method.
-
#merchant_information ⇒ TmsMerchantInformation
The type of Payment Instrument.
-
#metadata ⇒ Metadata1
The type of Payment Instrument.
-
#object ⇒ String
The type.
-
#processing_information ⇒ TmsPaymentInstrumentProcessingInfo
The type of Payment Instrument.
-
#state ⇒ String
Issuers state for the card number.
-
#type ⇒ String
The type of Payment Instrument.
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(links: SKIP, id: SKIP, object: SKIP, default: SKIP, state: SKIP, type: SKIP, bank_account: SKIP, card: SKIP, buyer_information: SKIP, bill_to: SKIP, processing_information: SKIP, merchant_information: SKIP, instrument_identifier: SKIP, metadata: SKIP, embedded: SKIP, additional_properties: nil) ⇒ PatchPaymentInstrumentRequest
constructor
A new instance of PatchPaymentInstrumentRequest.
-
#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(links: SKIP, id: SKIP, object: SKIP, default: SKIP, state: SKIP, type: SKIP, bank_account: SKIP, card: SKIP, buyer_information: SKIP, bill_to: SKIP, processing_information: SKIP, merchant_information: SKIP, instrument_identifier: SKIP, metadata: SKIP, embedded: SKIP, additional_properties: nil) ⇒ PatchPaymentInstrumentRequest
Returns a new instance of PatchPaymentInstrumentRequest.
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 145 def initialize(links: SKIP, id: SKIP, object: SKIP, default: SKIP, state: SKIP, type: SKIP, bank_account: SKIP, card: SKIP, buyer_information: SKIP, bill_to: SKIP, processing_information: SKIP, merchant_information: SKIP, instrument_identifier: SKIP, metadata: SKIP, embedded: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @links = links unless links == SKIP @id = id unless id == SKIP @object = object unless object == SKIP @default = default unless default == SKIP @state = state unless state == SKIP @type = type unless type == SKIP @bank_account = bank_account unless bank_account == SKIP @card = card unless card == SKIP @buyer_information = buyer_information unless buyer_information == SKIP @bill_to = bill_to unless bill_to == SKIP @processing_information = processing_information unless processing_information == SKIP @merchant_information = merchant_information unless merchant_information == SKIP @instrument_identifier = instrument_identifier unless instrument_identifier == SKIP @metadata = unless == SKIP @embedded = unless == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#bank_account ⇒ BankAccount
The type of Payment Instrument. Possible Values:
- cardHash
50 51 52 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 50 def bank_account @bank_account end |
#bill_to ⇒ BillTo15
The type of Payment Instrument. Possible Values:
- cardHash
68 69 70 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 68 def bill_to @bill_to end |
#buyer_information ⇒ BuyerInformation13
The type of Payment Instrument. Possible Values:
- cardHash
62 63 64 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 62 def buyer_information @buyer_information end |
#card ⇒ Card13
The type of Payment Instrument. Possible Values:
- cardHash
56 57 58 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 56 def card @card end |
#default ⇒ TrueClass | FalseClass
Flag that indicates whether customer payment instrument is the dafault. Possible Values:
true: Payment instrument is customer's default.false: Payment instrument is not customer's default.
31 32 33 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 31 def default @default end |
#embedded ⇒ Embedded1
Additional resources for the Payment Instrument.
96 97 98 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 96 def @embedded end |
#id ⇒ String
The Id of the Payment Instrument Token.
18 19 20 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 18 def id @id end |
#instrument_identifier ⇒ InstrumentIdentifier10
The type of Payment Instrument. Possible Values:
- cardHash
86 87 88 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 86 def instrument_identifier @instrument_identifier end |
#links ⇒ Links20
TODO: Write general description for this method
14 15 16 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 14 def links @links end |
#merchant_information ⇒ TmsMerchantInformation
The type of Payment Instrument. Possible Values:
- cardHash
80 81 82 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 80 def merchant_information @merchant_information end |
#metadata ⇒ Metadata1
The type of Payment Instrument. Possible Values:
- cardHash
92 93 94 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 92 def @metadata end |
#object ⇒ String
The type. Possible Values:
- paymentInstrument
24 25 26 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 24 def object @object end |
#processing_information ⇒ TmsPaymentInstrumentProcessingInfo
The type of Payment Instrument. Possible Values:
- cardHash
74 75 76 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 74 def processing_information @processing_information end |
#state ⇒ String
Issuers state for the card number. Possible Values:
- ACTIVE
- CLOSED : The account has been closed.
38 39 40 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 38 def state @state end |
#type ⇒ String
The type of Payment Instrument. Possible Values:
- cardHash
44 45 46 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 44 def type @type end |
Class Method Details
.from_element(root) ⇒ Object
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 224 def self.from_element(root) links = XmlUtilities.from_element(root, 'Links20', Links20) id = XmlUtilities.from_element(root, 'id', String) object = XmlUtilities.from_element(root, 'object', String) default = XmlUtilities.from_element(root, 'default', TrueClass) state = XmlUtilities.from_element(root, 'state', String) type = XmlUtilities.from_element(root, 'type', String) bank_account = XmlUtilities.from_element(root, 'BankAccount', BankAccount) card = XmlUtilities.from_element(root, 'Card13', Card13) buyer_information = XmlUtilities.from_element(root, 'BuyerInformation13', BuyerInformation13) bill_to = XmlUtilities.from_element(root, 'BillTo15', BillTo15) processing_information = XmlUtilities.from_element( root, 'tmsPaymentInstrumentProcessingInfo', TmsPaymentInstrumentProcessingInfo ) merchant_information = XmlUtilities.from_element(root, 'TmsMerchantInformation', TmsMerchantInformation) instrument_identifier = XmlUtilities.from_element( root, 'InstrumentIdentifier10', InstrumentIdentifier10 ) = XmlUtilities.from_element(root, 'Metadata1', Metadata1) = XmlUtilities.from_element(root, 'Embedded1', Embedded1) new(links: links, id: id, object: object, default: default, state: state, type: type, bank_account: bank_account, card: card, buyer_information: buyer_information, bill_to: bill_to, processing_information: processing_information, merchant_information: merchant_information, instrument_identifier: instrument_identifier, metadata: , embedded: , additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 173 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. links = Links20.from_hash(hash['_links']) if hash['_links'] id = hash.key?('id') ? hash['id'] : SKIP object = hash.key?('object') ? hash['object'] : SKIP default = hash.key?('default') ? hash['default'] : SKIP state = hash.key?('state') ? hash['state'] : SKIP type = hash.key?('type') ? hash['type'] : SKIP bank_account = BankAccount.from_hash(hash['bankAccount']) if hash['bankAccount'] card = Card13.from_hash(hash['card']) if hash['card'] buyer_information = BuyerInformation13.from_hash(hash['buyerInformation']) if hash['buyerInformation'] bill_to = BillTo15.from_hash(hash['billTo']) if hash['billTo'] if hash['processingInformation'] processing_information = TmsPaymentInstrumentProcessingInfo.from_hash(hash['processingInformation']) end merchant_information = TmsMerchantInformation.from_hash(hash['merchantInformation']) if hash['merchantInformation'] instrument_identifier = InstrumentIdentifier10.from_hash(hash['instrumentIdentifier']) if hash['instrumentIdentifier'] = Metadata1.from_hash(hash['metadata']) if hash['metadata'] = Embedded1.from_hash(hash['_embedded']) if hash['_embedded'] # 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. PatchPaymentInstrumentRequest.new(links: links, id: id, object: object, default: default, state: state, type: type, bank_account: bank_account, card: card, buyer_information: buyer_information, bill_to: bill_to, processing_information: processing_information, merchant_information: merchant_information, instrument_identifier: instrument_identifier, metadata: , embedded: , additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 99 def self.names @_hash = {} if @_hash.nil? @_hash['links'] = '_links' @_hash['id'] = 'id' @_hash['object'] = 'object' @_hash['default'] = 'default' @_hash['state'] = 'state' @_hash['type'] = 'type' @_hash['bank_account'] = 'bankAccount' @_hash['card'] = 'card' @_hash['buyer_information'] = 'buyerInformation' @_hash['bill_to'] = 'billTo' @_hash['processing_information'] = 'processingInformation' @_hash['merchant_information'] = 'merchantInformation' @_hash['instrument_identifier'] = 'instrumentIdentifier' @_hash['metadata'] = 'metadata' @_hash['embedded'] = '_embedded' @_hash end |
.nullables ⇒ Object
An array for nullable fields
141 142 143 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 141 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 120 def self.optionals %w[ links id object default state type bank_account card buyer_information bill_to processing_information merchant_information instrument_identifier metadata embedded ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
308 309 310 311 312 313 314 315 316 317 318 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 308 def inspect class_name = self.class.name.split('::').last "<#{class_name} links: #{@links.inspect}, id: #{@id.inspect}, object: #{@object.inspect},"\ " default: #{@default.inspect}, state: #{@state.inspect}, type: #{@type.inspect},"\ " bank_account: #{@bank_account.inspect}, card: #{@card.inspect}, buyer_information:"\ " #{@buyer_information.inspect}, bill_to: #{@bill_to.inspect}, processing_information:"\ " #{@processing_information.inspect}, merchant_information:"\ " #{@merchant_information.inspect}, instrument_identifier:"\ " #{@instrument_identifier.inspect}, metadata: #{@metadata.inspect}, embedded:"\ " #{@embedded.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
297 298 299 300 301 302 303 304 305 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 297 def to_s class_name = self.class.name.split('::').last "<#{class_name} links: #{@links}, id: #{@id}, object: #{@object}, default: #{@default},"\ " state: #{@state}, type: #{@type}, bank_account: #{@bank_account}, card: #{@card},"\ " buyer_information: #{@buyer_information}, bill_to: #{@bill_to}, processing_information:"\ " #{@processing_information}, merchant_information: #{@merchant_information},"\ " instrument_identifier: #{@instrument_identifier}, metadata: #{@metadata}, embedded:"\ " #{@embedded}, additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/cyber_source_merged_spec/models/patch_payment_instrument_request.rb', line 267 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'Links20', links) XmlUtilities.add_as_subelement(doc, root, 'id', id) XmlUtilities.add_as_subelement(doc, root, 'object', object) XmlUtilities.add_as_subelement(doc, root, 'default', default) XmlUtilities.add_as_subelement(doc, root, 'state', state) XmlUtilities.add_as_subelement(doc, root, 'type', type) XmlUtilities.add_as_subelement(doc, root, 'BankAccount', bank_account) XmlUtilities.add_as_subelement(doc, root, 'Card13', card) XmlUtilities.add_as_subelement(doc, root, 'BuyerInformation13', buyer_information) XmlUtilities.add_as_subelement(doc, root, 'BillTo15', bill_to) XmlUtilities.add_as_subelement(doc, root, 'tmsPaymentInstrumentProcessingInfo', processing_information) XmlUtilities.add_as_subelement(doc, root, 'TmsMerchantInformation', merchant_information) XmlUtilities.add_as_subelement(doc, root, 'InstrumentIdentifier10', instrument_identifier) XmlUtilities.add_as_subelement(doc, root, 'Metadata1', ) XmlUtilities.add_as_subelement(doc, root, 'Embedded1', ) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |