I would like to get some help on how to setup paypal payment with a custom cart. At the end of the product selection I would like to give the user payment options. when choosing paypal I would like to reroute to paypal with the total amount due so the user can make a payment. I am trying to do so with the following form
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="business login?">
<input type="hidden" name="item_name" value="hat">
<input type="hidden" name="item_number" value="123">
<input type="hidden" name="amount" value="15.00">
<input type="hidden" name="first_name" value="John">
<input type="hidden" name="last_name" value="Doe">
<input type="hidden" name="address1" value="any Street">
<input type="hidden" name="address2" value="Apt 5">
<input type="hidden" name="city" value="any town">
<input type="hidden" name="state" value="CA">
<input type="hidden" name="zip" value="00000">
<input type="hidden" name="night_phone_a" value="610">
<input type="hidden" name="night_phone_b" value="555">
<input type="hidden" name="night_phon开发者_运维知识库e_c" value="1234">
<input type="hidden" name="email" value="name@mail.com">
<INPUT TYPE="hidden" NAME="currency_code" value="CurrencyCode">
<input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif" alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1" src="https://www.paypal.com/en_US/i/scr/pixel.gif" >
</form>
When I submit this form , paypal only recognizes the seller ( the name is shown in the page) but no other parameters. I also get this message :"We have detected a problem with this shopping cart. If the problem persists, please contact the merchant." Any idea what I am doing wrong? I greatly appreciate the help.
ps:I would like to specify that I am doing this from a local server. I don't know if paypal require the seller to register a URL first. if so do you know here I would have to do that on the paypal account?
This works the key was the value of the "cmd" input has to be "_xclick" This way paypal gets the total of the transaction rather than each item.
I hope this helps others
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="paypal@mmi-hamburg.com">
<input type="hidden" name="business" value="business login?">
<input type="hidden" name="item_name" value="hat">
<input type="hidden" name="item_number" value="123">
<input type="hidden" name="amount" value="15.00">
<input type="hidden" name="first_name" value="John">
<input type="hidden" name="last_name" value="Doe">
<input type="hidden" name="address1" value="any Street">
<input type="hidden" name="address2" value="Apt 5">
<input type="hidden" name="city" value="any town">
<input type="hidden" name="state" value="CA">
<input type="hidden" name="zip" value="00000">
<input type="hidden" name="night_phone_a" value="610">
<input type="hidden" name="night_phone_b" value="555">
<input type="hidden" name="night_phone_c" value="1234">
<input type="hidden" name="email" value="name@mail.com">
<input type="submit" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
精彩评论