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 exchange 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.



18351
18352
18353
18354
18355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18351

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.



18349
18350
18351
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18349

def token
  @token
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



18361
18362
18363
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18361

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

#to_hashObject



18365
18366
18367
18368
18369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18365

def to_hash
  {
    :token => token
  }
end

#to_jsonObject



18357
18358
18359
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18357

def to_json
  JSON.dump(to_hash)
end