Skip to main content

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

Browser compatibility