nemike Posted October 14, 2021 Posted October 14, 2021 Sorry if this is the wrong place to ask, please redirect me if there is a better place to ask for help. Occasionally we run into a customer who says they are seeing the "Things don't appear to be working at the moment. Please try again later" message from paypal once the transaction is handed off from our server to paypal. And the url has a code=BAD_INPUT_ERROR in it. I was able to get some information from the customer and have found that some combination of the items they are trying to purchase is causing this problem, but I can't seem to narrow it to only one item. I removed items until it started accepting the transaction but then just putting that same item in the cart alone did not trigger the problem. So I'm asking how I can capture (ie debug) what data is sent to paypal so I can determine if we have something weird going on in the data. Thanks, Mike Quote
nemike Posted October 14, 2021 Author Posted October 14, 2021 Well I found the problem, but not sure how to fix it yet, will probably search around in the paypal code... The problem is the (for a lack of what to call it) purchase description can only by a max of 127 characters, but the we are sending the entire purchase list in that field and if the customer orders enough items it overflows that field and then paypal complains. Quote
needs_a_nap Posted October 14, 2021 Posted October 14, 2021 Just an FYI, I’ve seen that error several times when purchasing a ticket on Air Canada’s website and paying by PayPal. Sometimes the page flashes the error and then refreshes on its own and shows the confirmation, other times I get a blank screen after the error flashes… but the payment is always processed on both ends. Not a fix, but hope it helps with your troubleshooting knowing (in my case) the payment does go through. Quote
Jack_mcs Posted October 14, 2021 Posted October 14, 2021 8 hours ago, nemike said: purchase description can only by a max of 127 characters As I recall that was a problem with older paypal modules. If you are using the latest version of the Paypal App then you should install that first. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
nemike Posted October 14, 2021 Author Posted October 14, 2021 Jack_mcs any idea where that fix might have been put? Is there a git repository with the code and a possible fix that I can look at? I can not upgrade as a completely new commerce site would have to be done. I am trying to find the code to fix this myself, if nothing else I was going to truncate the field and end it with ... Thanks, Mike Quote
Jack_mcs Posted October 15, 2021 Posted October 15, 2021 @nemikeThere's no fix for the older paypal modules. You need to install the Paypal App. I can't guarantee that will fix it but it works in many, many shops so I think it probably will. To install it, you have to download the App from the addon site, install it and then update it in your admin. Then you have to replace the cert file with the most recent one. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
nemike Posted October 15, 2021 Author Posted October 15, 2021 Actually I found the code and fixed it and now all transactions that were failing are now working, for anyone else on old code like me here is the fix: edit includes/modules/payment/paypal.php inside the function "formFields" add a line after: $item_number = ''; for ($i=0; $i<sizeof($order->products); $i++) $item_number .= ' '.$order->products[$i]['name'].' ,'; $item_number = substr_replace($item_number,'',-2); This is the new line to add after: if( strlen($item_number) > 127 ) { $item_number = substr($item_number, 0, 124) . "..."; } That fixes the problem. Hope this helps someone. Mike Hotclutch 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.