Class: Io::Flow::V0::Models::CardPaymentSourceSummary
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CardPaymentSourceSummary
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
Contains a summary of a card, which is useful for displaying to a customer.
Instance Attribute Summary collapse
-
#card ⇒ Object
readonly
Returns the value of attribute card.
-
#customer_number ⇒ Object
readonly
Returns the value of attribute customer_number.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CardPaymentSourceSummary
constructor
A new instance of CardPaymentSourceSummary.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CardPaymentSourceSummary
Returns a new instance of CardPaymentSourceSummary.
25491 25492 25493 25494 25495 25496 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25491 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:customer_number, :card], 'CardPaymentSourceSummary') @customer_number = HttpClient::Preconditions.assert_class('customer_number', opts.delete(:customer_number), String) @card = (x = opts.delete(:card); x.is_a?(::Io::Flow::V0::Models::CardSummary) ? x : ::Io::Flow::V0::Models::CardSummary.new(x)) end |
Instance Attribute Details
#card ⇒ Object (readonly)
Returns the value of attribute card.
25489 25490 25491 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25489 def card @card end |
#customer_number ⇒ Object (readonly)
Returns the value of attribute customer_number.
25489 25490 25491 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25489 def customer_number @customer_number end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
25502 25503 25504 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25502 def copy(incoming={}) CardPaymentSourceSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
25506 25507 25508 25509 25510 25511 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25506 def to_hash { :customer_number => customer_number, :card => card.to_hash } end |
#to_json ⇒ Object
25498 25499 25500 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25498 def to_json JSON.dump(to_hash) end |