w3c / payment-request

Payment Request API
https://www.w3.org/TR/payment-request-1.1/
Other
482 stars 183 forks source link

Expected behaviours: paymentmethodchange event updates with a rejection #898

Closed maxlgu closed 4 years ago

maxlgu commented 4 years ago

What's the expected behaviours should be if the paymentmethodchange event updates with a rejection? The following snippet demonstrates this scenario:

request.addEventListener('paymentmethodchange', (event) => { event.updateWith(Promise.reject('Error for test')); });

maxlgu commented 4 years ago

CC @rsolomakhin

rsolomakhin commented 4 years ago

According to the ancient sacred texts (https://rsolomakhin.github.io/pr/ko/reject-update/):

When the merchant request shipping, but responds to shipping address change by rejecting the update promise, which should cancel payment request.

Let's do the same for payment method change event.

maxlgu commented 4 years ago

I guess that mean the PH UI should be closed as well?

rsolomakhin commented 4 years ago

@maxlgu

I guess that mean the PH UI should be closed as well?

Yes, cancelling the payment request should close the PH UI.

marcoscaceres commented 4 years ago

@rsolomakhin, so this is not covered in the spec?

marcoscaceres commented 4 years ago

Reading update a PaymentRequest's details algorithm ... I think we are ok here.

Upon rejection of detailsPromise: Abort the update with request and an "AbortError" DOMException.

Which:

"Abort the current user interaction and close down any remaining user interface."

marcoscaceres commented 4 years ago

Ok, cool.. closing. @maxlgu does the above make sense? Or did we miss something?

maxlgu commented 4 years ago

That answers my question. Thanks!