Class: Io::Flow::V0::Models::CardPaymentSourceForm

Inherits:
PaymentSourceForm show all
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

Attributes inherited from PaymentSourceForm

#discriminator

Instance Method Summary collapse

Methods inherited from PaymentSourceForm

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ CardPaymentSourceForm

Returns a new instance of CardPaymentSourceForm.



25461
25462
25463
25464
25465
25466
25467
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25461

def initialize(incoming={})
  super(:discriminator => PaymentSourceForm::Types::CARD_PAYMENT_SOURCE_FORM)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:customer_number, :card_id], 'CardPaymentSourceForm')
  @customer_number = HttpClient::Preconditions.assert_class('customer_number', opts.delete(:customer_number), String)
  @card_id = HttpClient::Preconditions.assert_class('card_id', opts.delete(:card_id), String)
end

Instance Attribute Details

#card_idObject (readonly)

Returns the value of attribute card_id.



25459
25460
25461
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25459

def card_id
  @card_id
end

#customer_numberObject (readonly)

Returns the value of attribute customer_number.



25459
25460
25461
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25459

def customer_number
  @customer_number
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25473
25474
25475
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25473

def copy(incoming={})
  CardPaymentSourceForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



25477
25478
25479
25480
25481
25482
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25477

def subtype_to_hash
  {
    :customer_number => customer_number,
    :card_id => card_id
  }
end

#to_jsonObject



25469
25470
25471
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25469

def to_json
  JSON.dump(to_hash)
end