PayPal UI does not block "Continue" button until onShippingChange is resolved

fullstackdev00
New Community Member

I have the same problem with this github issue.

Describe the Bug

When working with PayPal Express checkout, I want to use onShippingChange to determine if shipping costs need to be updated or shipping is not possible after the user has changed their address. While I'm processing the shipping change on my site, the "Continue" button in the PayPal overlay is not blocked, meaning the user can click continue and return to my site with any selected address.

I've implemented it looking at this documentation: https://developer.paypal.com/docs/checkout/integration-features/shipping-callback/ , where a fetch is returned and the request is resolved or rejected in the callback.

🔬 Minimal Reproduction

Here is a simple code example on how I am testing this:

onShippingChange (data, actions) {
  return new Promise(resolve => setTimeout(resolve, 5000)).then(
    res => {
      return actions.reject();
    },
  );
}

😕 Actual Behavior

The UI on PayPal is not blocked, meaning the users can click continue immediately after changing their address. After 5 seconds the error is shown that the shipping address is not supported and the continue button doesn't do anything (because of the 5 second reject in the example above).

🤔 Expected Behavior

PayPal should show a loading spinner overlaying the whole interface until onShippingChange is resolved or rejected.

 

Has anyone solved this?

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.