Web Hosting Talk







View Full Version : Simple Order Form. -> 2CheckOut.com - HELP!


Kaumil
06-16-2002, 10:07 PM
Hey guys,

We are going to be using 2checkout.com as our payment processor for a while until we can acquire a merchant account from our bank. (it takes a while).

I need help with creating a form. Basically, I want to create a form that will take some information from our potential clients send the information to a specified e-mail and when they click "Next-> Credit Card Information". It will take them to the desired product page at 2checkout.com.

The user will choose from a pull-down menu selection on the form, so that's how the form will know where to send them.

Can someone please help me? Thanks in advance!

chrisb
06-17-2002, 12:38 AM
I'd suggest that you take a look at http://cpan.org/modules/by-module and look at the documentation for Mime:Lite and install it. I would save and pass the info by using the CGI module, and passing parameters to the 2checkout form.

There's probably an easier way to do it in PHP, but I've never used PHP.

Try Googling a bit, and you'll probably find one already written.

DefiantPc
06-17-2002, 01:11 AM
You can get a simple CGI form processing script , http://bignosebird.com/carchive/bnbform.shtml (this ones easy)

Then set the return path url on your form to your 2checkout page.

<input type="HIDDEN" name="ok_url" value=
"http://your2checkoutlink.com">

Hope this helps.

LinuXpert
06-17-2002, 01:20 AM
It's easy now to pass info from your pages to 2CheckOut payment routine pages. Once your customers submit their information from your order pages you can store them in your database and call a payment routine link which includes their information, for example http://2checkout.com/routine.2c?id=yourID&productID=your_product_ID &customer_name=your_customer_name The purple part you can obtain from your account at 2Checkout and the red part you can put everything there but in order to help your customers not have to fill their information again at 2checkout pages you should use 2Checkout order's form variables.
Hope this helps.

Kaumil
06-18-2002, 08:00 AM
Thank you guys, I'll see what I can do. More recommendations or suggestions would greatly help!

The Laughing Cow
06-18-2002, 11:01 AM
I made a nice little script once that was a step by step order system for 2checkout.

I could customise it to you for a fee if you like.

espart
06-18-2002, 12:26 PM
Originally posted by The Laughing Cow
I made a nice little script once that was a step by step order system for 2checkout.

I could customise it to you for a fee if you like.

I really like to have the script if it's not to much to ask, i tried to setup few scripts but i am getting stuck where the user has to chose a plan and then be pointed to the peoper 2checkuot link.

Thanks

The Laughing Cow
06-18-2002, 12:48 PM
Well it was designed custom for my old hosting company and it would need to be redesigned depending on your plans, prices etc. At the moment none of it's commented and quite hard to follow.

espart
06-18-2002, 12:59 PM
Originally posted by The Laughing Cow
Well it was designed custom for my old hosting company and it would need to be redesigned depending on your plans, prices etc. At the moment none of it's commented and quite hard to follow.

OH, i thought i just could modify the script by changing your pricing and plans with mine..
Please advise

Thanks

LinuXpert
06-18-2002, 01:11 PM
It's not difficult to write such script. You can base on the plan to call the payment page, for example (in Perl):

if ($FORM{'plan'}==1){$url='https://link_to_payment_page_for_ _Plan1'}
if ($FORM{'plan'}==2){$url='https://link_to_payment_page_for_ _Plan2'}
print "Location: $url\n\n" ;
That's it. You can do it yourself.

espart
06-18-2002, 04:43 PM
is there anyway someone can show me some samples?

Thanks

LinuXpert
06-18-2002, 09:05 PM
Sample? Yes, you can see how it works at our website, it's not a single PHP script but includes everything I need to manage client's accounts. If you need a little single Perl script (only redirect clients to appropriate 2C/O page), email me and I will send it to you.

The Laughing Cow
06-19-2002, 04:52 AM
If you just need to redirect clients to the 2co account just use client-side Js much more sensible imo!

LinuXpert
06-19-2002, 05:27 AM
Right. But if you want to store clients' info or do something like sending a confirmation email before redirecting them to 2C/O page then you need to use server-side script.

The Laughing Cow
06-19-2002, 05:36 AM
of course.

I think a good idea is as I had to add clients to a client database, add them to your supportdesk all at the same time and send welcome letters.

LinuXpert
06-19-2002, 05:57 AM
Yes, those are what I have with my PHP script, although it's not good as phpManager, it can do all the basic works for me.

espart
06-19-2002, 11:45 PM
i have created the form and modified the script the problem now is when the form passes the user to 2checkout it only links to the last plan what i am trying to say is whatever the user choses it stil goes to last plan on the list here is how i did it:

#Here you can base on your plans to call appropriate 2C/O links. This sample for cart purchase routine, what required by 2C/O should be included here.
#Here you can base on your plans to call appropriate 2C/O links. This sample for cart purchase routine, what required by 2C/O should be included here.
if ($FORM{'Plan_Type'}==light){$url='https://www.2checkout.com/cgi-bin/crbuyers/recpurchase.2c?sid=MY_ID&merchant_order_id=&product_id=3'}
if ($FORM{'Plan_Type'}==basic){$url='https://www.2checkout.com/cgi-bin/crbuyers/recpurchase.2c?sid=MY_ID&merchant_order_id=&product_id=5'}
if ($FORM{'Plan_Type'}==personal){$url='https://www.2checkout.com/cgi-bin/crbuyers/recpurchase.2c?sid=MY_ID&merchant_order_id=&product_id=6'}
if ($FORM{'Plan_Type'}==Professional){$url='https://www.2checkout.com/cgi-bin/crbuyers/recpurchase.2c?sid=MY_ID&merchant_order_id=&product_id=7'}
if ($FORM{'Plan_Type'}==Corporate){$url='https://www.2checkout.com/cgi-bin/crbuyers/recpurchase.2c?sid=MY_ID&merchant_order_id=&product_id=8'}


and here is the entery on the form:

<table border="1" width="100%" cellpadding="3" class="content" cellspacing=0>
<tr>
<td width="34%">Account Type</td>
<td width="66%"><SELECT NAME="Plan_Type" SIZE="1">
<OPTION VALUE="Lite">Lite-$9.99</option>
<OPTION VALUE="Basic">Basic-$13.99</option>
<OPTION VALUE="Personal">Personal-$19.99</option>
<OPTION VALUE="Professional">Professional-$29.99</option>
<OPTION VALUE="Corporate">Corporate-$39.99</option>
</SELECT></td>
</tr>
<tr>

am i doing something wrong here?

Please help!
Thanks

LinuXpert
06-20-2002, 12:07 AM
Try this : if ($FORM{'Plan_Type'} eq 'Lite'){$url='link'}

espart
06-20-2002, 12:32 AM
Thanks that was it

The Laughing Cow
06-20-2002, 04:59 AM
You should change it into a Case switch, that would be much more efficient.