#uvid
1 messages · Page 1 of 1 (latest)
Hi
Can you share more details about this please ?
what problems you are facing exactly ?
Hi, there has e simple demo
paymentRequest.on('shippingaddresschange', async event => {
const { shippingAddress, updateWith } = event
updateWith({
status: 'success',
shippingOptions: [], // it should be reset in some case
});
})
But actually here it throws error
When requesting shipping information, you must specify shippingOptions once a shipping address is selected
The code you are sharing is a listener for shippingaddresschange event. But according to the error you need to set shippingOptions because you are requesting shipping information. And it looks like you are passing none.
According to the official documentation, shippingOptions can be updated in this listener.
But it seems that once the shippingOptions is empty, it will cause an error. Can this value be empty?
Yes so you need to set none empty Options
I need to clear the shippingOptions in some specific scenarios
You need to set always a value as you are settingrequestShipping: true