Skip to content

Latest commit

 

History

History
82 lines (55 loc) · 1.45 KB

ChargeResponsePaymentMethod.md

File metadata and controls

82 lines (55 loc) · 1.45 KB

Conekta::ChargeResponsePaymentMethod

Class instance methods

openapi_one_of

Returns the list of classes defined in oneOf.

Example

require 'conekta'

Conekta::ChargeResponsePaymentMethod.openapi_one_of
# =>
# [
#   :'PaymentMethodBankTransfer',
#   :'PaymentMethodCard',
#   :'PaymentMethodCash'
# ]

openapi_discriminator_name

Returns the discriminator's property name.

Example

require 'conekta'

Conekta::ChargeResponsePaymentMethod.openapi_discriminator_name
# => :'object'

openapi_discriminator_name

Returns the discriminator's mapping.

Example

require 'conekta'

Conekta::ChargeResponsePaymentMethod.openapi_discriminator_mapping
# =>
# {
#   :'bank_transfer_payment' => :'PaymentMethodBankTransfer',
#   :'card_payment' => :'PaymentMethodCard',
#   :'cash_payment' => :'PaymentMethodCash'
# }

build

Find the appropriate object from the openapi_one_of list and casts the data into it.

Example

require 'conekta'

Conekta::ChargeResponsePaymentMethod.build(data)
# => #<PaymentMethodBankTransfer:0x00007fdd4aab02a0>

Conekta::ChargeResponsePaymentMethod.build(data_that_doesnt_match)
# => nil

Parameters

Name Type Description
data Mixed data to be matched against the list of oneOf items

Return type

  • PaymentMethodBankTransfer
  • PaymentMethodCard
  • PaymentMethodCash
  • nil (if no type matches)