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

Support for Abort() being delegated to Payment Handler #117

Open
mattsaxon opened this issue Mar 24, 2017 · 12 comments
Open

Support for Abort() being delegated to Payment Handler #117

mattsaxon opened this issue Mar 24, 2017 · 12 comments
Milestone

Comments

@mattsaxon
Copy link

In PaymentRequest, the statement "A user agent might not always be able to abort a request. For example, if the user agent has delegated responsibility for the request to another app. In this situation, abort() will reject the returned Promise."

Can the abort be delegated to a payment handler interface such that this statement invalid?

@rsolomakhin
Copy link
Collaborator

Let's make this only optional, please.

@mattsaxon
Copy link
Author

I think they would be fine, especially if this linked in with the state model such that when the status is 'processing' that calling abort() results in an exception. I could see additional states in his state model e.g. Interactive->pre-processing->processing which could more clearly specify the behaviour and set better expectations for users of the API.

@mattsaxon
Copy link
Author

Related to Issue 473 in PR

@adrianhopebailie
Copy link
Contributor

Per discussion on the Payment Apps TF call:

  • We can't provide any guarantees that, once a payment request is delegated beyond the browser, it can be aborted. Web-based payment apps are only one type of app.
  • We can improve the Payment Handler specification to include a mechanism of passing the abort request to a web-based payment app.

Proposal

Add a paymentRequestAborted event to the Payment Handler interface. The event will have a respondWith method that takes a boolean parameter indicating if the paymentRequest has been successfully aborted.

@ianbjacobs ianbjacobs added this to the Mark in FPWD milestone Apr 4, 2017
@rsolomakhin
Copy link
Collaborator

I've head support for this from payment app developers. There should be no expectation of rolling back or refunding a transaction in progress if .abort() is called, however.

@ianbjacobs
Copy link
Contributor

Thanks Rouslan. As we discussed at the 23 May call [1], the sense I have is that an event (such as Adrian's proposal) would be a signal from the merchant, and the payment app could behave in a variety of ways (depending on payment method, status of payment, etc.) and inform the site of the outcome.

[1] https://www.w3.org/2017/05/23-apps-minutes#item08

@rsolomakhin
Copy link
Collaborator

Happy to review any pull requests.

@ianbjacobs
Copy link
Contributor

@adrianhopebailie, would you be willing to write up a pull request with your proposal? See notes from the 6 June apps task force call. Thanks!

Ian

@rsolomakhin
Copy link
Collaborator

I sketched a quick proposal in pull request #170.

@adrianhopebailie
Copy link
Contributor

@rsolomakhin beat me to it! Thanks Rouslan

@ianbjacobs
Copy link
Contributor

Moved to a new pull request:
#207

Per discussion on 29 August, we are awaiting more implementation experience.

[1] https://www.w3.org/2017/08/29-apps-minutes.html#item03

@ianbjacobs
Copy link
Contributor

After feedback from @marcoscaceres and further discussion with @rsolomakhin,
@rsolomakhin will close pull request #207 and submit a new one limited to what happens in the payment handler API. Separately, @rsolomakhin will propose a change to Payment Request where, as part of the abort() algorithm, if a payment handler has been selected by the user, the browser fires the relevant payment handler event for that payment handler.

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

No branches or pull requests

4 participants