Paypal Button throws 422 error

viniciusoliveir
Contributor
Contributor

Hello, I can't identify the reason for an error when using live. Clicking the pay button, the paypal popup closes immediately with the error:

 "Error: /v2/checkout/orders returned status: 422 (Corr ID: daf378feb7fbe)

 

This is the button code:

        
paypal.Buttons({
            style: {
                shape: 'pill',
                color: 'silver',
                layout: 'horizontal',
                label: 'paypal',
                tagline: true
            },
            createOrder: function (data, actions) {
                return actions.order.create({
                    purchase_units: [{
                        amount: {
                            currency_code: 'BRL',
                            value: '101.11'
                        }
                    }]
                });
            },
            onApprove: function (data, actions) {
               .....
            }, onError: function (err) {
                .....
            }
        }).render('#paypal-button-container');

I don't have an exact reference to where the problem is located.

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

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