← Topic directory

Payments

Checkout on the web: the Payment Request and Payment Handler APIs and secure payment confirmation.

68 features tagged with this topic.

Cross-browser consensus

Features by stage

Enabled by default (31)

Allow for WebAuthn credential creation in a cross-origin iframe

This feature allows web developers to create WebAuthn[0] credentials (that is, "publickey" credentials, aka passkeys) in cross-origin iframes. Two conditions are required for this new ability: 1. The iframe has a publickey-credentials-create-feature permission policy. 2. The iframe has transient user activation. This will allow developers to create passkeys in embedded scenarios, such as after an identity step-up flow where the Relying Party is providing a federated identity experience. [0]: https://w3c.github.io/webauthn/

Also tagged: Privacy & Identity Security & Authentication

Allow Navigator.registerProtocolHandler to register "payto"

Explainer A unified URI scheme for all payment target types allows applications to offer user interactions with URIs that represent payment targets, simplifying the introduction of new payment systems and applications. Specification RFC 8905 Summary Add "payto" to the list of protocols available for registration via registerProtocolHandler(). The Payto scheme is described in RFC 8905 but not adapted in the safelisted scheme list. To support this RFC Independent Submission (ISSN: 2070-1721) it will be great to adapt it.

Allow PaymentRequest.show() to take optional detailsPromise

Some merchant sites may not know the total or line items at the time of attempting to open the payment sheet with show(). This feature is a way to signal that the browser should show a spinner or equivalent and wait on allowing end user interaction until an update.

Android Payment Apps

Web payments is a W3C standard API for e-commerce websites to collect payment information from users with user consent. This feature lets users pay using native Android payment apps.

Capability Delegation

Capability delegation means allowing a frame to relinquish its ability to call a restricted API and transfer the ability to another (sub)frame it trusts. If an app wants to delegate its ability to call a restricted JS capability (e.g. popups, fullscreen, etc) to a known+trusted third-party frame, the app would utilize a Capability Delegation API to "transfer" the ability to the target frame in a time-constrained manner (unlike static mechanisms like <iframe allow> attributes).

Also tagged: Privacy & Identity Security & Authentication

CSP hash reporting for scripts

Complex web application often need to keep tabs of the subresources that they download, for security purposes. In particular, upcoming industry standards and best practices (e.g. PCI-DSS v4) require that web applications keep an inventory of all the scripts they download and execute. This feature builds on CSP and the Reporting API to report the URLs and hashes (for CORS/same-origin) of all the script resources that the document loads.

Also tagged: Progressive Web Apps Security & Authentication

Digital Goods API

An API for querying and managing digital products to facilitate in-app purchases from web applications, in conjunction with the Payment Request API (which is used to make the actual purchases). The API would be linked to a digital distribution service connected to via the user agent. In Chromium, this is specifically a web API wrapper around the Android Play Billing API.

Also tagged: Progressive Web Apps

PaymentDetails.error

When the payment request is updated using updateWith, the PaymentDetails can contain a message in the error field that will be displayed to the user. For example, this might commonly be used to explain why goods cannot be shipped to the chosen shipping address. The error field cannot be passed to the PaymentRequest constructor. Doing so will cause a TypeError to be thrown.

PaymentDetailsInitId

Add a free-form identifier for payment request. This will be set using PaymentDetailsInit and reflected through PaymentRequest and PaymentResponse and to payment apps. If no identifier is specified a unique identifier will be created.

PaymentDetailsModifier.data

Need to support modifiers with the same identifier but different data. One use case for this is to support card payments with different modifiers for credit vs. debit cards. This change adds the PaymentDetailsModifier.data field to supply the different data.

PaymentMethodChangeEvent

Adds the PaymentMethodChangeEvent and the associated event handler PaymentRequest.onpaymentmethodchange. Handler invocation indicates that the user has changed payment methods. The event can be useful when a merchant re-calculates a total value with method details. For example, merchants can calculate tax by reading billing address information in the event.

PaymentRequest

