class Io::Flow::V0::Models::CardForm

Attributes

address[R]
challenge_cipher[R]
challenge_text[R]
cipher[R]
cvv[R]
expiration_month[R]
expiration_year[R]
ip[R]
metadata[R]
name[R]
number[R]
requested_currency[R]
token_type[R]

Public Class Methods

new(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 33402
def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:expiration_month, :expiration_year, :name, :cvv], 'CardForm')
  @number = (x = opts.delete(:number); x.nil? ? nil : HttpClient::Preconditions.assert_class('number', x, String))
  @cipher = (x = opts.delete(:cipher); x.nil? ? nil : HttpClient::Preconditions.assert_class('cipher', x, String))
  @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)
  @cvv = HttpClient::Preconditions.assert_class('cvv', opts.delete(:cvv), String)
  @address = (x = opts.delete(:address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::BillingAddress) ? x : ::Io::Flow::V0::Models::BillingAddress.new(x)))
  @ip = (x = opts.delete(:ip); x.nil? ? nil : HttpClient::Preconditions.assert_class('ip', x, String))
  @challenge_text = (x = opts.delete(:challenge_text); x.nil? ? nil : HttpClient::Preconditions.assert_class('challenge_text', x, String))
  @challenge_cipher = (x = opts.delete(:challenge_cipher); x.nil? ? nil : HttpClient::Preconditions.assert_class('challenge_cipher', x, String))
  @token_type = (x = opts.delete(:token_type); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::TokenType) ? x : ::Io::Flow::V0::Models::TokenType.apply(x)))
  @requested_currency = (x = opts.delete(:requested_currency); x.nil? ? nil : HttpClient::Preconditions.assert_class('requested_currency', x, String))
  @metadata = (x = opts.delete(:metadata); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::CardMetadata) ? x : ::Io::Flow::V0::Models::CardMetadata.new(x)))
end

Public Instance Methods

copy(incoming={}) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 33424
def copy(incoming={})
  CardForm.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 33428
def to_hash
  {
    :number => number,
    :cipher => cipher,
    :expiration_month => expiration_month,
    :expiration_year => expiration_year,
    :name => name,
    :cvv => cvv,
    :address => address.nil? ? nil : address.to_hash,
    :ip => ip,
    :challenge_text => challenge_text,
    :challenge_cipher => challenge_cipher,
    :token_type => token_type.nil? ? nil : token_type.value,
    :requested_currency => requested_currency,
    :metadata => metadata.nil? ? nil : metadata.to_hash
  }
end
to_json() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 33420
def to_json
  JSON.dump(to_hash)
end