PayPal throws an error when submitting Buy Now Form with "item_name" field in Sandbox

davidwny
Contributor
Contributor

I am submitting the following form for a buynow transaction:

 

<form class="paypal-button" method="post" action="https://www.sandbox.paypal.com/cgi-bin/webscr" target="_top">
<div id="errorBox" class="hide"></div>
<input name="env" value="www.sandbox" type="hidden">
<input name="cancel_return" value="return URL" type="hidden">
<input name="tax" value="0" type="hidden">
<input name="shipping" value="0" type="hidden">
<input name="currency_code" value="USD" type="hidden">
<input name="amount" value="5" type="hidden">
<input name="quantity" value="1" type="hidden">
<input name="item_name" value="Item Name" type="hidden">
<input name="custom" value="custom value" type="hidden">
<input name="button" value="buynow" type="hidden">
<input name="cmd" value="_xclick" type="hidden">
<input name="business" value="my-sandbox-account" type="hidden">
<input name="bn" value="JavaScriptButton_buynow" type="hidden">
<input class="member-new-pp paypal-button" src="https://www.paypalobjects.com/webstatic/en_US/i/buttons/checkout-logo-large.png" type="image">
</form>
 
I get the following error if I submit as is:
 
Redirected URL from PayPal:
 
 
Displayed Message:
 
Things don't appear to be working at the moment. Please try again later.
 
This stopped working without any changes...thoughts?  If I remove the item_name field or set the value to "", the form submits without issue.  OW I get the error specified.  Thanks in advance for any help on this...sandbox is a bit glitchey!
Login to Me Too
2 REPLIES 2

MTS_Jennifer
Moderator
Moderator

I copied your code and modified the business value to one of my valid Sandbox Emails and was able to use the code with no issues.


<input name="business" value="yourvalidemail@email.com" type="hidden">

 

2018-04-08 12_49_37-PayPal Checkout.png

 

I also updated the Item name just in case as well:

<input name="item_name" value="My Pen" type="hidden">

2018-04-08 12_53_23-PayPal Checkout.png

Ensure that the business value is a valid Sandbox Email address, and when adding the item_name ensure that the item_name is not greater than 127 characters.

 

Thank you,

Jennifer

Login to Me Too

davidwny
Contributor
Contributor

I came back the next morning and re-ran the transaction scripts...without any changes everything processed correctly.   The real issue here is the glitchey PayPal sandbox environment.  I have had more then one occasion where the Sandbox will just decide to either stop accepting IPN requests or start to throw errors for perfectly good transactions.  In this situation I wasted a few hours trying to run down this non-error.

 

My only option is to start steering clients away from using PayPal or simply charge more for the anticipated wasted time during development when a client insists on using PayPal.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.