MonetizationEvent
The MonetizationEvent
DOM events provide information about payments sent to Web Monetization receivers.
The monetization
event fires when a Web Monetization agent successfully creates an outgoing payment request at the Web Monetization provider. There’s no guarantee that any payments will follow or, if they do, how often or how large the payments will be.
By listening for monetization
events, you can use the returned details to verify the receipt of a payment. You can then choose to have the page programmatically respond to successful payments. For example, you could remove ads or provide access to exclusive content.
Bubbles | Yes |
---|---|
Cancelable | No |
Interface | MonetizationEvent |
Event handler property | onmonetization |
Current attributes
- amountSent - Returns the amount and currency code of the sent payment
- incomingPayment - Returns the incoming payment URL
- paymentPointer - A URL representing the payment pointer endpoint
Deprecated attributes
- amount - An integer amount delivered by an Interledger packet
- assetCode - A string representing the currency code of the received amount
- assetScale - The scale of the received amount
- receipt - The base-64 encoded Interledger STREAM receipt that the browser received
Example
Specifications
Specification |
---|
Web Monetization #monetizationevent-interface |