PaymentResponse

The PaymentResponse interface of the Payment Request API is returned after a user selects a payment method and approves a payment request. Available only in secure contexts.

MDN Reference

Properties

Link copied to clipboard

The details read-only property of the provides a payment method specific message used by the merchant to process the transaction and determine a successful funds transfer.

Link copied to clipboard

The methodName read-only property of the PaymentResponse interface returns a string uniquely identifying the payment handler selected by the user.

Link copied to clipboard

The payerEmail read-only property of the PaymentResponse interface returns the email address supplied by the user.

Link copied to clipboard

The payerName read-only property of the option is only present when the requestPayerName option is set to true in the options parameter of the A string containing the payer name.

Link copied to clipboard

The payerPhone read-only property of the PaymentResponse interface returns the phone number supplied by the user.

Link copied to clipboard

The requestId read-only property of the the PaymentResponse() constructor by details.id.

Link copied to clipboard

The shippingAddress read-only property of the PaymentRequest interface returns a PaymentAddress object containing the shipping address provided by the user.

Link copied to clipboard

The shippingOption read-only property of the PaymentRequest interface returns the ID attribute of the shipping option selected by the user.

Functions

Link copied to clipboard
suspend fun complete(result: PaymentComplete = definedExternally)

The PaymentRequest method complete() of the Payment Request API notifies the user interface to be closed.

Link copied to clipboard
fun completeAsync(result: PaymentComplete = definedExternally): Promise<Void>
Link copied to clipboard
Link copied to clipboard
suspend fun retry(errorFields: PaymentValidationErrors = definedExternally)

The PaymentResponse interface's retry() method makes it possible to ask the user to retry a payment after an error occurs during processing.

Link copied to clipboard
fun retryAsync(errorFields: PaymentValidationErrors = definedExternally): Promise<Void>
Link copied to clipboard
fun toJSON(): JsAny

The toJSON() method of the PaymentResponse interface is a Serialization; it returns a JSON representation of the PaymentResponse object.

Link copied to clipboard