An API that allows browsers to act as an intermediary between the three key parties in a financial transaction: the merchant (e.g. an online web store), the buyer (e.g. the user buying from the online web store), and the Payment Method (e.g. credit card). Information necessary to process and confirm a transaction is passed between the Payment Method and the merchant via the browser with the buyer confirming and authorizing as necessary across the flow.

Also tagged: Media & Real-time Communication

PaymentRequest.canMakePayment()

A method in PaymentRequest, canMakePayment(), that returns back a boolean indicating whether or not the user has the ability to make a payment at the time PaymentRequest.show() is called.

PaymentRequest.hasEnrolledInstrument()

The PaymentRequest.hasEnrolledInstrument() method returns a boolean indicating whether the user has a payment instrument in their profile that matches the payment identifier in a PaymentRequest and whether it is ready to handle payment at the time PaymentRequest.show() is called.

PaymentRequestEvent.changePaymentMethod()

Enables payment handlers to get the updated total from the merchant in response to a change in payment instrument selected within the payment handler. This fires the PaymentMethodChangeEvent on the merchant website.

PaymentResponse.prototype.retry()

In cases where there is something wrong with the payment response's data (e.g., you find out that the shipping address is a PO box), the retry() method of a PaymentResponse instance allows you to ask a user to retry a payment.

Secure payment confirmation

Secure payment confirmation augments the payment authentication experience on the web with the help of WebAuthn. The feature adds a new 'payment' extension to WebAuthn, which allows a relying party such as a bank to create a PublicKeyCredential that can be queried by any merchant origin as part of an online checkout via the Payment Request API using the 'secure-payment-confirmation' payment method.

Also tagged: Security & Authentication

Secure Payment Confirmation API V3

