My stackoverflow answer #8

by krike in Other / Stackoverflow answers on 22 Nov 2010


Each week I feature one of my answers on stackoverflow hoping it might help other people.

The question

This weeks question by Wazzy: PayPal with IPN enabled invoking error on cmd = “_cart”

I am using PayPal Website Payment Standard with IPN enabled.

Before I was setting cmd variable like this

<input type="hidden" name="cmd" value="_xclick">

but then I canged it to

<input type="hidden" name="cmd" value="_cart">

Also I changed some other variables inside my form

<input type="hidden" name="item_name_1" value="Item1">
<input type="hidden" name="amount_1" value="2">
<input type="hidden" name="item_name_2" value="Item2">
<input type="hidden" name="amount_2" value="2">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="quantity_2" value="2">
<input type="hidden" name="item_number_1" value="121">
<input type="hidden" name="item_number_2" value="122">

But when the form is Posted to PayPal I am getting this error.

My anwser

did you add target=”paypal” in the form opening tag?

answer in the comments

  • you still have to create a ‘view cart’ button for your site, did you do that? – krike Sep 16 at 11:17
  • follow each step carrefully -> paypal.com/cgi-bin/webscr?cmd=_pdn_xclick_to_cart_outside

Written by krike

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet nisl nisl. Ut interdum libero vitae quam ultricies et lacinia elit aliquet. Praesent tincidunt, sem tempus feugiat feugiat, turpis tellus scelerisque erat, sit amet feugiat neque arcu ac lectus. Sed at mi et elit interdum scelerisque vitae eu felis.

krike has written 77 posts.