CanMakePaymentEvent Class

The event fired at the service worker of a payment handler to ask whether it can make a payment (https://w3c.github.io/web-based-payment-handler/#the-canmakepaymentevent). The library never fires it: an event created by a script cannot be answered.

public sealed class CanMakePaymentEvent : ExtendableEvent
Inheritance
ExtendableEvent CanMakePaymentEvent

Constructors

NameDescription
CanMakePaymentEvent(string)Creates an event.

CanMakePaymentEvent(string)

PaymentHandler.cs

Creates an event.

public CanMakePaymentEvent(string type)

Methods

NameDescription
RespondWith(Task<bool>)Answers whether the payment handler can make the payment (https://w3c.github.io/web-based-payment-handler/#dom-canmakepaymentevent-respondwith). Throws an InvalidStateError DomException when the event is not trusted, is not being dispatched or was already answered.

RespondWith(Task<bool>)

PaymentHandler.cs

Answers whether the payment handler can make the payment (https://w3c.github.io/web-based-payment-handler/#dom-canmakepaymentevent-respondwith). Throws an InvalidStateError DomException when the event is not trusted, is not being dispatched or was already answered.

public void RespondWith(Task<bool> canMakePaymentResponse)