Re: [w3c/payment-request] Merchant validation (#646)

```javascript
await canMakePayment = PaymentRequest.canMakePayment(methodData);
const pr = new PaymentRequest({
  supportedMethod: "apple-pay", 
});
pr.canMakePayment();
pr.addEventListener('merchantvalidation', (evt) => {
  evt.complete(new Promise((resolve, reject) => {
     return fetch(severUrl + evt.merchantValidationUrl).then((r) => r.text());
  });
});
response = await pr.show(promise(someOtherDetails)); 
let paymentMethod = response.methodName;
try {
  response = await response.complete("retry", {"errorField": "postalCode"});
} catch (error) {
  console.log('retry rejected');
  if (isPush(paymentMethod)) { /* custom logic */ }
}
```


```javascript
registration.paymentManager.retryable = false;
registration.paymentManager.userHint = '$$$';
registration.payentManager.instruments.set(/* ... */);
```

-- 
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/payment-request/issues/646#issuecomment-342641012

Received on Tuesday, 7 November 2017 22:15:16 UTC