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



13246
13247
13248
13249
13250
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13246

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.



13244
13245
13246
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13244

def token
  @token
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



13256
13257
13258
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13256

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

#to_hashObject



13260
13261
13262
13263
13264
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13260

def to_hash
  {
    :token => token
  }
end

#to_jsonObject



13252
13253
13254
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13252

def to_json
  JSON.dump(to_hash)
end