Nw.js: PaymentRequest API not supported

Created on 2 May 2018  路  2Comments  路  Source: nwjs/nw.js

NWJS Version : 0.30.2
Operating System : MacOS

Expected behavior

Dialog for PaymentRequest API should show up when calling request.show() for the supported browser - in this case, latest Chromium version (request is an PaymentRequest object)

Actual behavior

Error in console: DOMException: Request cancelled

How to reproduce

Sample code:

<!DOCTYPE html>
<html>
  <head>
    <title>Payment app</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  </head>
  <body>
    <pre id="output"></pre>
    <script>
        var methodData = [
          {
            supportedMethods: ['basic-card'],
            data: {
              supportedNetworks: ['visa', 'mastercard', 'amex'],
              supportedTypes: ['credit']
            }
          }
        ];

        var details =  {
          displayItems: [
            {
              label: "Sub-total",
              amount: { currency: "USD", value : "100.00" }, // US$100.00
            }
          ],
          total:  {
            label: "Total due",
            amount: { currency: "USD", value : "100.00" }, // US$109.00
          }
        };

        var options = {
          requestShipping: false
        };

        var request=new PaymentRequest(methodData, details, options);
        request.show().then(console.log).catch(console.err);
    </script>
  </body>
</html>

Error:

image

P2 bug triaged

All 2 comments

I can reproduce this issue on Linux/Windows/Mac with nwjs-sdk-v0.30.2. The dialog doesn't popup, and DOMException: Request cancelled is displayed in the console.

This is fixed in git and will be available in the next nightly build.

Was this page helpful?
0 / 5 - 0 ratings