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

Consider revising the design of complete() #122

Closed
adrianhopebailie opened this issue Apr 4, 2016 · 3 comments
Closed

Consider revising the design of complete() #122

adrianhopebailie opened this issue Apr 4, 2016 · 3 comments

Comments

@adrianhopebailie
Copy link
Collaborator

In TAG review @triblondon said:

paymentRequest.complete feels slightly weird, and I'm wondering why the merchant page does not instead receive an unresolved promise that it can resolve or reject. That would seem more aligned with the use of promises elsewhere.

@adrianhopebailie
Copy link
Collaborator Author

complete() was addressed in PR #161 but this specific issue was not dealt with. A proposal is required to address this and other comments made in the PR

@adrianhopebailie adrianhopebailie added this to the Discuss on Call - 5 May milestone Apr 28, 2016
@adamroach
Copy link
Contributor

The existing design calls for three possible values here (success, failure and a third state representing "unknown"). That doesn't map well into the binary success/failure model that Promises provide, and the point of PR #163 was to expand from two choices into three.

While I agree that Promise would be a better choice if we could guarantee that the web page knows the success status, moving in this direction seems to reintroduce an already-solved problem. Perhaps we could include information in the resolution case to distinguish between "success" and "unknown"? It seems somewhat inelegant, but better than what we have now.

@dlongley
Copy link

dlongley commented May 4, 2016

We could resolve a promise with a status (success being one ... and this unknown or whatever else being other options) -- or reject it with an error.

adrianba added a commit to adrianba/browser-payment-api that referenced this issue May 11, 2016
I don't think we should make any further changes related to w3c#122 for
now. It's hard to make a trinary value fit into the promises model in an
obvious way.

We should be clear on what to do with unrecognised values to allow us to
add new ones in future.

Closes w3c#122.
@adrianhopebailie adrianhopebailie modified the milestones: 12 May, 5 May May 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants