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.



50685
50686
50687
50688
50689
50690
50691
50692
50693
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50685

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.



50683
50684
50685
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50683

def card_number
  @card_number
end

#expiration_monthObject (readonly)

Returns the value of attribute expiration_month.



50683
50684
50685
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50683

def expiration_month
  @expiration_month
end

#expiration_yearObject (readonly)

Returns the value of attribute expiration_year.



50683
50684
50685
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50683

def expiration_year
  @expiration_year
end

#nameObject (readonly)

Returns the value of attribute name.



50683
50684
50685
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50683

def name
  @name
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



50699
50700
50701
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50699

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

#subtype_to_hashObject



50703
50704
50705
50706
50707
50708
50709
50710
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50703

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

#to_jsonObject



50695
50696
50697
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 50695

def to_json
  JSON.dump(to_hash)
end