stripe-react-native icon indicating copy to clipboard operation
stripe-react-native copied to clipboard

Updating Shipping Options After Presenting Apple Pay screen on the basis of Address

Open NoisyBoyII opened this issue 4 years ago • 3 comments

We want to call our api when ever user select the address on Apple Pay on the basis of that we want to update our shipping options. This is the code

const { presentApplePay, confirmApplePayPayment, isApplePaySupported } = useApplePay({ onShippingContactSelected: (shippingContact, handler) => { console.log('shippingContact', shippingContact); // We call our api and get the shipping options from shippingContact but we don't have anything to update the options here on handler handler(cart); }, }); When ever we update the shipping address the handler is returning out null or empty. I have traced this function back to stripe sdk but i think it is not implemented, please see these screenshots.

Stripe Version : 0.2.2 Screenshot 2021-10-28 at 10 06 37 PM

Screenshot 2021-10-28 at 10 06 54 PM

NoisyBoyII avatar Oct 28 '21 16:10 NoisyBoyII

When testing the most recent version, the handler param from onShippingContactSelected seems to be working correctly.

When ever we update the shipping address the handler is returning out null or empty.

The handler returns an optional error field, so it's expected to return null when successful.

Let me know if that doesn't answer your question! Happy to try and help further

charliecruzan-stripe avatar Jun 01 '22 20:06 charliecruzan-stripe

@charliecruzan-stripe I think what @NoisyBoyII was asking, and the issue I am also having is that:

When the ApplePay sheet is opened, and the user selects a new ShippingAddress, we would like a way to update the ShippingMethods, for instance when shipping to a different country the shipping methods change.

Right now onShippingContactSelected handler just updates the summary items, and it's the same with onShippingMethodSelected, there is no way to update the ApplePay sheet, once it has been opened.

p-sebastian avatar Jul 20 '22 13:07 p-sebastian

I see, thanks for the clarification! We can add that I believe

charliecruzan-stripe avatar Jul 20 '22 16:07 charliecruzan-stripe