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.



24884
24885
24886
24887
24888
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24884

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.



24882
24883
24884
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24882

def token
  @token
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



24894
24895
24896
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24894

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

#to_hashObject



24898
24899
24900
24901
24902
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24898

def to_hash
  {
    :token => token
  }
end

#to_jsonObject



24890
24891
24892
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24890

def to_json
  JSON.dump(to_hash)
end