0

i'm developing a shopping cart and here's a test link

https://www.2checkout.com/checkout/purchase?sid=my_sid&mode=2CO&li_0_type=product&li_0_price=1.00&li_0_quantity=1&li_0_name=Example+Product+Name&li_0_tangible=N&li_1_type=product&li_1_price=1.00&li_1_quantity=1&li_1_name=Example2+Product2+Name2&li_1_tangible=N&card_holder_name=name_here&street_address=full+adress+here&country=my_country&city=my_city&zip=00200&email=hjbhjb@ewfew.com&phone=011&state=my_state&x_receipt_link_url=http://www.my site.net/checkout.php

the return method is Direct Return so the buyer is still at the purchase complete page while parameters are sent to the return page

the question now is : is this the right return url to my page ? correct me if i'm wrong

?sid=my_sid&mode=2CO&li_0_type=product&li_0_price=1.00&li_0_quantity=1&li_0_name=Example+Product+Name&li_0_tangible=N&li_1_type=product&li_1_price=1.00&li_1_quantity=1&li_1_name=Example2+Product2+Name2&li_1_tangible=N&card_holder_name=name_here&street_address=full+adress+here&country=my_country&city=my_city&zip=00200&email=hjbhjb@ewfew.com&phone=011&state=my_state&x_receipt_link_url=http://www.my site.net/checkout.php&hashSecretWord=my_secret_word&hashSid=hash_id&hashTotal=hash_total&hashOrder=hash_order
jq beginner
  • 1,010
  • 3
  • 21
  • 41

1 Answers1

1

The parameters should not be appended to your return URL. The return URL (approved URL) should just be the absolute path to the route or script in your application that will process the return parameters. The Direct Return passback method works by posting the return parameters to your approved URL while the HTML is being fetched by 2Checkout's server and displayed to the buyer. If you are having problems with this return method please make sure that your page is outputting at least 255 characters before you redirect the buyer as the return process will fail otherwise. We can help you with troubleshooting any issues that you encounter as well. Just contact techsupport@2co.com with your account number and we will be happy to help.

Craig-2Checkout
  • 741
  • 5
  • 7
  • I know but i'm asking about how the parameters will be sent to the return URL so i can fetch them correctly please have a look at the sent parameters and the returned ones is this correct ? – jq beginner May 29 '13 at 08:55
  • The parameters are returned by POST so they wont be in the query string and the parameters that you have named with the 'hash*' prefix will not be returned. If you are using PHP, you can access them through the $_POST or $_REQUEST super global. To see the parameters returned, you can set "http://developers.2checkout.com/return_script" as your approved URL and place a demo sale. This will print out all of the returned parameters and show you how they were returned. I also suggest looking at the example below: https://www.2checkout.com/documentation/checkout/passback/validation – Craig-2Checkout May 29 '13 at 12:06
  • so if i change the return method to header return would my way be correct ? – jq beginner May 29 '13 at 12:14
  • When using the header redirect return method the parameters will be returned by GET so for example, if you are using PHP you can fetch them through the $_REQUEST or $_GET variables. But you do not need to specify the parameters in your approved URL query string. Your approved URL should just be the path to your script such as: `https://www.mysite.com/return.php` – Craig-2Checkout Jun 08 '13 at 15:49
  • yes i know i don't specify parameters i just check the returned url is going to be similar to the one I posted so i can $_REQUEST them correctly – jq beginner Jun 09 '13 at 17:04