Integration with 2Checkout

Hi

I want to Integrate 2Checkout as payment gateway with my application. I am not very much aware about 2Checkout payment gateway. Already I have a script for Integrating 2Checkout as payment gateway as below:

<form method=post action=https://www.2checkout.com/cgi-bin/sbuyers/purchase.2c >
<INPUT type=“submit” value=“Click to pay thru 2CheckOut”>
<input type=hidden name=sid value=25421>
<input type=hidden name=product_id value=1>
<input type=hidden name=quantity value=1>
<input type=hidden name=merchant_order_id value=AFFILIATEUSERNAME>
</form>

But in this script there is some problem.

This script doesn’t take any return value for returning to the “congratulation page” after successfull payment like paypal. Payment error page is also missing.

1: Have I to set all this things from http://www.2checkout.com/.

   OR

2: Is anybody here who can provide a better script for 2Checkout which will take “return value” and “cancel return page” as hidden value along with payment description.

This can be done in your 2CO control panel.

After logging in, click on “Account Details” > “Returns”

For “Return to a routine on your site after credit card processed?”, select “Yes”.

Then, simply enter the Return URL in the field provided. As for the payment error page, 2CO will automatically do this for you if the user’s payment is declined.

Hope this helps :slight_smile:

Thank you for your reply. Now it’s quite clear to me. But I have a question as follows:

1: I want to return some value with return url. As for example ‘X’ want to purchase some product and his userid is 22. Now I want to send this userid to 2checkout.com as hidden value during checkout and after successfull payment it returns to my site along with that userid ( userid of ‘X’).

Now tell me to do it, what I have to do?

2co will passback any extra (not in their spec) parameter that you send to them. So just include your own parameter in the form.

<form method=post action=“https://www.2checkout.com/cgi-bin/sbuyers/purchase.2c” >
<input type=hidden name=sid value=122222>
<input type=hidden name=product_id value=1>
<input type=hidden name=quantity value=1>
<input type=hidden name=merchant_order_id value=“y”>
<input type=“hidden” name=“demo” value=“Y”>
<INPUT type=“submit” value=“Click to pay thru 2CheckOut”>
</form>

It is my form content. Whenever I submit this form 2checkout showing some error “Parameter Error”. I can’t understand the reson behind it. Because those paramenters in my form are mandatory except “demo”.

I am able to solve this problem. Now it works fine.