MonetizationEvent.amountSent
The amountSent
attribute of the MonetizationEvent interface returns the amount and currency code of the money that was successfully sent in the last payment.
Value
A dictionary with the same data structure as the PaymentCurrencyAmount dictionary of the Payment Request API.
Examples
<link rel="monetization" href="https://example.com/pay" />
<script>
const link = document.querySelector('link[rel="monetization"]')
link.addEventListener('monetization', (event) => {
// See how much was sent and in what currency
const {
amountSent: { value, currency },
} = event
console.log(`Browser sent ${currency} ${value}.`)
})
</script>
Specifications
Specification |
---|
Web Monetization API #amountsent-attribute |
Browser compatibility
desktop | mobile | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on iOS | Samsung Internet | Puma Browser | |
amountSent | Yes | Yes | Yes | No | Yes | No | No | No | No | No | No | No | Yes |
- Full Support
- No Support
- You'll need to use a Web Monetization Extension