- From: Marcos Cáceres <notifications@github.com>
- Date: Mon, 14 Aug 2017 20:41:53 -0700
- To: w3c/payment-request <payment-request@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 15 August 2017 03:42:17 UTC
The above beautifully distills down to:
```JS
async function doPaymentRequest() {
const payResponse = await new PaymentRequest(methods, details).show();
let result = "unknown";
try {
const httpResponse = await fetch("/buy", {
method: "POST",
headers: new Headers({ "Content-Type": "application/json" }),
body: payResponse.toJSON(),
});
result = httpResponse.ok ? "success" : "fail";
} catch (err) {
console.error(err);
} finally {
payResponse.complete(result);
}
}
```
--
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/576#issuecomment-322369608
Received on Tuesday, 15 August 2017 03:42:17 UTC