8000 [Spec] Add support for a 'details' string for PaymentCredentialInstrument by stephenmcgruer · Pull Request #298 · w3c/secure-payment-confirmation · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Spec] Add support for a 'details' string for PaymentCredentialInstrument #298

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
8000

Conversation

stephenmcgruer
Copy link
Collaborator
@stephenmcgruer stephenmcgruer commented May 21, 2025

This change adds the ability for the SPC caller to specify a short additional detail string for the PaymentCredentialInstrument. This allows for a richer UX, e.g. in the world of cards one could
specify a rich 'product' name for the displayName, and then add the last-four digits and expiry
in details:

displayName=Fancy Bank Platinum Card
details=****1234 01/26

Tasks:

  • Chromium bug for implementation
  • WPT tests added/updated

Preview | Diff

…ment

This change adds the ability for the SPC caller to specify a short
additional detail string for the PaymentCrednetialInstrument. This
allows for a richer UX, e.g. in the world of cards one could specify
a rich 'product' name for the displayName, and then add the last-four
digits and expiry in details:

displayName=Fancy Bank Platinum Card
details=****1234 01/26
@stephenmcgruer
Copy link
Collaborator Author

cc @darwinlyang

@stephenmcgruer stephenmcgruer requested a review from pejic May 21, 2025 18:02
@@ -384,7 +384,8 @@ const request = new PaymentRequest([{
challenge: new Uint8Array([21,31,105 /* 29 more random bytes generated by the bank */]),

instrument: {
displayName: "Fancy Card ****1234",
displayName: "FancyBank Platinum Card",
details: "****1234 | 01/29",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open question: is details a good name here? Should we call it displayDetails?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no strong feeling about the name. I note below that you wrote "Optional additional detail string" so another name idea is 'additionalDetails'.

@@ -1243,6 +1248,7 @@ The following data structures are shared between registration and authentication
required USVString displayName;
required USVString icon;
boolean iconMustBeShown = true;
USVString details;
Copy link
Collaborator Author
@stephenmcgruer stephenmcgruer May 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an alternate approach, we could instead extend the existing displayName concept, into:

dictionary PaymentCredentialInstrument {
  required (USVString or PaymentCredentialInstrumentDetails) displayName;
  required USVString icon;
  boolean iconMustBeShown = true;
}

dictionary PaymentCredentialInstrumentDetails {
  required USVString primaryDetails;
  USVString secondaryDetails;  // maybe required?
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would then write this like:

const instrument = {
  displayName: {
    primaryDetails: "FancyBank Platinum Card",
    secondaryDetails: "**** 1234 | 01/27",
  },
  icon: ...
};

@stephenmcgruer stephenmcgruer requested a review from ianbjacobs May 21, 2025 18:07
@stephenmcgruer
Copy link
Collaborator Author
8000

Note: This enables a UX such as shown in this Chrome mock:

image

@@ -384,7 +384,8 @@ const request = new PaymentRequest([{
challenge: new Uint8Array([21,31,105 /* 29 more random bytes generated by the bank */]),

instrument: {
displayName: "Fancy Card ****1234",
displayName: "FancyBank Platinum Card",
details: "****1234 | 01/29",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no strong feeling about the name. I note below that you wrote "Optional additional detail string" so another name idea is 'additionalDetails'.

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

Successfully merging this pull request may close these issues.

2 participants
0