Class: Io::Flow::V0::Models::PaymentMethodCardPciDetails

Inherits:
PaymentMethodCard show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from PaymentMethodCard

#type

Instance Method Summary collapse

Methods inherited from PaymentMethodCard

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ PaymentMethodCardPciDetails

Returns a new instance of PaymentMethodCardPciDetails.



57058
57059
57060
57061
57062
57063
57064
57065
57066
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57058

def initialize(incoming={})
  super(:type => PaymentMethodCard::Types::PAYMENT_METHOD_CARD_PCI_DETAILS)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:card_number, :expiration_month, :expiration_year, :name], 'PaymentMethodCardPciDetails')
  @card_number = (x = opts.delete(:card_number); x.is_a?(::Io::Flow::V0::Models::CardNumber) ? x : ::Io::Flow::V0::Models::CardNumber.from_json(x))
  @expiration_month = HttpClient::Preconditions.assert_class('expiration_month', opts.delete(:expiration_month), Integer)
  @expiration_year = HttpClient::Preconditions.assert_class('expiration_year', opts.delete(:expiration_year), Integer)
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
end

Instance Attribute Details

#card_numberObject (readonly)

Returns the value of attribute card_number.



57056
57057
57058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57056

def card_number
  @card_number
end

#expiration_monthObject (readonly)

Returns the value of attribute expiration_month.



57056
57057
57058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57056

def expiration_month
  @expiration_month
end

#expiration_yearObject (readonly)

Returns the value of attribute expiration_year.



57056
57057
57058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57056

def expiration_year
  @expiration_year
end

#nameObject (readonly)

Returns the value of attribute name.



57056
57057
57058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57056

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



57072
57073
57074
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57072

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

#subtype_to_hashObject



57076
57077
57078
57079
57080
57081
57082
57083
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57076

def subtype_to_hash
  {
    :card_number => card_number.to_hash,
    :expiration_month => expiration_month,
    :expiration_year => expiration_year,
    :name => name
  }
end

#to_jsonObject



57068
57069
57070
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 57068

def to_json
  JSON.dump(to_hash)
end