web-monetization-extension
web-monetization-extension copied to clipboard
Expose `MonetizationCurrencyAmount`
Spec says it's exposed on Window.
Also, make sure amountSent is an instance of MonetizationCurrencyAmount.
On a second thought, I think it should not be exposed to Window (spec bug). If MonetizationCurrencyAmount maps directly to PaymentCurrencyAmount, why it's an interface and not a dictionary like PaymentCurrencyAmount?
If MonetizationCurrencyAmount maps directly to PaymentCurrencyAmount, why it's an interface and not a dictionary like PaymentCurrencyAmount?
Yeah, I agree as well. I do not see any point in exposing this to Window as long as its only use is for the event.
This then also makes me wonder if it is needed at all. The amountSent member of the MonetizationEventInit dictionary already directly references PaymentCurrencyAmount. I don't know what the best practice is here, but maybe we could just remove the definition within the Web Monetization spec?
Can you transfer this issue to the spec repo? Or should I create a new one?
We cannot use a dictionary as the attribute type of a member in an interface (here MonetizationEvent) - WebIDL prohibits it.
Even if the definition was same as PaymentCurrencyAmount, the interface still needs to be there.
But I'm considering if it can be an internal interface - not exposed to Window, and if that can cause issues.