Cannot reject countries in onShippingChange callback with return actions.reject()
I've created a single html file (gist here) following the instructions here: https://developer.paypal.com/docs/checkout/integration-features/shipping-callback/#c2cb-target-1
The "Pay now" button is still enabled, and no error message shows.
When the onShippingChange(data, actions) fires and a rejected promise is returned return actions.reject(); the UI should show an error message such as "Sorry, we don't ship to that destination" and also disable the "Pay now" button.
window.paypal.version): - 5.0.204See above
@johnpash I have the same issue. We are trying to reject orders from different countries and it's not working anymore.
I am getting a similar issue: other actions work as expected, but actions.reject seems to do nothing anymore. This worked until about a week ago.
Yeah we're now seeing this, this is really bad, it's making it look like customers can order to countries we don't ship to.
I have the same issue. It was work about week ago, but now when I return actions.reject(); from onShippingChange nothing is happens.
Also you can still change summary price by calling actions.order.patch() and it will be updated on PayPal payment page, but seems like actions.reject(); is broken now.
It seems like actions.order.patch calls are buggy too? Before the PayPal modal would display a loading icon with a message saying "Contacting the merchant to update your shipping address.". Now we're not seeing that label, instead the address updates instantly and then a couple of seconds later "Processing..." is shown after which the amount then updates.
It looks like there was some silent progress made on this with version 5.0.206. I guess we just have to keep checking until bugs are fixed? Does anyone at PP monitor these issues? Or do they just wait for the Github sweeper to close old issues?
Ranting aside...
It's now correctly rejecting the country as it has always done before the bug was introduced. But more importantly, the bug still remains where the "Pay now" button is not disabled. This means customers are still able to pay for items destined to undeliverable countries if they choose to ignore the "We don't ship to your destination" message.
@johnpash I have just tested it and I get the same issue. It shows the message that doesn't ship to that location, but the customer is still able to complete the checkout. Looks like PayPal never watches the issues here.
When actions.reject() happens, we send a message to the buyer that the address is not supported, but currently we do not stop the checkout process from continuing. Right now there is a PR out to stop that process and the buyer cannot take further action until they resolve their address choice. This should be the last step in resolving this issue.
Thanks for your patience.
@amaclean2 thanks for the update. It's a little bit concerning that the behaviour changed without notice. So it must have been a bug, and not a feature change? Either way, I await the fix. Thanks again.
The other thing was the parameters in onShippingChange() got out of sync for a few days, but they should be back to what they were before.
@amaclean2 Do you have an update on that PR? I am currently still having the issue that the buyer is not blocked to continue until I resolve onShippingChange.
@christian-reichart , this issue was fixed. I forgot to close it since I'm not an owner of this repo, but what you're talking about sounds like a different issue. If you want to send me an email at [email protected], I can help work you through it.
@amaclean2 Thanks for your reply. I've created a new issue since I realised that my problem differs from this bug.
Would be happy if you could have a look. :)
https://github.com/paypal/paypal-checkout-components/issues/1648
Most helpful comment
It seems like
actions.order.patchcalls are buggy too? Before the PayPal modal would display a loading icon with a message saying "Contacting the merchant to update your shipping address.". Now we're not seeing that label, instead the address updates instantly and then a couple of seconds later "Processing..." is shown after which the amount then updates.