Class: Io::Flow::V0::Models::CardPaymentSource
- Inherits:
-
PaymentSource
- Object
- PaymentSource
- Io::Flow::V0::Models::CardPaymentSource
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Represents a saved credit card payment method.
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
Attributes inherited from PaymentSource
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CardPaymentSource
constructor
A new instance of CardPaymentSource.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from PaymentSource
Constructor Details
#initialize(incoming = {}) ⇒ CardPaymentSource
Returns a new instance of CardPaymentSource.
23798 23799 23800 23801 23802 23803 23804 23805 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23798 def initialize(incoming={}) super(:discriminator => PaymentSource::Types::CARD_PAYMENT_SOURCE) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :summary], 'CardPaymentSource') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @actions = (x = opts.delete(:actions); x.nil? ? nil : HttpClient::Preconditions.assert_class('actions', x, Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::PaymentSourceConfirmationAction) ? x : ::Io::Flow::V0::Models::PaymentSourceConfirmationAction.new(x)) }) @summary = (x = opts.delete(:summary); x.is_a?(::Io::Flow::V0::Models::CardPaymentSourceSummary) ? x : ::Io::Flow::V0::Models::CardPaymentSourceSummary.new(x)) end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
23796 23797 23798 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23796 def actions @actions end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
23796 23797 23798 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23796 def id @id end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
23796 23797 23798 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23796 def summary @summary end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
23811 23812 23813 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23811 def copy(incoming={}) CardPaymentSource.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
23815 23816 23817 23818 23819 23820 23821 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23815 def subtype_to_hash { :id => id, :actions => actions.nil? ? nil : actions.map { |o| o.to_hash }, :summary => summary.to_hash } end |
#to_json ⇒ Object
23807 23808 23809 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23807 def to_json JSON.dump(to_hash) end |