I have a long established site which uses PayPal as a checkout
The items come from a data store and a form repeat
Suddenly it has started to fail with a paypal message
I see this in the dev console
flowlogging_id=ee7d930919202&code=BAD_INPUT_ERROR
I notice in the payload a number of “+” signs which should not be there, they certainly are not in the product database (couple of examples highlighted) i.e.
The plus represents a space in the query portion of a url. You could try urlencoding everything (if you are not already doing so), or try replacing spaces with %20
Thanks Ken, my initial thoughts also, Looks like the “+” issue is not the cause, have hard coded item name to a fixed value with no spaces and the checkout error persists
This is a code snippet of the relevant parts of the checkout code which has worked perfectly until a few days ago
<div class="container" id="sender">
<div class="row">
<div class="col">
<form id="form1" action="https://www.paypal.com/cgi-bin/webscr">
<div class="form-group mb-3 row">
<div class="col-sm-2"> </div>
<div class="col-sm-10">
<button id="btn1_submit" type="submit" class="btn btn-light"> </button>
</div>
</div>
<input name="cmd" type="hidden" value="_cart">
<input name="upload" type="hidden" value="1">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="return" value="https://baafest.com?msg=thankyou">
<input type="hidden" name="cancel_return" value="https://baafest.com?msg=cancel">
<input type="hidden" name="invoice" dmx-bind:value="var2.value">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="tickets@baafestival.com">
<!-- <input type="hidden" name="custom" dmx-bind:value="store1.data[0].custom"> -->
<input type="hidden" name="custom" dmx-bind:value="store2.data[0].email + '&' + store2.data[0].event">
<!-- Specify the items -->
<div id="repeat1" is="dmx-repeat" dmx-bind:repeat="store1.data">
<input id="text3" dmx-bind:name="'item_name_'+($index+1)" type="hidden" class="form-control" dmx-bind:value="'ticket'">
<input id="text2" dmx-bind:name="'amount_'+($index+1)" type="hidden" class="form-control" dmx-bind:value="price">
<input id="text4" dmx-bind:name="'quantity_'+($index+1)" type="hidden" class="form-control" dmx-bind:value="quantity">
</div>
<!-- form is submitted on success of basket save -->
</form>
</div>
</div>
</div>
Also I don’t have my computer with me to look, it seems like when I worked on some binding yesterday I had to remove single quotes and pluses and use curly braces.
So “‘item_name_’+($index+1)” became “ item_name_{{$index+1}}” or soemthing like that. I know I had to do it on dmx-bind:id not sure about the name tags
Thanks again Teodor, my many searches on the error did not turn up that post but it was the answer.
Customer added the email to the paypal list and all works as it should.