PaymentRequest

open class PaymentRequest(    methodData: ReadonlyArray<PaymentMethodData>,     details: PaymentDetailsInit,     options: PaymentOptions = definedExternally) : EventTarget(source)

The Payment Request API's PaymentRequest interface is the primary access point into the API, and lets web content and apps accept payments from the end user on behalf of the operator of the site or the publisher of the app. Available only in secure contexts.

MDN Reference

Constructors

Link copied to clipboard
constructor(methodData: ReadonlyArray<PaymentMethodData>, details: PaymentDetailsInit, options: PaymentOptions = definedExternally)

Properties

Functions

Link copied to clipboard
suspend fun abort()

The PaymentRequest.abort() method of the PaymentRequest interface causes the user agent to end the payment request and to remove any user interface that might be shown.

Link copied to clipboard
Link copied to clipboard
suspend fun canMakePayment(): Boolean

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 user agent.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun show(detailsPromise: PromiseLike<PaymentDetailsUpdate>): PaymentResponse

suspend fun show(detailsPromise: PaymentDetailsUpdate = definedExternally): PaymentResponse

The PaymentRequest interface's show() method instructs the user agent to begin the process of showing and handling the user interface for the payment request to the user.

Link copied to clipboard
Link copied to clipboard