I want to set up PayPal standard payments with :
- the JavaScript SDK from PayPal, as explained here.
- and handling creating and capturing an order from a PHP backend, as explained here.
I use the samples and the code works with a few modifications. I receive the orderId from the server and the processing continues on the client side (display of the payment popup, ...)
Now I want to deal with the case when CreateOrder fails on the server side. In this case, I send back an HTTP error code : header('HTTP/1.1 500 xxxxxx')
On client side, it's impossible to have error-free processing. I always get an error in the console : 'create_order_error' or/and 'click_initiate_payment_reject'.
I've tried to use the catch function on the promise, or return Promise.reject('xxx'), but nothing does anything about it.
Do you have a solution?