> Ruby on Rails Strategy - From Idea to Mobile App RealityVinova Our team will brainstorm with you on where to begin, where to go, and how to get you there. Whether you have a spark of an idea or an existing app – we can help. Getting your mobile strategy right is what our unique services are all about. We’ll wrestle with business challenges, discover new opportunities that will help you define and refine your product ideas into mobile app reality.

Integrate Singapore eNETS payment gateway and Ruby on Rails.

There are always needs to build E-commerce sites with Credit Card transactions securely and seamlessly. In Singapore market, eNETs is the most well-known company providing payment gateway services. Up to now, eNETS only provide API for .NET and Java platform. In this post, I will show you my solution to integrate eNETS and Ruby on Rails via Java.

Steps:

1. Build JAR file to submit payment info to eNETS, i named it enets.jar. This jar file will return output from eNETS to console in text format. I attached sample program built with NetBean, you can download it here: eNETS. After downloading, you just copy that folder to your NetBean projects folder as shown in below image.

NetBean projects folder

NetBean Projects Folder

2. Follow eNETS guideline, change setting for java security as well as generate merchant.priv.pgp.asc, merchant.pub.pgp.asc.

3. Change config: log4j.properties, NETSConfig.xml

4. Build enets.jar file from source files in NetBean. Right click on project root, Clean and Build.

5. Generate command to execute enets.jar, something like this:

“java -jar #{RAILS_ROOT}/vendor/extensions/payment_gateway/lib/enets/eNETS.jar #{mid} #{tid} #{paymentMode} #{amt} #{currency} #{merRef} #{submitMode} #{merCertId} #{pan} #{expiry} #{stan} #{paymentType} #{successURL} #{successURLParams} #{failureURL} #{failureURLParams} #{notify_url} #{notify_url_params} #{name} #{cvv} #{post_url} #{post_url_params} #{cancel_url} #{cancel_url_params} #{bill_first_name} #{bill_last_name} #{bill_initial} #{bill_addr1} #{bill_addr2} #{bill_coy_name} #{bill_city} #{bill_state} #{bill_zip_code} #{bill_country} #{bill_mobile_num} #{bill_phone_num} #{bill_fax_num} #{bill_email} #{ship_first_name} #{ship_last_name} #{ship_initial} #{ship_addr1} #{ship_addr2} #{ship_coy_name} #{ship_city} #{ship_state} #{ship_zip_code} #{ship_country} #{ship_mobile_num} #{ship_phone_num} #{ship_fax_num} #{ship_email} #{shopper_ip_addr} #{product_format} #{product_details} #{gw_url}”

6. Run enets.jar from ruby console with output = %x[#{command}]. %x[] command will store output to output variable for later processing. It is not the same as system() or exec() ruby command. Read more on Jay Fields’ blog:  Ruby Kernel system, exec and %x

7. Parse results returned from enets.jar and continue with your business logic in your ruby/rails application. For rails project, i recommend you to use Active-Merchant and modify Bogus payment gateway so that you will follow format of ActiveMerchant framework. You will be supprised because the effort required  is very little.

What are your solutions to integrate with eNETS from Rails project? I would like to know if you have better solutions. Thank you.

Malcare WordPress Security

developer in singapore,web design singapore,ruby on rails developer singapore,singapore web design,singapore website design,website development singapore,singapore web design services,website designer singapore,web design services singapore,app developer singapore,mobile game developer singapore,developers in singapore,design agency singapore,android developer singapore,singapore app developer,website developer singapore,app development singapore,web design company singapore,mobile application development singapore,ios developer singapore,design firms in singapore,mobile application developer singapore,mobile app development singapore,singapore mobile app developer,web application singapore,mobile app developer singapore,web development singapore,mobile developer singapore,singapore mobile application developer,mobile apps development singapore,singapore web development,mobile apps singapore,website design singapore,web designer singapore,ios app development singapore,graphic designer in singapore,web development company singapore