Re: [w3c/browser-payment-api] editorial: clarify examples (#329)

adrianba commented on this pull request.



>  
-    payment.show().then(function(paymentResponse) {
-      // Process paymentResponse
-      // paymentResponse.methodName contains the selected payment method
-      // paymentResponse.details contains a payment method specific response
-      paymentResponse.complete("success");
-    }).catch(function(err) {
-      console.error("Uh oh, something bad happened", err.message);
-    });
-  </pre>
+        async function doPaymentReqest () {
+          const payment = new PaymentRequest(methodData, details, options);
+          payment.addEventListener("shippingaddresschange", event =&gt; {
+              // Process shipping address change
+          });
+          const paymentResponse = await payment.show();

Doesn't this need to be inside the try block?

-- 
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/pull/329#pullrequestreview-10636851

Received on Wednesday, 30 November 2016 17:49:29 UTC