Class: Io::Flow::V0::Models::PaymentMethodData
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::PaymentMethodData
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Direct Known Subclasses
PaymentMethodDataAuthorizeApplepay, PaymentMethodDataAuthorizeCard, PaymentMethodDataAuthorizeGooglepay, PaymentMethodDataAuthorizeKlarna, PaymentMethodDataAuthorizePaypal, PaymentMethodDataCompleteAuthorizationCard, PaymentMethodDataInitAfterpay, PaymentMethodDataInitApplepay, PaymentMethodDataInitBancontact, PaymentMethodDataInitGooglepay, PaymentMethodDataInitIdeal, PaymentMethodDataInitKlarna, PaymentMethodDataInitPaypal, PaymentMethodDataInitSofort, PaymentMethodDataSelectedPaymentOption, PaymentMethodDataUndefinedType, PaymentMethodDataValidateApplepay
Defined Under Namespace
Modules: Types
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(incoming = {}) ⇒ PaymentMethodData
constructor
A new instance of PaymentMethodData.
- #subtype_to_hash ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ PaymentMethodData
Returns a new instance of PaymentMethodData.
13762 13763 13764 13765 13766 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13762 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:type], 'PaymentMethodData') @type = HttpClient::Preconditions.assert_class('type', opts.delete(:type), String) end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
13760 13761 13762 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13760 def type @type end |
Class Method Details
.from_json(hash) ⇒ Object
Instance Method Details
#subtype_to_hash ⇒ Object
13768 13769 13770 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13768 def subtype_to_hash raise 'Cannot serialize an instance of payment_method_data directly - must use one of the specific types: payment_method_data_init_klarna, payment_method_data_init_afterpay, payment_method_data_init_applepay, payment_method_data_init_googlepay, payment_method_data_init_paypal, payment_method_data_init_ideal, payment_method_data_init_sofort, payment_method_data_init_bancontact, payment_method_data_validate_applepay, payment_method_data_authorize_card, payment_method_data_authorize_googlepay, payment_method_data_authorize_applepay, payment_method_data_authorize_paypal, payment_method_data_authorize_klarna, payment_method_data_selected_payment_option, payment_method_data_complete_authorization_card' end |
#to_hash ⇒ Object
13772 13773 13774 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13772 def to_hash subtype_to_hash.merge(:type => @type) end |