Three changes to the Secure Payment Confirmation API, implemented and flagged as “V3” of the API. - Add Relying Party ID as a required input (https://github.com/w3c/secure-payment-confirmation/issues/164). This is a breaking change, see compatibility section. - Add an optional boolean to allow failed instrument icon download (https://github.com/w3c/secure-payment-confirmation/issues/125) - Add payeeName as an optional input (https://github.com/w3c/secure-payment-confirmation/issues/163)

Storage Access API

Browsers may block third-party resources from accessing cookies and other storage for privacy and security reasons. The most popular reason is cross-site tracking prevention. Such blocking breaks authenticated cross-site embeds such as commenting widgets, embedded payment providers, and subscribed video services. The Storage Access API provides a means for authenticated cross-site embeds to check their blocking status and request access to storage if they are blocked.

Also tagged: JavaScript Language Media & Real-time Communication Privacy & Identity Security & Authentication

Support for collecting payer's name for PaymentRequest.

If the requestPayerName flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then UA should collect and return the payer's name as part of the payment request. For example, this would be set to true to allow merchant to make a booking in the payer's name. This option has been behind a flag on mobile since Chrome 55. On desktop, it's shipping in Chrome 60 with the rest of Payment Request API.

Throw on invalid "basic-card" data

PaymentRequest constructor throws a TypeError when invalid "supportedNetworks" or "supportedTypes" are specified for "basic-card" payment.

In developer trial (Behind a flag) (4)

Align error type thrown for 'payment' WebAuthn credential creation: SecurityError => NotAllowedError

Correct the error type thrown during WebAuthn credential creation for 'payment' credentials. Due to a historic specification mismatch, creating a 'payment' credential in a cross-origin iframe without a user activation would throw a SecurityError instead of a NotAllowedError, which is what is thrown for non-payment credentials. This is a breaking change, albeit a niche one. Code that previously detected the type of error thrown (e.g., `e instanceof SecurityError`) would be affected. Code that just generally handles errors during credential creation (e.g. `catch (e)`) will continue to function correctly.

Also tagged: Security & Authentication

Payment handler minimal header UX

This is a refresh of the browser UI associated with the Payment Handler API. Although there are no changes to the API surface with this feature, we'd like to run an origin trial starting in M112 to give payment handler providers a chance to experiment with the new UI ahead of the launch.

Policy-controlled feature `autofill`

The policy-controlled feature `autofill` indicates whether it is safe to autofill fields in an embedded document. Enabling `autofill` in an iframe signals to the user agent that fields in the embedded document may be autofilled together with fields in other documents. Conversely, if `autofill` is disabled in a document, the user agent may warn the user before autofilling any field in the document. A related feature is `manual-text`: https://chromestatus.com/feature/5164522274553856

Also tagged: Privacy & Identity Security & Authentication

securePaymentConfirmationAvailability API

This is a Javascript API to provide an easier way to check if the Secure Payment Confirmation[1] feature is available. Currently, the only way to determine SPC’s availability is to create a PaymentRequest with the required parameters[2], which is clunky and difficult in the case where a developer wants to check for SPC before starting to process a payment. [1] https://www.w3.org/TR/secure-payment-confirmation/ [2] https://github.com/w3c/secure-payment-confirmation/issues/81#issuecomment-868473461

Also tagged: JavaScript Language

In development (3)

Expose PaymentManager on workers

Though Web IDL specification removed [PrimaryGlobal] and made [Exposed] required, many blink's IDL files have not followed it yet. In payment_manager.idl case, the spec has added [Exposed=Window,Worker] as well. So, this will make PaymentManager visible on workers according to the updated specification.

Also tagged: Performance & Scheduling

Optional "total" field in PaymentRequest API

The "total" field (together with the "details" field) of PaymentRequest API is optional so that developers can use other information (e.g., product Id) to make the requests when the total amount is unknown or redundant. As an example, when Digital Product Management (DPM) API is used with PaymentRequest API, developers only need to provide product Id to buy digital goods from digital stores.

Proposed (9)

Fenced Frames with local unpartitioned data access

There are situations in which it is helpful to decorate a third-party widget with cross-site information about the user, such as a personalized payment button that displays credit card information to give the user confidence that the payment flow will be smooth, or a personalized sign-in button. These sorts of use cases will be broken by third-party cookie deprecation (3PCD). Fenced frames are a natural fit for such use cases, as they allow for frames with cross-site data to be composed within a page of another partition. The idea proposed here is to allow fenced frames to have access to the cross-site data stored for the given origin within shared storage. In other words, the payment site would add the user’s payment data to shared storage when the user visits the payment site, and then read it in third-party fenced frames to decorate their payment button. To prevent the fenced frame from leaking the user’s shared storage data out (to the embedder or to servers via network) we’re requiring that fenced frames first disable all untrusted network communications before accessing shared storage.

Also tagged: Privacy & Identity

Get Secure Payment Confirmation Capabilities

Adds a new static method to the Payment Request that allows web developers to get the capabilities of the browser's implementation of Secure Payment Confirmation. This helps web developers to easily know what capabilities are available for Secure Payment Confirmation so they can decide whether or not they want to use Secure Payment Confirmation with those capabilities.

Payment Request: Allow payment handlers to report back internal errors

Enables payment handlers that are accessed via the Payment Request API to return distinct errors for "user cancelled" vs "internal payment app error". This allows web developers to build better flows for users, e.g. by retrying or falling back to a different flow when an internal app error occurs, whilst properly stopping the flow if the user wants to cancel. The Web-based Payment Handler API can indicate this difference based on what error they use to reject the promised passed to PaymentRequestEvent.respondWith. If the promise is rejected with an OperationError, then "internal app error" (OperationError) is returned to the merchant via the PaymentRequest.show(), otherwise "user cancel" (AbortError) is returned. Native app payment handler infrastructure is similarly updated, but is out of scope for web APIs.

PaymentHandlerAppError interface

Allows payment handlers to return structured error codes via the PaymentHandlerAppError interface, which extends DOMException. When a web-based payment handler rejects the promise passed to PaymentRequestEvent's respondWith() method with a PaymentHandlerAppError (or a native payment app reports an equivalent structured error), the browser rejects the promise returned by PaymentRequest's show() method with a PaymentHandlerAppError. This helps merchant sites distinguish between failure categories such as unsupported users, merchant configuration issues, temporary service outages, and internal payment app errors so they can show tailored recovery flows or log actionable diagnostics.

Persistent Widgets

Persistent widgets are embedded browsing contexts, like iframes, but they can persist across same-origin navigations without reloading. Persistent widgets can be used via the <persistentwidget> HTML element. The <persistentwidget> HTML element takes a src attribute, like an iframe. In order to make the <persistentwidget> survive a navigation, all of these conditions must be met: 1. The navigation must be to a same-origin document. 2. The <persistentwidget> element must have the same src and id HTML attributes in both documents. 3. The <persistentwidget> element must be attached to the new document before its first render.

Also tagged: Media & Real-time Communication Performance & Scheduling Privacy & Identity

Secure Payment Confirmation: Locale Validation

Updates Secure Payment Confirmation's `locale` data field to return a Not Supported DOMException if none of the language tags provided in the field match the language used by the Secure Payment Confirmation's dialog. If the field is not set or empty, this validation is skipped. This helps web developers with matching the language of the data that they are supplying to Secure Payment Confirmation with the dialog.

Secure Payment Confirmation: UX Refresh

Updates the UX elements for the SPC dialog on Android Chrome. Other than just UX presentation the following are being added: - Allowing merchants to provide an optional list of payment entity logos related to the payment that will be displayed in the UX (https://github.com/w3c/secure-payment-confirmation/pull/294). - Returning different output states back to the merchant depending on whether the user wants to continue the transaction without SPC or to cancel the transaction (https://github.com/w3c/secure-payment-confirmation/pull/292). Currently, we only send a single output state back for both cases. - A new payment detail label field will be added to the payment instrument so the text be presented across 2 lines in SPC (https://github.com/w3c/secure-payment-confirmation/pull/298)

Service Worker soft update after functional events

The Service Worker spec requires a "soft update" after each functional event (push, notification click/close, background sync, payment, etc.) completes on a stale registration (last update check > 24h). This change adds a centralized FireFunctionalEvent() method to ServiceWorkerVersion that implements the spec's "Fire Functional Event" algorithm, including soft update triggers at steps 3 (should skip event), 5 (worker start failure), and 8 (after event completion). Each functional event dispatcher is migrated to use this method.

Also tagged: Performance & Scheduling Progressive Web Apps

Deprecated (2)

PaymentMethodData.supportedMethods should not be a sequence

PaymentMethodData is used in the PaymentRequest constructor, the PaymentRequestEvent, and the CanMakePaymentEvent. It's supportedMethods property holds and identifier indicating the payment methods a merchant accepts. Currently, this property takes either a string or array. After this change, it will only take a string.

Secure Payment Confirmation: Rename rp --> rpId in CollectedClientAdditionalPaymentData

Secure Payment Confirmation (SPC) is a Web API to support streamlined authentication during a payment transaction. It builds on top of WebAuthn to bring strong authentication to payment flows. In the initial spec and implementation of SPC, the output CollectedClientAdditionalPaymentData dictionary[0] of the cryptogram contained a parameter named 'rp'. This was renamed in the specification[1] to 'rpId' to align with WebAuthn, and Chrome is changing its implementation to match (that is, adding 'rpId' and removing 'rp'). [0]: https://w3c.github.io/secure-payment-confirmation/#sctn-collectedclientadditionalpaymentdata-dictionary [1]: https://github.com/w3c/secure-payment-confirmation/pull/198

Also tagged: Security & Authentication

Removed (10)

Calling PaymentRequest.show without user activation

Allowing PaymentRequest.show() to be triggered without a user activation could be abused by malicious websites. To protect users, the spec was changed to require user activation, and we are now following through in the Chrome implementation.

Deprecate and remove PaymentInstruments

PaymentInstruments is the Web API that backs non-JIT install of payment apps (see https://w3c.github.io/payment-handler/). It was designed with the assumption that the browser would store the actual payment instrument details, which has not turned out to be true, and has some privacy leaks. It also has not shipped on any other browser, not have we seen any interest from other browser vendors. As such, this API has been deprecated and removed.

Also tagged: Privacy & Identity

Deprecate PaymentAddress.careOf

The PaymentAddress interface has a careOf field which is non-standard (no well-known address standards support it, see below). The careOf field is unnecessary, the recipient and organization fields sufficiently support all necessary use cases. Adding careOf poses significant issues in terms of interoperability with existing postal address schemas and APIs. (From spec discussion: https://github.com/w3c/browser-payment-api/issues/244)

Merchant identity in "canmakepayment" event

The “canmakepayment” service worker event lets the merchant know whether the user has a card on file in an installed payment app. It used to silently pass the merchant's origin and arbitrary data to a service worker from payment app origin. This cross-origin communication happened on PaymentRequest construction in JavaScript, did not require a user gesture, and did not show any user interface. This silent data passage has been removed from the "canmakepayment" event (and the Android IS_READY_TO_PAY Intent).

Also tagged: JavaScript Language Performance & Scheduling Privacy & Identity Progressive Web Apps

No longer pursuing (7)

CanMakePaymentEvent.respondWithMinimalUI

Add a mechanism for a payment handler to enroll in a golden path, low friction payment experience. In addition to the existing CanMakePaymentEvent.respondWith() event, this feature will add a new method CanMakePaymentEvent.respondWithMinimalUI() that the payment handler could choose to use.

Merchant Validation

Merchant validation is the process by which a payment handler validates the identity of a merchant against some value (usually some cryptographic challenge response). Validated merchants are allowed to interface with a payment handler. The PaymentRequest's onmerchantvalidation event is invoked when the user agent requests merchant validation on behalf of a selected payment handler.

Also tagged: Privacy & Identity

More restrictive show() for autofill instruments

Improves the authorization of transactions by requiring unexpired cards and a billing address. This improves the quality of autofill data and increasing the chances that PaymentRequest.show() returns a valid response.

Per-method quota for PaymentRequest.hasEnrolledInstrument()

Separate hasEnrolledInstrument() calls should be used to query whether a user has a Google Pay wallet and whether they have cards in the autofill database. This ability is supported without letting sites iterate payment instruments within these locations. Previously Chrome would reject PaymentRequest.hasEnrolledInstrument() with NotAllowedError if a website queried different payment methods or different payment method specific parameters within a span of 30 minutes.

Remove currencySystem in PaymentRequest API

The `currencySystem` member was removed from PaymentRequest API spec. Removal at this time does not preclude it being added to a future version of the API. Current implementations of Payment Request API allow the use of well-formed currency codes that are not part of the official ISO4217 registry. If the provided code is a currency that the browser knows how to display, then an implementation will generally display the appropriate currency symbol in the user interface.

No active development (2)

COOP same-origin-allow-popups-plus-coep

To make crossOriginIsolation easier to deploy on sites with OAuth/payment flows relying on popups, we would like Cross-Origin-Opener-Policy: same-origin-allow-popups to also enable crossOriginIsolation when served with an appropriate Cross-Origin-Embedder-Policy header. This would introduce a new COOP mode, with a few restrictions compared to regular COOP same-origin-allow-popups. However, this mode would be crossOriginIsolated, while still having access to any popup it opens through window.post

Also tagged: Media & Real-time Communication Security & Authentication

Deprecate & Remove: Secure Payment Confirmation - Opt-Out Support

Deprecate and remove support for the `showOptOut` parameter in the Secure Payment Confirmation API (https://w3c.github.io/secure-payment-confirmation/#dom-securepaymentconfirmationrequest-showoptout) This parameter was designed to support developers in certain regions who believed they needed to offer an opt-out experience that was embedded into the Secure Payment Confirmation experience. (See previous feature entry - https://chromestatus.com/feature/5133415903920128). However, two years after adding the feature we are no longer seeing demand or uptake for this feature from web developers, and it constrains the future development of the API. As such, we are removing support for the `showOptOut` feature. Developers who need an 'opt out' mechanism are encouraged to display HTML UX to the user for this before calling SPC. To avoid silent breakage of developers who are setting this flag, construction of SPC with `showOptOut: true` will throw instead of silently ignoring the parameter. Spec issue discussion: https://github.com/w3c/secure-payment-confirmation/issues/274

Timeline