Skip to content
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

Add necessary files to deploy spec using template #7

Merged
merged 10 commits into from
Dec 20, 2024
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# See the documentation at
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
# Update actions used by .github/workflows in this repository.
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions-org: # Groups all Github-authored actions into a single PR.
patterns: ["actions/*"]
17 changes: 17 additions & 0 deletions .github/workflows/auto-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI
on:
pull_request: {}
push:
branches: [main]
jobs:
main:
name: Build, Validate and Deploy
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: w3c/spec-prod@v2
with:
GH_PAGES_BRANCH: gh-pages
BUILD_FAIL_ON: warning
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
index.html
7 changes: 7 additions & 0 deletions .pr-preview.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"src_file": "index.bs",
"type": "bikeshed",
"params": {
"force": 1
}
}
32 changes: 16 additions & 16 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ URL: https://github.com/WICG/paymentlink
Editor: Junhui He, Google https://google.com, [email protected]
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.
Markup Shorthands: markdown yes, css no
Complain About: accidental-2119 yes, missing-example-ids yes
Complain About: accidental-2119 yes, missing-example-ids yes, mixed-indents no
Assume Explicit For: yes
Die On: warning
WPT Path Prefix: payment-link
WPT Display: closed
Include MDN Panels: if possible
Include Can I Use Panels: yes
</pre>

<pre class="link-defaults">
spec:html; type:element; text:link
</pre>

Introduction {#intro}
=====================

Expand All @@ -35,33 +38,31 @@ This specification uses the following terms:

* **Payment client:** An integrated wallet or a browser wallet extension that is responsible for facilitating payments.

* **Payment method:** A specific way of making a payment, such as UPI, Bitcoin, or a particular eWallet. It is identified by the URL [=url/scheme=] in the <{link/href}> attribute of a <{link/rel/payment}> link.


* **Payment method:** A specific way of making a payment, such as UPI, Bitcoin, or a particular eWallet. It is identified by the URL [=url/scheme=] in the <{link/href}> attribute of a <{link/rel/payment}> link.

Link type "<dfn attr-value for="link/rel">payment</dfn>" {#payment-link-type}
===========================================

The <{link/rel/payment}> keyword may be used with <{link}> elements. The keywords creates an [=external resource link=]. The keyword is [=body-ok=].
The <{link/rel/payment}> keyword may be used with <{link}> elements. The keywords creates an [=external resource link=]. The keyword is <a spec=HTML>body-ok</a>.

The <{link/rel/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 <{link/rel/payment}> keyword.

A user agent must not [=delay the load event=] for this link type.
A user agent must not <a href="https://html.spec.whatwg.org/multipage/syntax.html#delay-the-load-event">delay the load event</a> for this link type.

The URL [=URL/scheme=] of the <{link/href}> attribute indicates supported payment methods. The URL may contain additional information specific to the payment method.
The URL [=url/scheme=] of the <{link/href}> attribute indicates supported payment methods. The URL may contain additional information specific to the payment method.

<div class="example" heading="UPI">
<p><code class="html">&lt;link rel="payment" href="upi://pay?pa=merchant@bank&pn=Test&am=100&cu=INR"&gt;</code></p>
<div class="example" id="example-upi" heading="UPI">
<p><code class="html">&lt;link rel="payment" href="upi://pay?pa=merchant@bank&amp;pn=Test&amp;am=100&amp;cu=INR"&gt;</code></p>
</div>

<div class="example" heading="Bitcoin">
<p><code class="html">&lt;link rel="payment" href="bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=20.3&label=Donation"&gt;</code></p>
<div class="example" id="example-bitcoin" heading="Bitcoin">
<p><code class="html">&lt;link rel="payment" href="bitcoin:175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W?amount=20.3&amp;label=Donation"&gt;</code></p>
</div>

<div class="example" heading="PayPal">
<p><code class="html">&lt;link rel="payment" href="paypal://paypal.com?payee-address=175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W&currency=USD&amount=20.3&payee-name=Walmart"&gt;</code></p>
<div class="example" id="example-paypal" heading="PayPal">
<p><code class="html">&lt;link rel="payment" href="paypal://paypal.com?payee-address=175tWpb8K1S7NmH4Zx6rewF9WQrcZv245W&amp;currency=USD&amp;amount=20.3&amp;payee-name=Walmart"&gt;</code></p>
</div>

The appropriate times to <a spec="HTML">fetch and process the linked resource</a> for such a link are:
Expand All @@ -79,15 +80,14 @@ The [fetch and process the linked resource](https://html.spec.whatwg.org/multipa
5. Let |url| be the result of [=encoding-parsing a URL=] given |el|'s <{link/href}> attribute's value, relative to |el|'s [=Node/node document=].
6. If |url| is failure, then return.
7. If |url|’s [=url/scheme=] is not supported 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.
8. Find all payment wallets integrated with the user agent which are compatible with |url|'s [=url/scheme=]. Let |compatibleWallets| be a [=/set=] containing all such wallets.
9. If |compatibleWallets|'s [=set/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. Hands off |url| to OS component or browser extension to display a payment confirmation dialog that includes details from the |url|, such as the payment amount, payee, and currency.
13. (Optional) Launch the selected wallet application or interface.
14. Provide instructions to the user on how to proceed with the payment.


Security Considerations {#security-considerations}
=================================================

Expand Down