w3c / w3c/payment-request

Proposal to add more details to shopping cart contents and shipping option descriptions

Open
#761 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

  1. We would like to add ability to specify shopping cart content images in Payment Request.
  2. We would like to add ability to specify both the primary and the second label for shipping options. This would allow distinguishing between the shipping speed ("2-day") and the expected delivery date ("Sunday, May 5").

For example:

new PaymentRequest(paymentMethods, {
  total: {label: "Total", amount: {currency: "USD", value: "50"}},
  displayItems: [{
    label: "Hat",
    icons: [{
      src: "hat64.webp",
      sizes: "64x64",
      type: "image/webp"
    },{
      src: "hat64.png",
      sizes: "64x64"
    }, {
      src: "hat128.png",
      sizes: "128x128"
    }],
    amount: {currency: "USD", value: "50"}
  }],
  shippingOptions: [{
    id: 'twoday',
    label: '2-day',
    sublabel: 'Sunday, May 2',
    amount: {currency: "USD", value: "0"}
  }]
}, {requestShipping: true});

cc @fengrui129 @zkoch @DurgaTheHutt

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

Start with the Payment Request API specification, focusing on displayItems and shippingOptions in the issue's example. Determine how item images and primary and secondary shipping labels should be represented, then document the proposal's intended behavior and compatibility considerations.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.