Ruby on Rails Developers Forum

For all Ruby on Rails (RoR) Expert Developers Programmers Coders
Ruby on Rails PHP .Net Developers Community, Nyros Technologies, Kakinada
 
Log in  or IF not a member please REGISTER
Username:
Password:   


Keyword
Log in | Profile 

Integrating first data global payment gateway in rails

 
Post new topic   Reply to topic    Ruby on Rails Developers Forum Index -> API
View previous topic :: View next topic  
Author Message
sharma I



Joined: 13 Jun 2008
Posts: 157

PostPosted: Wed Mar 31, 2010 12:30 pm    Post subject: Integrating first data global payment gateway in rails Reply with quote

Hi,

For this, we need to register for a sandbox account (test account) in firstdata.com website. By using the following url we can create a test account.
http://www.firstdata.com/gg/apply_test_account.htm

Here, we need to provide the required data like name, address,country etc. After submitting the form, we get a mail with the following data.

Your DBA store name is: "test"
Your store name is between the quotation marks ("): "1234567890"
Your user ID is between the quotation marks ("): "630030"

Your Temporary Password: 12345678

By using the below URL, we can login in the test site with the provided test details in first data global gateway website. Here, we need to login by using store name, userid and password.

https://www.staging.linkpointcentral.com/lpc/servlet/LPCLogin

1) After login into the site, we need to download a .pem file from “DOWNLOAD center” option under the SUPPORT tab. And place this .pem file in our rails application config folder.

2)Then we need to add the below lines of code in our environment.rb file

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

3)After this, we have just add the below method in any one of the controller

def creditcard_process

creditcard = ActiveMerchant::Billing::CreditCard.new(
:number => '4743021568285472',
:verification_value => '123',
:month => 8,
:year => 2018,
:first_name => 'test',
:last_name => 'user',
:type => 'VISA'
)

if creditcard.valid?
@amount = 10
response = GATEWAY.authorize(@amount*100, creditcard,
:order_id => '123456',
:billing_address => {
:userid => 1,
:address1 => '1 Main St',
:city => 'San Jose',
:state => 'CA',
:country => 'US',
:zip => '95131'
},
:email => 'test@yahoo.com'
)
if response.message == 'APPROVED'
GATEWAY.capture(@amount,
response.authorization)
render :text => 'Success' and return
else
render :text => 'Fail' and return
end
else
render :text =>'Credit card not valid '
end
end

Here, GATEWAY.authorize method is used to check the authentication of the payment gateway user by using the .pem file. The authorized method return a value or message like APPROVED or DECLINED or NIL.

If the given details are approved by the global gateway then we are going to capture the amount from the user account by using the “capture” method.

After completion of the payment process, the main user get a mail with the corresponding payment process.

By using this payment gateway we can manage the reports very easily and can download the reports of the payment process.

Thank you,
Sharma
Back to top
View user's profile Send private message
sunil.silumala



Joined: 13 Feb 2013
Posts: 1

PostPosted: Wed Feb 13, 2013 1:33 pm    Post subject: Getting Error Reply with quote

Hello,

I am getting error 'Merchant config file is missing, empty or cannot be read'.
i have gave correct path of pem file and also tried all kind of permission.
can u pls help me.

i am using sandbox account.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Ruby on Rails Developers Forum Index -> API
Page 1 of 1

 latest topics 
 Topics   Replies   Author   Views   Last Post 
No new posts PROBLEMS CREATING AN SSH TUNNEL
0 clem_c_rock 7264 Tue May 07, 2013 6:18 pm
clem_c_rock View latest post
No new posts Module Control
0 mpiaser 739 Sun May 05, 2013 4:12 am
mpiaser View latest post
No new posts Difficulty in learning ruby and rails
8 moneysharma 5849 Sat Apr 20, 2013 6:37 am
lucyming View latest post
No new posts Implementing SEO in rails
1 Rohini Pamarty 3071 Sat Apr 20, 2013 6:36 am
lucyming View latest post
No new posts RVM installation on ubuntu 10.04 version.
2 konduri subrahmanyam 3964 Sat Apr 20, 2013 6:35 am
lucyming View latest post
No new posts How to connect to remote databases in Ruby ?
1 ranjit_nyros 2724 Tue Apr 16, 2013 7:50 am
liveproject101 View latest post
No new posts Install Safari & IE in Ubuntu
2 Anu Krishna 3500 Thu Apr 04, 2013 6:52 am
chrisluger2012 View latest post
No new posts Saving the files in a zip folder using "rubyzip"
0 ranjit_nyros 5371 Thu Mar 14, 2013 5:23 pm
ranjit_nyros View latest post
No new posts [SOLVED]: A must after the installation of phpmyadmin
0 ranjit_nyros 1448 Thu Mar 14, 2013 4:52 pm
ranjit_nyros View latest post
No new posts Cropping Images with Carrierwave + rmagick
0 ranjit_nyros 1425 Thu Mar 14, 2013 4:37 pm
ranjit_nyros View latest post




Hire an expert Ruby on Rails developer / coder / programmer or development team from India now!!

Other Forums : PHP   ::   .Net   |   Free unlimited HTML CSS templates download

Nyros Technologies   |   Kakinada City Portal   |   Developers Blog   |   About Ruby on Rails Experts   |   More