w3c / w3c/payment-request

Pre Authorization

Open
#633 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Future Candidate Feature
Dominant language
HTML
Stars
510
Forks
139
PR merge metrics
No merged PRs in 30d

Description

Hello,

I reviewed the Payment Request API. In my personal opinion, the PaymentRequest object needs an additional function. The purpose of the function would be to pre-authorize a payment for a specific amount. In the real-world, this situation happens at gas stations. For example, you have to swipe your credit card before you pump your gas. The gas station will pre-authorize that you can make a $100 purchase for example. In the digital world, I have the opinion that this preauthorization story is relevant when you take into consideration smart contracts.

I personally think this API would return a promise and would look something like this:

let paymentRequest = new PaymentRequest(...);
paymentRequest.authorize()
  .then(function(res) {
     // Now call the show function
  })
  .catch(function(ex1) {
    // The amount could not be preauthorized.
  })
;

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The proposal concerns the PaymentRequest object in the Payment Request API; start by reviewing that interface and the existing show() flow, then read the discussion for agreement on pre-authorization semantics. Done means an agreed authorize() API, including its promise behavior and interaction with show(), is specified in the standard.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, payments
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.