I have received a number of emails asking about how we did the integration with CyberSource credit card processing system. I have decided to post our extension here so that google can index it. We switched to CyberSource about a year and a half ago and this extension has been proved to be very stable for all this time. It uses CyberSource SCMP API SDK for C language which you can download here.
Note that this API is now considered to be a legacy one, but it still works perfectly. I'm not sure about the future though.
Follow this steps:
- Download SDK from the CyberSource and install it. By default it will be placed at /opt/CyberSource/SDK and this is where ruby extension assumes it resides. Otherwise you have to modify extconf.rb file.
- You need to generate merchant keys and certificate as explained here.
Download ruby extension and use standard steps to install it:
$ ruby extconf.rb $ make $ make install.Test it! SCMP API is a name-value pairs API. Basically, you submit some set of name-value pairs and the server responds with another set of name-value pairs. For details consult documentation which comes with SDK. Below is a simple test program:
#!/usr/bin/env ruby require 'rics' req = ICSMessage.new req['ics_applications'] = 'ics_auth' req['server_host'] = 'ics2test.ic3.com' req['server_port'] = '80' req['merchant_id'] = 'v1111111' req['grand_total_amount'] = '100.55' req['merchant_ref_number'] = '1' req['bill_address1'] = 'Miami Beach' req['bill_city'] = 'Miami' req['bill_country'] = 'US' req['bill_state'] = 'FL' req['bill_zip'] = '33160' req['currency'] = 'USD' req['customer_cc_expmo'] = '12' req['customer_cc_expyr'] = '2005' req['customer_cc_number'] = '4111111111111111' req['customer_firstname'] = 'John' req['customer_lastname'] = 'Doe' req['customer_email'] = 'john@example.com' resp = req.send resp.each do |k,v| puts "#{k} = #{v}" end
Enjoy.