KEMBAR78
Define PaymentResponse.retry() method by marcoscaceres · Pull Request #715 · w3c/payment-request · GitHub
Skip to content

Conversation

@marcoscaceres
Copy link
Member

@marcoscaceres marcoscaceres commented May 21, 2018

part of #705

The following tasks have been completed:

Implementation commitment:

  • Safari (link to issue)
  • Chrome (link to issue)
  • Firefox - currently P3 bug
  • Edge (public signal)

Impact on Payment Handler spec?

Unknown.

Example

This pull request gets us here... the user doesn't yet know what's actually wrong with the payment, but at least they know something is wrong.

async function doPaymentRequest() {
  const request = new PaymentRequest(methodData, details, options);
  const response = await request.show();
  try {
    await recursiveValidate(request, response);
  } catch (err) { // retry aborted.
    console.error(err);
    return;
  }
  await response.complete("success");
}

async function recursiveValidate(request, response) {
  const promisesToFixThings = [];
  const errors = await validate(request, response);
  if (!errors) {
    return;
  }
  await response.retry();
  return recursiveValidate(request, response);
}

doPaymentRequest();

Preview | Diff

@stpeter
Copy link

stpeter commented May 21, 2018

@marcoscaceres Thanks for sketching this out - I like where it's going.

@marcoscaceres marcoscaceres changed the title WIP: retry() shell Define paymentResponse.retry() method May 22, 2018
@marcoscaceres marcoscaceres requested a review from domenic May 22, 2018 05:08
@marcoscaceres
Copy link
Member Author

@domenic, this puts in place the .retry() model, but without the validation errors (#712), or all the eventing infrastructure that is needed.

To keep the pull requests reasonable in size, I'm sending these parts incrementally.

@marcoscaceres
Copy link
Member Author

Blocked on #712.

@marcoscaceres
Copy link
Member Author

Started writing tests so found some bugs (yay! "the system works").

@marcoscaceres marcoscaceres changed the title Define paymentResponse.retry() method Define PaymentResponse.retry() method May 22, 2018
marcoscaceres added a commit to web-platform-tests/wpt that referenced this pull request May 22, 2018
@marcoscaceres
Copy link
Member Author

Tests: web-platform-tests/wpt#11101

@marcoscaceres
Copy link
Member Author

Added link to related Gecko bug.

@marcoscaceres
Copy link
Member Author

Trying a different way... will send again.

marcoscaceres added a commit to web-platform-tests/wpt that referenced this pull request Jun 18, 2018
marcoscaceres added a commit to web-platform-tests/wpt that referenced this pull request Jun 26, 2018
marcoscaceres added a commit to web-platform-tests/wpt that referenced this pull request Jul 3, 2018
marcoscaceres added a commit to web-platform-tests/wpt that referenced this pull request Jul 16, 2018
marcoscaceres added a commit to web-platform-tests/wpt that referenced this pull request Aug 13, 2018
* Add tests for PaymentResponse.retry()

* Tests for w3c/payment-request#715

* wip

* remove unnecessary comment

* test retry() rejects if doc not fully active

* Provide better instructions

* fix copy/pasta

* test 'abort the update'

* Calling retry() multiple times is always a new object.

* Generalize test for retry and complete
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Aug 15, 2018
…=testonly

Automatic update from web-platform-testsAdd tests for PaymentResponse.retry() (#11101)

* Add tests for PaymentResponse.retry()

* Tests for w3c/payment-request#715

* wip

* remove unnecessary comment

* test retry() rejects if doc not fully active

* Provide better instructions

* fix copy/pasta

* test 'abort the update'

* Calling retry() multiple times is always a new object.

* Generalize test for retry and complete

--

wpt-commits: 2f996e750b6bf5c6c64b693aca154198241ae9e5
wpt-pr: 11101
jankeromnes pushed a commit to jankeromnes/gecko that referenced this pull request Aug 15, 2018
…=testonly

Automatic update from web-platform-testsAdd tests for PaymentResponse.retry() (#11101)

* Add tests for PaymentResponse.retry()

* Tests for w3c/payment-request#715

* wip

* remove unnecessary comment

* test retry() rejects if doc not fully active

* Provide better instructions

* fix copy/pasta

* test 'abort the update'

* Calling retry() multiple times is always a new object.

* Generalize test for retry and complete

--

wpt-commits: 2f996e750b6bf5c6c64b693aca154198241ae9e5
wpt-pr: 11101
@marcoscaceres
Copy link
Member Author

.retry() API support landed in Firefox Nightly 🎉 (though the payments UI doesn't yet support it... but still 🎊 )

gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
…=testonly

Automatic update from web-platform-testsAdd tests for PaymentResponse.retry() (#11101)

* Add tests for PaymentResponse.retry()

* Tests for w3c/payment-request#715

* wip

* remove unnecessary comment

* test retry() rejects if doc not fully active

* Provide better instructions

* fix copy/pasta

* test 'abort the update'

* Calling retry() multiple times is always a new object.

* Generalize test for retry and complete

--

wpt-commits: 2f996e750b6bf5c6c64b693aca154198241ae9e5
wpt-pr: 11101

UltraBlame original commit: 2b2c564b2e13accaa97fff7dd8264904c641bc77
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 3, 2019
…=testonly

Automatic update from web-platform-testsAdd tests for PaymentResponse.retry() (#11101)

* Add tests for PaymentResponse.retry()

* Tests for w3c/payment-request#715

* wip

* remove unnecessary comment

* test retry() rejects if doc not fully active

* Provide better instructions

* fix copy/pasta

* test 'abort the update'

* Calling retry() multiple times is always a new object.

* Generalize test for retry and complete

--

wpt-commits: 2f996e750b6bf5c6c64b693aca154198241ae9e5
wpt-pr: 11101

UltraBlame original commit: 2b2c564b2e13accaa97fff7dd8264904c641bc77
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
…=testonly

Automatic update from web-platform-testsAdd tests for PaymentResponse.retry() (#11101)

* Add tests for PaymentResponse.retry()

* Tests for w3c/payment-request#715

* wip

* remove unnecessary comment

* test retry() rejects if doc not fully active

* Provide better instructions

* fix copy/pasta

* test 'abort the update'

* Calling retry() multiple times is always a new object.

* Generalize test for retry and complete

--

wpt-commits: 2f996e750b6bf5c6c64b693aca154198241ae9e5
wpt-pr: 11101

UltraBlame original commit: 2b2c564b2e13accaa97fff7dd8264904c641bc77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants