Skip to content

Instantly share code, notes, and snippets.

@ntalbott
Created October 5, 2013 14:52
Show Gist options
  • Save ntalbott/6841857 to your computer and use it in GitHub Desktop.
Save ntalbott/6841857 to your computer and use it in GitHub Desktop.
Thoughts on wrapping the Realex Vault API for ActiveMerchant
response = store(cc)
token = response.authorization #=> "#{payer_ref}:#{card_ref}"
update(token, {...})
def store(cc, options={})
payer_ref = (options[:customer] || generate_unique_id[0...30])
card_ref = (options[:card_reference] || generate_unique_id[0...30])
MultiResponse.new.tap do |r|
r.process{store_payer(payer_ref, options)}
r.process{store_card(payer_ref, card_ref, options)}
end
end
def update(token, options)
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment