class Io::Flow::V0::Models::CardPaymentSourceSummary

Contains a summary of a card, which is useful for displaying to a customer.

Attributes

card[R]
customer_number[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 33608
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

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 33619
def copy(incoming={})
  CardPaymentSourceSummary.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end
to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 33623
def to_hash
  {
    :customer_number => customer_number,
    :card => card.to_hash
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 33615
def to_json
  JSON.dump(to_hash)
end