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

marcoscaceres 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();

Ah yeah, good catch :) The joys of coding examples without the implementation 💃 

-- 
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

Received on Friday, 2 December 2016 07:02:40 UTC