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.



13224
13225
13226
13227
13228
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13224

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.



13222
13223
13224
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13222

def token
  @token
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



13234
13235
13236
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13234

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

#to_hashObject



13238
13239
13240
13241
13242
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13238

def to_hash
  {
    :token => token
  }
end

#to_jsonObject



13230
13231
13232
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13230

def to_json
  JSON.dump(to_hash)
end