First Data Ruby on Rails GEM

Dec 20, 2011 Published by Tony Primerano

The First Data API page does not provide an API for Ruby but there is a gem called activemerchant that supports First Data/Linkpoint. Their documentation does not mention First Data but I eventually realized that Linkpoint is the same thing.  :-)

Free Resources

Random notes

  • sudo gem install activemerchant

purchase authorized and executed in 1 ste[

  • response = gateway,purchase(1000, credit_card)

If shipping and want to charge later do

  • authorize
    • response = gateway,authorize(1000, credit_card)
  • charge
    • gateway.capture(1000, response.authorization)

See also gateway.credit and gateway.void

FirstData/Linkpoint specifics

You need to setup a test account with FirstData

development.rb snippet

config.after_initialize do
  ActiveMerchant::Billing::LinkpointGateway.pem_file  = File.read(File.dirname(__FILE__) + '/mycert.pem')
  ActiveMerchant::Billing::Base.mode = :test
  ::GATEWAY = ActiveMerchant::Billing::LinkpointGateway.new(
    :login => "YOUR STORE NAME"  
  )
end