Paypal checkout suddenly failing - help - site down as a result

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
image

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 payload appears to be correct

image

Research indicates that the “+” signs may be an issue

Anyone many ideas,

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

1 Like

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">&nbsp;</div>
                        <div class="col-sm-10">
                            <button id="btn1_submit" type="submit" class="btn btn-light">&nbsp;</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>

From audit, looks like last successful transaction was 18th February, so 2 updates ago

What about the ampersand between the store values? Should it be &?

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

The ampersand is a separator between 2 values fir the custom field which is the basis for a split() in the IPN webhook server action.

Maybe check that with paypal support?

Thanks Teodor, that looks like it may be the issue, will check customer has email listed correctly and if so raise a ticket with PayPal

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.

1 Like