Skip to content

Commit

Permalink
docs: Resolves #404 and #409 (#411)
Browse files Browse the repository at this point in the history
* docs: Resolves #404 and #409

* Remove lock files

---------

Co-authored-by: Chen Hui Jing <[email protected]>
  • Loading branch information
melissahenderson and huijing authored Nov 22, 2023
1 parent 896845b commit 030913d
Show file tree
Hide file tree
Showing 19 changed files with 103 additions and 99 deletions.
14 changes: 10 additions & 4 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ export default defineConfig({
link: '/docs/resources/libraries',
},
{
label: 'Payment pointers',
link: '/docs/resources/paymentpointers',
label: 'Open Payments-enabled wallets',
link: '/docs/resources/op-wallets',
},
{
label: 'External resources',
Expand All @@ -183,22 +183,27 @@ export default defineConfig({
{
label: 'Interledger',
link: 'https://interledger.org/',
attrs: { target: '_blank'},
},
{
label: 'Open Payments API',
link: 'https://docs.openpayments.guide/',
link: 'https://openpayments.guide/',
attrs: { target: '_blank'},
},
{
label: 'Payment Handler API',
link: 'https://w3c.github.io/payment-handler/',
attrs: { target: '_blank'},
},
{
label: 'Payment Pointers',
label: 'Payment pointers',
link: 'https://paymentpointers.org/',
attrs: { target: '_blank'},
},
{
label: 'Payment Request API',
link: 'https://www.w3.org/TR/payment-request/',
attrs: { target: '_blank'},
},
],
},
Expand All @@ -207,6 +212,7 @@ export default defineConfig({
{
label: 'Specification',
link: 'https://webmonetization.org/specification/',
attrs: { target: '_blank'},
},
],
}),
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/Footer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</ul>
<ul>
<li><a href="https://paymentpointers.org/">Payment Pointers</a></li>
<li><a href="https://docs.openpayments.guide/">Open Payments</a></li>
<li><a href="https://openpayments.guide/">Open Payments</a></li>
<li><a href="https://interledger.org/">Interledger</a></li>
</ul>
</div>
Expand Down
8 changes: 4 additions & 4 deletions src/content/docs/docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ The following image shows the Web Monetization flow at a high level. Some steps
/>

1. Bob visits a [web monetized page](/docs/guides/monetize-page). The monetization `<link>` element is how the website signals its acceptance of payments to the browser.
2. Bob’s browser, either natively or via a browser extension, parses the `<link>` element to get the <Tooltip content='A URL that identifies an Open Payments account' client:load><a href="./resources/glossary#payment-pointer">payment pointer</a></Tooltip> for Alice, the site owner.
3. Bob’s browser/extension sends requests to Alice’s payment pointer to obtain authorization and instructions for sending a payment.
4. With authorization granted and payment instructions received, the browser/extension sends requests to Bob’s payment pointer to initiate the outgoing payment.
2. Bob’s browser, either natively or via a browser extension, parses the `<link>` element to get the <Tooltip content='A URL that identifies an Open Payments account' client:load><a href="./resources/glossary#wallet-address">wallet address</a></Tooltip> for Alice, the site owner.
3. Bob’s browser/extension sends requests to Alice’s wallet address to obtain authorization and instructions for sending a payment.
4. With authorization granted and payment instructions received, the browser/extension sends requests to Bob’s wallet address to initiate the outgoing payment.
5. The Web Monetization flow ends. Payment processing, currency exchange, and settlement occurs between the two accounts via a common payment rail.

### Specifying payment amounts and currencies
Expand All @@ -63,6 +63,6 @@ Web Monetization communicates with the sending and receiving accounts to obtain

A new version of the Web Monetization specification was published in June 2023. Users of the previous version should be aware of the following:

- The previous version only used Interledger's Simple Payment Setup Protocol (SPSP). The new version uses <LinkOut href="https://docs.openpayments.guide/">Open Payments</LinkOut>.
- The previous version only used Interledger's Simple Payment Setup Protocol (SPSP). The new version uses <LinkOut href="https://openpayments.guide/">Open Payments</LinkOut>.
- The `<meta>` element is deprecated in favor of the [`<link>`](./references/html-link-rel-monetization/) element.
- The `<link>` element does not support the shorthand form of a payment pointer (e.g., `$wallet.example/alice`). You must use the endpoint URL that the payment pointer resolves to (e.g., `https://wallet.example/alice`). If you need help converting a payment pointer from shorthand to its equivalent URL, enter your payment pointer into the input field on <LinkOut href="https://paymentpointers.org">paymentpointers.org</LinkOut>. In most cases, you can simply replace the `$` with `https://`.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The example below illustrates how to use the `monetization` event to show a web

```html
<head>
<!-- this should be set to your own payment pointer -->
<!-- this should be set to your own wallet address -->
<link rel="monetization" href="https://wallet.example/alice" />

<script>
Expand Down
6 changes: 4 additions & 2 deletions src/content/docs/docs/guides/monetize-page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
title: Add Web Monetization to a page
---

import { LinkOut } from '@interledger/docs-design-system'

This page provides basic instructions for adding Web Monetization to a web page. If you're new to web monetizing content, this page is a great place to start.

## Prerequisites

- Web monetized pages must be secure and served over HTTPS.
- You must have the payment pointer assigned to you by your WM receiver.
- You must have the wallet address assigned to you by your WM receiver.

## Monetize a page

To add Web Monetization to a page, add the monetization `<link>` element to the page's `<head>`.

The element’s `rel` value is always `monetization`. The `href` value is a payment pointer in URL format.
The element’s `rel` value is always `monetization`. The `href` value is your wallet address. If your wallet address is a payment pointer, it must be entered in <LinkOut href='https://paymentpointers.org/'>URL format</LinkOut>.

For example:

Expand Down
4 changes: 2 additions & 2 deletions src/content/docs/docs/guides/provide-exclusive-content.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ The example below illustrates a simple way to show exclusive content to web mone

```html
<head>
<!-- this should be set to your own payment pointer -->
<!-- this should be set to your own wallet address -->
<link rel="monetization" href="https://wallet.example/alice" />

<style>
Expand Down Expand Up @@ -89,7 +89,7 @@ The example below covers three states for showing:
```html
<head>
<!-- this should be set to your own payment pointer -->
<!-- this should be set to your own wallet address -->
<link rel="monetization" href="https://wallet.example/alice" />

<style>
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/docs/guides/remove-ads.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The example below shows how to remove ads from web monetized visitors.

```html
<head>
<!-- Set the href to your own payment pointer -->
<!-- Set the href to your own wallet address -->
<link rel="monetization" href="https://wallet.example/alice" />

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ title: Set up probabilistic revenue sharing

import NoPay from '/src/snippets/glitchNoPay.mdx'

How do you share a portion of a web monetized page's earnings when a monetization `<link>` element only supports one payment pointer as its `href` value?
How do you share a portion of a web monetized page's earnings when a monetization `<link>` element only supports one wallet address as its `href` value?

One way is through probabilistic revenue sharing. Probabilistic revenue sharing works by choosing from a list of predefined payment pointers each time a web monetized visitor loads the page. Payments are sent to the chosen payment pointer until the visitor reloads or closes the page.
One way is through probabilistic revenue sharing. Probabilistic revenue sharing works by choosing from a list of predefined wallet addresses each time a web monetized visitor loads the page. Payments are sent to the chosen wallet address until the visitor reloads or closes the page.

A payment pointer's chance of being chosen is based on its assigned weight. For example, if Alice's payment pointer has a weight of 50 (out of 100), then her payment pointer has a 50% chance of being chosen. The laws of probability state that Alice's share of the page's total revenue will approach 50% as more web monetized visitors access the page.
The chance of a wallet address being chosen is based on its assigned weight. For example, if Alice's wallet address has a weight of 50 (out of 100), then her wallet address has a 50% chance of being chosen. The laws of probability state that Alice's share of the page's total revenue will approach 50% as more web monetized visitors access the page.

## Example

This example shows how to use probabilistic revenue sharing by including a script on your web monetized page.
This example shows how to use probabilistic revenue sharing by including a script on your web monetized page. It also uses payment pointers, but you can use any Open Payments-enabled wallet addresses.

:::note
If you don't want to include a script on your page, you can use our [Probabilistic Revshare Generator](/prob-revshare). After entering your payment pointers and their weights, the generator will provide you with a monetization `<link>` element that contains a unique `href` URL hosted on `https://webmonetization.org/api/revshare/pay/`.
If you don't want to include a script on your page, you can use our [Probabilistic Revshare Generator](/prob-revshare). After entering your payment pointers and/or other Open Payments-enabled wallet addresses, along with weights, the generator will provide you with a monetization `<link>` element that contains a unique `href` URL hosted on `https://webmonetization.org/prob-revshare/`.
:::

The example below shows a list of weighted payment pointers. The easiest way to establish weight is to assign values that add up to 100.
Expand Down
20 changes: 8 additions & 12 deletions src/content/docs/docs/intro/receiving-payments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,31 @@ A WM receiver is an entity that provides an Open Payments-enabled account into w

We anticipate most WM receivers to offer some form of digital wallet to their users. Many digital wallet providers, not just WM receivers, are often required to verify their users’ identities before allowing funds to be withdrawn.

## Open Payments and payment pointers
## Open Payments and wallet addresses

Web Monetization works with two complementary technologies that enable open and interoperable payments between WM providers and WM receivers: Open Payments and payment pointers.

### Open Payments

Accounts supplied by both WM providers and WM receivers must implement the <LinkOut href="https://openpayments.guide">Open Payments (OP) specification</LinkOut>.
Open Payments enables open and interoperable payments between WM providers and WM receivers. As such, accounts supplied by both WM providers and WM receivers must implement the <LinkOut href="https://openpayments.guide">Open Payments (OP) specification</LinkOut>.

The OP specification defines standards for **_access_** to accounts. When granted access, applications and other entities can integrate payments into their feature sets by connecting to their users’ accounts. The ability to then **_execute_** payments between OP-enabled accounts relies on the availability of a common payment rail between the accounts.

### Payment pointers
### Wallet addresses

Access to an OP-enabled account, whether for sending or receiving, always starts with a <LinkOut href="https://paymentpointers.org">payment pointer</LinkOut>. A payment pointer is a unique, standardized identifier for a payment account that always resolves to an HTTPS URL.
Access to an OP-enabled account, whether for sending or receiving, always starts with a wallet address. In this context, a wallet address is a unique URL that identifies an OP account and provides an entry point for the Open Payments API.

When an individual establishes an account with a WM receiver, the receiver assigns the account a payment pointer. The payment pointer allows certain account details to be safely shared with third-parties. Third-parties use the details to initiate payments to or from the account. A WM agent is an example of a third-party.
When an individual establishes an account with a WM receiver, the receiver assigns the account one or more wallet addresses. Wallet addresses allow certain account details to be safely shared with third-parties. Third-parties use the details to initiate payments to or from the account. A WM agent is an example of a third-party.

A payment pointer is required to web monetize a page and must be added as the `href` value within the monetization `<link>` element.
A wallet address is required to web monetize a page and must be added as the `href` value within the monetization `<link>` element.

For example:

```html
<link rel="monetization" href="https://wallet.example/alice" />
```

The WM agent uses the payment pointer to begin the money movement process.
The WM agent uses the wallet address to begin the money movement process.

## Receiving a payment

When an individual visits a web monetized page, their WM agent detects the monetization `<link>` element and associated payment pointer. The WM agent sends a request to the payment pointer, which is the beginning of a series of API calls needed to:
When an individual visits a web monetized page, their WM agent detects the monetization `<link>` element and associated wallet address. The WM agent sends a request to the wallet address, which is the beginning of a series of API calls needed to:

1. Get the details about the underlying receiving account
2. Receive permission to send a payment to the account
Expand Down
18 changes: 7 additions & 11 deletions src/content/docs/docs/intro/sending-payments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,19 @@ In addition to providing funded accounts, WM providers are responsible for defin

For a provider to send a Web Monetization payment on behalf of an individual, the provider must support the Open Payments specification.

## Open Payments and payment pointers
## Open Payments and wallet addresses

Web Monetization works with two complementary technologies that enable open and interoperable payments between WM providers and WM receivers: Open Payments and payment pointers.

### Open Payments

Accounts supplied by both WM providers and WM receivers must implement the <LinkOut href="https://openpayments.guide">Open Payments (OP) specification</LinkOut>.
Open Payments enables open and interoperable payments between WM providers and WM receivers. As such, accounts supplied by both WM providers and WM receivers must implement the <LinkOut href="https://openpayments.guide">Open Payments (OP) specification</LinkOut>.

The OP specification defines standards for **_access_** to accounts. When granted access, applications and other entities can integrate payments into their feature sets by connecting to their users’ accounts. The ability to then **_execute_** payments between OP-enabled accounts relies on the availability of a common payment rail between the accounts.

### Payment pointers
### Wallet addresses

Access to an OP-enabled account, whether for sending or receiving, always starts with a <LinkOut href="https://paymentpointers.org">payment pointer</LinkOut>. A payment pointer is a unique, standardized identifier for a payment account and always resolves to an HTTPS URL.
Access to an OP-enabled account, whether for sending or receiving, always starts with a wallet address. In this context, a wallet address is a unique URL that identifies an OP account and provides an entry point for the Open Payments API.

A payment pointer allows certain account details to be safely shared with third-parties. Third-parties use the details to initiate payments to or from the account. A WM agent is an example of a third-party.
A wallet address allows certain account details to be safely shared with third-parties. Third-parties use the details to initiate payments to or from the account. A WM agent is an example of a third-party.

Depending on the form a WM provider takes, the provider's user may not know, nor have a need to know, any details about the sending account's payment pointer.
Depending on the form a WM provider takes, the provider's user may not know, nor have a need to know, any details about the sending account's wallet address.

## WM agents

Expand All @@ -57,7 +53,7 @@ The WM agent is code that discovers web monetized pages, exposes the Web Monetiz

### How it works

The WM agent checks each page an individual visits for a monetization `<link>` element. A monetization `<link>` element must contain a payment pointer. For example:
The WM agent checks each page an individual visits for a monetization `<link>` element. A monetization `<link>` element must contain a valid Open Payments wallet address. For example:

```html
<link rel=”monetization” href=”https://wallet.example/alice”>
Expand Down
Loading

0 comments on commit 030913d

Please sign in to comment.