Monetization interfaces
Web Monetization API
The Web Monetization API consists of two interfaces: MonetizationEvent
and MonetizationCurrencyAmount
.
MonetizationEvent
The MonetizationEvent
interface describes the monetization
event that fires when an outgoing payment is successfully created.
Bubbles | Yes |
---|---|
Cancelable | No |
Event handler property | onmonetization |
By listening for monetization
events, you can use the information returned in the following properties to verify payments.
- amountSent - The currency amount and code of the sent payment. Contains two variables,
value
andcurrency
, constructed by theMonetizationCurrencyAmount
interface. - incomingPayment - A URL you can use to determine if a payment was received and, if so, the amount received.
- paymentPointer - The URL of the payment pointer or wallet address that the incoming payment request was sent to.
Visit the Monetization Events page for more information.
Specifications
Specification |
---|
Web Monetization #monetizationevent-interface |
MonetizationCurrencyAmount
The MonetizationCurrencyAmount
interface is used to populate the value
and currency
variables contained within the MonetizationEvent amountSent
property.
- Value - The amount. A valid decimal monetary value containing the amount that was sent.
- Currency - The currency code. A well-formed 3-letter ISO4217 code that represents the currency that was sent, such as USD or GBP.
The MonetizationCurrencyAmount
interface is modeled on the Payment Request API’s PaymentCurrencyAmount
dictionary.
Specifications
Specification |
---|
Web Monetization #monetizationcurrencyamount-interface |