Facilitated Payment Link Type in HTML

Draft Community Group Report,

This version:
https://wicg.github.io/paymentlink
Issue Tracking:
GitHub
Editor:
(Google)

Abstract

This specification defines a mechanism for web pages to indicate the availability of push-based payment methods using the link element, enabling user agents to facilitate seamless payment experiences.

Status of this document

This specification was published by the Web Platform Incubator Community Group. It is not a W3C Standard nor is it on the W3C Standards Track. Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. Learn more about W3C Community and Business Groups.

1. Introduction

Online checkout flows often involve push payments, where the customer initiates the payment based on information provided by the merchant. These push payments can sometimes lead to friction in the user experience, especially when they involve actions like scanning QR codes or navigating to external payment applications.

User agents, such as web browsers, have the potential to streamline these push payment flows by integrating with payment wallets and providing a more seamless payment experience. However, currently, there is no standardized way for web pages to passively indicate the availability of push payment methods to the user agent.

This specification defines a mechanism for web pages to signal the availability of push-based payment methods by using the <link rel="facilitated-payment"> element. This allows user agents to detect supported payment methods and offer users a smoother payment experience by integrating with compatible payment wallets.

For background information, use cases, and examples, refer to the explainer document.

2. Definitions

This specification uses the following terms:

The facilitated-payment keyword may be used with link elements. The keywords creates an external resource link. The keyword is body-ok.

The facilitated-payment keyword indicates the availability of a push payment method on a web page. It creates a relationship between the document and a payment method resource.

There is no default type for resources given by the facilitated-payment keyword.

A user agent must not delay the load event for this link type.

The URL scheme of the href attribute indicates supported payment methods. The URL may contain additional information specific to the payment method.

EXAMPLE: UPI

<link rel="facilitated-payment" href="upi://pay?pa=merchant@bank&pn=Test&am=100&cu=INR">

EXAMPLE: Bitcoin

<link rel="facilitated-payment" href="bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=20.3&label=Donation">

EXAMPLE: PayPal

<link rel="facilitated-payment" href="paypal://paypal.com?payee-address=175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W&currency=USD&amount=20.3&payee-name=Walmart">

The appropriate times to fetch and process the linked resource for such a link are:

The fetch and process the linked resource algorithm for facilitated-payment links, given a link element el, is as follows:

  1. If el’s relevant settings object is not a secure context, then return.

  2. If el’s node navigable is not a top-level traversable, then return.

  3. If el’s node document is not allowed to use the payment feature, then return.

  4. If el’s href attribute’s value is the empty string, then return.

  5. Let url be the result of encoding-parsing a URL given el’s href attribute’s value, relative to el’s node document.

  6. If url is failure, then return.

  7. If url’s scheme is not supported for facilitated payments by the user agent, then return.

  8. Find all payment wallets integrated with the user agent which are compatible with url’s scheme. Let compatibleWallets be a set containing all such wallets.

  9. If compatibleWallets’s size is 0, then return.

  10. Prompt the user with a wallet selector containing compatibleWallets for users to choose the payment method they want to use.

  11. If the wallet selector is dismissed, then return.

  12. Hand off url to the selected wallet software. This wallet software must not immediately perform any payments, but instead should help the user perform the specified payment, using details specified in url such as the payment amount, payee, and currency. The details of how such wallet software is integrated with the user agent, and how the handoff is performed, are implementation-defined.

4. Security Considerations

There is a possibility of malicious actors injecting their own facilitated-payment links into web pages and tricking the users into paying them. Standard safety checks done by browsers will offer some level of protection against such attacks.

Per the algorithm given above, the facilitated-payment link needs to be on on a page with the following properties:**

Also, as mentioned in the previous section, the detected facilitated-payment link needs to be validated before further processing.

5. Privacy Considerations

A malicious payment client could use the existence of facilitated-payment links to track the user. This is an existing concern with e.g., extension based apps (which often ask for permission to view all webpages the user visits), but should be considered for this proposal too.

Browsers should manage payment clients with care; users should be made aware of the risks and be given control over the payment clients in their browser. Certain privacy savvy users may prefer not to let the payment clients get access to their payment info even if they may not contain any sensitive data. Where appropriate, a user agent might consider policies around how a payment client can be integrated with (for example, via apps store policies on platforms that have app stores).

The user agent should prompt the user before initiating payment. User consent is required every time.

Conformance

Document conventions

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

Examples in this specification are introduced with the words “for example” or are set apart from the normative text with class="example", like this:

This is an example of an informative example.

Informative notes begin with the word “Note” and are set apart from the normative text with class="note", like this:

Note, this is an informative note.

Index

Terms defined by this specification

Terms defined by reference

References

Normative References

[DOM]
Anne van Kesteren. DOM Standard. Living Standard. URL: https://dom.spec.whatwg.org/
[HTML]
Anne van Kesteren; et al. HTML Standard. Living Standard. URL: https://html.spec.whatwg.org/multipage/
[INFRA]
Anne van Kesteren; Domenic Denicola. Infra Standard. Living Standard. URL: https://infra.spec.whatwg.org/
[PAYMENT-REQUEST]
Marcos Caceres; Rouslan Solomakhin; Ian Jacobs. Payment Request API. URL: https://w3c.github.io/payment-request/
[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119
[URL]
Anne van Kesteren. URL Standard. Living Standard. URL: https://url.spec.whatwg.org/