naoufal/react-native-payments

Updating payment wizzard after init [Apple pay]

GFean opened this issue · 1 comments

GFean commented

I have such case in my app :
I'm using both shipping address & shipping options. Shipping Options depend on the shipping address of the user, so before initialisation I have no idea which address does user have in his apple pay account and therefore can't shipping options should be set after the initialisation of the wizzard, according to shipping address. Package supports adding event listener on change this does work, but only when something changes. Is there any way to trigger an update after init of the wizzard ?
Thanks a lot !

Setting paymentRequest._shippingAddressChangesCount = 1 before displaying the sheet will trigger a shippingaddresschange event that you can use for that purpose