Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'PaymentCurrencyAmount' Dictionary #16

Closed
adrianhopebailie opened this issue Oct 14, 2019 · 5 comments
Closed

Use 'PaymentCurrencyAmount' Dictionary #16

adrianhopebailie opened this issue Oct 14, 2019 · 5 comments
Labels
spec debt

Comments

@adrianhopebailie
Copy link
Collaborator

adrianhopebailie commented Oct 14, 2019

From web-monetization created by adrianhopebailie: adrianhopebailie/web-monetization#11

The PaymentCurrencyAmount dictionary is already defined for exchanging currencies and amounts via Web APIs and is used extensively in the Payment Request API.

We should consider changing the monetizationprogress event to use this type instead of amount, asset_code and asset_scale.

@sidvishnoi
Copy link
Contributor

sidvishnoi commented Jan 11, 2021

Also, if I remember correctly, WebIDL doesn't allow using a dictionary as an interface member. So, we can't really reuse it by replacing assetScale etc. Following would be invalid WebIDL:

interface MonetizationProgressEvent : Event {
  constructor(DOMString type, MonetizationProgressEventInit eventInitDict);
  readonly attribute PaymentCurrencyAmount amount; // <- invalid
  readonly attribute DOMString? receipt;
};

We can however use it in MonetizationProgressEventInit (i.e., only in constructor).

@marcoscaceres
Copy link
Contributor

marcoscaceres commented Jul 29, 2021

Sid is right in that it a dictionary can't be used for an attribute. I'd be inclined to close this and keep the current API shape.

@sublimator
Copy link
Collaborator

sublimator commented Dec 6, 2021

@marcoscaceres

edit: re: #193 (comment)

@sublimator
Copy link
Collaborator

sublimator commented Dec 6, 2021

Would a new "class" have to be created ? i.e. something not a dictionary ? Whatever that is

@marcoscaceres
Copy link
Contributor

marcoscaceres commented Dec 7, 2021

Filed #240 ... we can discuss there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec debt
Projects
None yet
Development

No branches or pull requests

4 participants