- From: Rouslan Solomakhin <notifications@github.com>
- Date: Mon, 08 Aug 2016 10:56:43 -0700
- To: w3c/browser-payment-api <browser-payment-api@noreply.github.com>
Received on Monday, 8 August 2016 21:25:11 UTC
We can also add validation errors to `PaymentDetails`, so that merchant can notify the browser during `shippingaddresschange` event.
```javascript
payment.addEventListener('shippingaddresschange', function(evt) {
evt.updateWith(new Promise(function(resolve) {
if (payment.shippingAddress.postalCode === '99999') {
details.validationErrors = [{field: 'postalCode', message: 'Example site does not support shipping to postal code 9999'}];
} else {
delete details.validationErrors;
}
resolve(details);
}));
});
```
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/browser-payment-api/issues/225#issuecomment-238322087
Received on Monday, 8 August 2016 21:25:11 UTC