Status code 422

jsansel
New Community Member

Good morning, I find an error, which I already saw the responses from the community, and apparently it lies in the format in which I send my total amount, the detail here is that my total amount is only the value of 1, since I am trying to test if the money really gets to the other account, but it throws me an error that starts with the following / v2 / checkout / orders returned status: 422 (Corr ID: 8d5043ecc0d28)
     at https://www.paypal.com/smart/buttons?

It should be noted that I try to put the button in production, so I pass the Client-Id to the link, but I do not understand what happens, since it is the same code that paypal provides me to paste on my website

What I use is the smartbutton offered by paypal, regards.

 

This is my code

 

<script src="https://www.paypal.com/sdk/js?client-id=<here, i changed "sb" for my client-id>&currency=MXN" data-sdk-integration-source="button-factory"></script>
        <script>
     
       
        paypal.Buttons({
            style: {
                shape: 'rect',
                color: 'gold',
                layout: 'vertical',
                label: 'paypal',
                
            },
            createOrder: function(data, actions) {
                return actions.order.create({
                    purchase_units: [{
                        amount: {
                            value: 1,
                            currency: "MXN"
                        },
                        description: "Pago por productos Natural Wuane"
                    }]
                });
            },
            onApprove: function(data, actions) {
                return actions.order.capture().then(function(details) {
                    completarCompra(details);
                    //alert('Transaction completed by ' + details.payer.name.given_name + '!');
                });
            }
        }).render('#paypal-button-container');
        </script>

 

Login to Me Too
2 REPLIES 2

GeoffD3
Contributor
Contributor

I noticed that in your amount you have currency: "MXN" and it should be currency_code: "MXN". Hope that helps.

Login to Me Too

MTS_Rob
PayPal Employee
PayPal Employee

Hello @jsansel 

Thanks for reaching out to us, I went ahead and took a look at the error and the debug ID provided and it looks like there was a configuration issue that was preventing some of your APIs from processing, but that has since been resolved. It looks like your payments are working now.

 

If you see this again, feel free to reach out to PayPal Merchant Technical Support directly. We can review the logs and provide more details directly when you run into an issue.

 

Thanks,

Robert - PayPal MTS

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.