Class: Io::Flow::V0::Models::CardNonceForm

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

Overview

The card nonce form presents a one time token to exchance server side for a permanent, secure tokenized card

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ CardNonceForm

Returns a new instance of CardNonceForm.



12647
12648
12649
12650
12651
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12647

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:token], 'CardNonceForm')
  @token = HttpClient::Preconditions.assert_class('token', opts.delete(:token), String)
end

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token.



12645
12646
12647
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12645

def token
  @token
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



12657
12658
12659
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12657

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

#to_hashObject



12661
12662
12663
12664
12665
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12661

def to_hash
  {
    :token => token
  }
end

#to_jsonObject



12653
12654
12655
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12653

def to_json
  JSON.dump(to_hash)
end