Reputation: 769
Having a very hard to explain issue. I have a custom cart implementation. Some of my cart forms go through fine, but some give back a bad input error with not much additional explanation.
For example, this form submits fine and the payment gateway appears:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="charset" value="utf-8">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="item_name_1" value="Power Long Sleeve L-Black">
<input type="hidden" name="item_number_1" value="06034">
<input type="hidden" name="amount_1" value="45.00">
<input type="hidden" name="shipping_1" value="4">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="item_name_2" value="Classic B1100 Beanie">
<input type="hidden" name="item_number_2" value="39856">
<input type="hidden" name="amount_2" value="40.00">
<input type="hidden" name="shipping_2" value="0">
<input type="hidden" name="quantity_2" value="1">
<input type="hidden" name="custom" value="custom_string">
<input type="hidden" name="tax_cart" value="0">
<input type="hidden" name="notify_url" value="http://mynotificationurl.com">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="cbt" value="Back to Store">
<input type="hidden" name="bn" value="MY_ShoppingCart_WPS_US">
<input type="hidden" name="return" value="http://www.example.com">
<input type="hidden" name="cancel_return" value="http://www.example.com">
</form>
However this form, generated by the same script, continues to fail:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="charset" value="utf-8">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="[email protected]">
<input type="hidden" name="item_name_1" value="Power Long Sleeve L-Black">
<input type="hidden" name="item_number_1" value="06034">
<input type="hidden" name="amount_1" value="45.00">
<input type="hidden" name="shipping_1" value="4">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="item_name_2" value="Classic B1100 Beanie">
<input type="hidden" name="item_number_2" value="39856">
<input type="hidden" name="amount_2" value="40.00">
<input type="hidden" name="shipping_2" value="0">
<input type="hidden" name="quantity_2" value="1">
<input type="hidden" name="item_name_3" value="EXS R1 Poster">
<input type="hidden" name="item_number_3" value="80069">
<input type="hidden" name="amount_3" value="25.00">
<input type="hidden" name="shipping_3" value="0">
<input type="hidden" name="quantity_3" value="1">
<input type="hidden" name="custom" value="custom_string">
<input type="hidden" name="tax_cart" value="0">
<input type="hidden" name="notify_url" value="https://mynotificationurl.com">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="cbt" value="Back to Store">
<input type="hidden" name="bn" value="MY_ShoppingCart_WPS_US">
<input type="hidden" name="return" value="http://www.example.com">
<input type="hidden" name="cancel_return" value="http://www.example.com">
</form>`
These forms are identical with exception to the third product in the list. The first form works and the second does not. I see no issues with any of the input data.
Also important to note that I ONLY get this error with more than 1 item in the cart, and it has nothing to do with individual products. When the third product in the second form is the only item in the cart, it submits fine. All of the data is the same. Am I crazy or is this a Paypal bug, or are they doing maintenance?
Here is the url Paypal redirects to when it fails:
https://www.paypal.com/webapps/shoppingcart/error?flowlogging_id=4936eeb7c68aa&code=BAD_INPUT_ERROR&mfid=1493965871301_4936eeb7c68aa
Thank you in advance for any help!!
Upvotes: 1
Views: 409
Reputation: 769
Got a response back from Paypal today. It seems that in recent updates to their platform, they set a character limit on the custom
field to 256.
My custom fields would fill up with more data the more items that were added to the cart, so that's why the error was only on multi-item carts. There seems to be not a lot of documentation on this.
Here was another question I found useful: Paypal html button custom field limit
Upvotes: 1