canMakePayment method

JSPromise<JSBoolean> canMakePayment()

The PaymentRequest method canMakePayment() determines whether or not the request is configured in a way that is compatible with at least one payment method supported by the .

You can call this before calling PaymentRequest.show to provide a streamlined user experience when the user's browser can't handle any of the payment methods you accept.

For instance, you might call canMakePayment() to determine if the browser will let the user pay using Payment Request API, and if it won't, you could fall back to another payment method, or offer a list of methods that aren't handled by Payment Request API (or even provide instructions for paying by mail or by phone).

Implementation

external JSPromise<JSBoolean> canMakePayment();