PDA

View Full Version : 2CheckOut Help


Tyler
May 20th, 2007, 15:46
After the person I hired to do this for me (I really wanted to do this the right way, heh) bailed, I'm forced to do it myself.

I managed to get the data to 2CO without a problem. I'm using the following code (generated dynamically)


<form action="https://www.2checkout.com/2co/buyer/purchase" method="post">

<input type="hidden" name="id_type" value="1">

<input type="hidden" name="c_prod_3" value="3">
<input type="hidden" name="c_name_3" value="Exclusive Price & Non-Exclusive">
<input type="hidden" name="c_description_3" value="">
<input type="hidden" name="c_price_3" value="199.99">
<input type="hidden" name="c_tangible_3" value="N">
<input type="hidden" name="special_3" value="exclusive">

<br /> <br />
<input type="hidden" name="c_prod_4" value="4">
<input type="hidden" name="c_name_4" value="Non-Exclusive Only">
<input type="hidden" name="c_description_4" value="">
<input type="hidden" name="c_price_4" value="1.99">
<input type="hidden" name="c_tangible_4" value="N">
<input type="hidden" name="special_4" value="non_exclusive">

<br /> <br />
<input type="hidden" name="demo" value="Y">
<input type="hidden" name="sid" value="x">
<input type="hidden" name="cart_order_id" value="83">
<input type="hidden" name="total" value="199.99">

<input type="hidden" name="return_url" value="thankyou.php?type=2co">


<input type="submit" value="Pay through 2CheckOut">

The 2CO docs says that whatever you send, you'll get back through a POST as well. I don't see any way to actually test this, so it looks like I'll need to wing it and then proofread my code.

Does anyone have any ideas on how to get the data back? I need the product names separately along with their details.

Tyler
May 21st, 2007, 04:04
I managed to find a workaround that involves just using the invoiceid instead of each individual product. :)

absolethe
May 22nd, 2007, 17:23
Usually when I want to double-check what is being posted, I use print_r($_POST)... If you're working around a script you don't have access to and I actually understand what you're saying correctly you could use Firefox's developer toolbar to change the form method to GET. Then you'll see all of what you're sending from the form.

Though you did find a workaround and I'm not entirely sure I understand what you needed. :)