#changmin-shippingaddresschange-apple-google-pay

1 messages · Page 1 of 1 (latest)

tardy flume
#

Hello 👋

azure sorrel
#

Hi Hanzo, Thank you for your help

#

is there anyway to trigger the shippingaddresschange with the event has updatewith()?

tardy flume
#

Let me check
curious if there's a reason behind why you'd want to trigger it manually

azure sorrel
#

Becaues only 'shippingaddresschange' and 'shippingoptionchange' has updatewith()

#

Sometimes we partial update our page, then need to update the pop detail items.

#

I know there is another function paymentRequest.update(), but this can only update before the popup showing

tardy flume
#

ah okay. Looking into workarounds but highly doubt that it is supported.

azure sorrel
#

Ok, thank you

#

paymentRequest.update() always has this problem
'You cannot update Payment Request options while the payment sheet is showing.'

#

SO I can only use updatewith()

#

event.updateWith()

tardy flume
#

hmm not seeing any alternatives here

#

You'd really just want to close the paymentsheet before making any changes and handle them with paymentRequest.update()

azure sorrel
#

yes, I mean,the first time I open the popup, 'shippingaddresschange' triggered automatically, but then, second time when we partial update our page and open it again, the 'shippingoptionchange' not triggerd, so I cannot use updateWith(), I can only use update(), that means I need to keep 2 methods to update.

paymentRequest.update() can only use before the paymentRequest.show(), that means I need to event.preventDefault() at very first.

and warning shows like this

tardy flume
#

AFAIK shippingoptionchange is triggered by the payment sheet changes and cannot work with manual triggers.

azure sorrel
#

the same with shippingaddresschange, right?

tardy flume
#

yup

azure sorrel
#

and updatewith() can only working with this 2 event, no other object can call updatewith()?

tardy flume
#

That's correct

azure sorrel
#

paymentRequest.update() can only use before the paymentRequest.show(), that means I need to event.preventDefault() at very first. right?

tardy flume
#

Technically, you can use paymentRequest.update() when the payment sheet isn't showing

azure sorrel
#

how to know the payment sheet showing or not if I don't use the paymentRequest.show()?

#

because the console return 'Do not call show() yourself if you are using the paymentRequestButton Element. The Element handles showing the payment sheet.'

#

is this a fatal warning ?