Skip to content

Commit 9c851cf

Browse files
docs: mi/520/split-payments (#558)
* docs: mi/520/split-payments Add split payments tutorial mdx page Add split payments to Guides menu * docs: mi/520/split-payments * docs: mi/520/split-payments * mi/520/split-payments * docs: mi/520/split-payments * docs: finalizing guide * docs: mi/520/split-payments --------- Co-authored-by: Melissa Henderson <[email protected]>
1 parent 0567add commit 9c851cf

9 files changed

+550
-119
lines changed

.gitignore

+82
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,85 @@ dist
4242

4343
tmp
4444
.spectral.json
45+
styles/.vale-config/3-MDX.ini
46+
styles/Google/Acronyms.yml
47+
styles/Google/AMPM.yml
48+
styles/Google/Colons.yml
49+
styles/Google/Contractions.yml
50+
styles/Google/DateFormat.yml
51+
styles/Google/Ellipses.yml
52+
styles/Google/EmDash.yml
53+
styles/Google/Exclamation.yml
54+
styles/Google/FirstPerson.yml
55+
styles/Google/Gender.yml
56+
styles/Google/GenderBias.yml
57+
styles/Google/HeadingPunctuation.yml
58+
styles/Google/Headings.yml
59+
styles/Google/Latin.yml
60+
styles/Google/LyHyphens.yml
61+
styles/Google/meta.json
62+
styles/Google/OptionalPlurals.yml
63+
styles/Google/Ordinal.yml
64+
styles/Google/OxfordComma.yml
65+
styles/Google/Parens.yml
66+
styles/Google/Passive.yml
67+
styles/Google/Periods.yml
68+
styles/Google/Quotes.yml
69+
styles/Google/Ranges.yml
70+
styles/Google/Semicolons.yml
71+
styles/Google/Slang.yml
72+
styles/Google/Spacing.yml
73+
styles/Google/Spelling.yml
74+
styles/Google/Units.yml
75+
styles/Google/vocab.txt
76+
styles/Google/We.yml
77+
styles/Google/Will.yml
78+
styles/Google/WordList.yml
79+
styles/proselint/Airlinese.yml
80+
styles/proselint/AnimalLabels.yml
81+
styles/proselint/Annotations.yml
82+
styles/proselint/Apologizing.yml
83+
styles/proselint/Archaisms.yml
84+
styles/proselint/But.yml
85+
styles/proselint/Cliches.yml
86+
styles/proselint/CorporateSpeak.yml
87+
styles/proselint/Currency.yml
88+
styles/proselint/Cursing.yml
89+
styles/proselint/DateCase.yml
90+
styles/proselint/DateMidnight.yml
91+
styles/proselint/DateRedundancy.yml
92+
styles/proselint/DateSpacing.yml
93+
styles/proselint/DenizenLabels.yml
94+
styles/proselint/Diacritical.yml
95+
styles/proselint/GenderBias.yml
96+
styles/proselint/GroupTerms.yml
97+
styles/proselint/Hedging.yml
98+
styles/proselint/Hyperbole.yml
99+
styles/proselint/Jargon.yml
100+
styles/proselint/LGBTOffensive.yml
101+
styles/proselint/LGBTTerms.yml
102+
styles/proselint/Malapropisms.yml
103+
styles/proselint/meta.json
104+
styles/proselint/Needless.yml
105+
styles/proselint/Nonwords.yml
106+
styles/proselint/Oxymorons.yml
107+
styles/proselint/P-Value.yml
108+
styles/proselint/RASSyndrome.yml
109+
styles/proselint/README.md
110+
styles/proselint/Skunked.yml
111+
styles/proselint/Spelling.yml
112+
styles/proselint/Typography.yml
113+
styles/proselint/Uncomparables.yml
114+
styles/proselint/Very.yml
115+
styles/write-good/Cliches.yml
116+
styles/write-good/E-Prime.yml
117+
styles/write-good/Illusions.yml
118+
styles/write-good/meta.json
119+
styles/write-good/Passive.yml
120+
styles/write-good/README.md
121+
styles/write-good/So.yml
122+
styles/write-good/ThereIs.yml
123+
styles/write-good/TooWordy.yml
124+
styles/write-good/Weasel.yml
125+
.vale.ini
126+
vale

docs/astro.config.mjs

+4
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ export default defineConfig({
229229
{
230230
label: 'Make recurring payments',
231231
link: '/guides/make-recurring-payments/'
232+
},
233+
{
234+
label: 'Split an incoming payment',
235+
link: '/guides/split-payments/'
232236
}
233237
]
234238
},

docs/src/content/docs/guides/make-onetime-payment.mdx

+9-40
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import { Tabs, TabItem } from '@astrojs/starlight/components'
77
import HttpSig from '/src/partials/http-msg-sig-note.mdx'
88
import ChunkedSnippet from '/src/components/ChunkedSnippet.astro'
99
import Ts from '/src/partials/ts-prerequisites.mdx'
10+
import StartInteraction from '/src/partials/grant-start-interaction.mdx'
11+
import FinishInteraction from '/src/partials/grant-finish-interaction.mdx'
1012

1113
:::tip[Summary]
12-
A client can support one-time payments by obtaining the necessary grants and calling the Open Payments APIs to create the incoming payment, quote, and outgoing payment resources.
14+
Add support for one-time payments to your client. A one-time payment is a single, non-recurring payment.
1315
:::
1416

1517
The Open Payments APIs facilitate multiple use cases for one-time payments to and from Open Payments-enabled wallets. Making a payment directly from one person to another, called a peer-to-peer payment, is one example. Purchasing an item from an online merchant and paying in full is another example.
@@ -143,42 +145,17 @@ Now indicate your client can receive a signal from the authorization server when
143145

144146
### 7. Start interaction with the user
145147

146-
Once your client receives the authorization server’s response, it must send the user to the `interact.redirect` URI contained in the response. This starts the interaction flow.
147-
148-
The response also includes a `continue` object, which is essential for managing the interaction and obtaining explicit user consent for outgoing payment grants. The `continue` object contains an access token and a URI that the client will use to finalize the grant request after the user has completed their interaction with the identity provider (IdP). This ensures that the client can securely obtain the necessary permissions to proceed with the payment process.
149-
150-
<CodeBlock title="Example response">
151-
```json
152-
{
153-
"interact": {
154-
"redirect": "https://auth.interledger-test.dev/4CF492MLVMSW9MKMXKHQ",
155-
"finish": "4105340a-05eb-4290-8739-f9e2b463bfa7"
156-
},
157-
"continue": {
158-
"access_token": {
159-
"value": "33OMUKMKSKU80UPRY5NM"
160-
},
161-
"uri": "https://auth.interledger-test.dev/continue/4CF492MLVMSW9MKMXKHQ",
162-
"wait": 30
163-
}
164-
}
165-
```
166-
</CodeBlock>
148+
<StartInteraction />
167149

168150
### 8. Finish interaction with the user
169151

170-
The user interacts with the authorization server through the server’s interface and approves or denies the grant.
171-
172-
Provided the user approves the grant, the authorization server:
173-
174-
- Sends the user to your client’s previously defined `finish.uri`. The means by which the server sends the user to the URI is out of scope, but common options include redirecting the user from a web page and launching the system browser with the target URI.
175-
- Secures the redirect by adding a unique hash, allowing your client to validate the `finish` call, and an interaction reference as query parameters to the URI.
152+
<FinishInteraction />
176153

177154
### 9. Request a grant continuation
178155

179-
After the user completes their interaction with the identity provider (IdP), they should be redirected back to your application. At this point, you can make the grant continuation request. In scenarios where a user interface is not available, consider implementing a polling mechanism to check for the completion of the interaction.
156+
After the user completes their interaction with the identity provider (IdP), they should be redirected back to your application. Now you can make the grant continuation request. In scenarios where a user interface is not available, consider implementing a polling mechanism to check for the completion of the interaction.
180157

181-
Add the authorization server’s interaction reference, as the `interact_ref` value, to the body of your continuation request.
158+
Add the authorization server’s interaction reference as the `interact_ref` value to the body of your continuation request.
182159

183160
<ChunkedSnippet
184161
source='https://raw.githubusercontent.com/interledger/open-payments-snippets/main/grant/grant-continuation.ts'
@@ -191,8 +168,7 @@ Issue the request to the `continue uri` supplied in the authorization server’s
191168

192169
A successful continuation response from the authorization server provides your client with an access token and other information necessary to continue the transaction.
193170

194-
<CodeBlock title="Example response">
195-
```json wrap
171+
```json title="Example response" wrap
196172
{
197173
"access_token": {
198174
"value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0",
@@ -201,13 +177,7 @@ A successful continuation response from the authorization server provides your c
201177
"access": [
202178
{
203179
"type": "outgoing-payment",
204-
"actions": [
205-
"create",
206-
"read",
207-
"read-all",
208-
"list",
209-
"list-all"
210-
],
180+
"actions": ["create", "read", "read-all", "list", "list-all"],
211181
"identifier": "https://ilp.interledger-test.dev/alice",
212182
"limits": {
213183
"receiver": "https://ilp.interledger-test.dev/bob/incoming-payments/48884225-b393-4872-90de-1b737e2491c2",
@@ -230,7 +200,6 @@ A successful continuation response from the authorization server provides your c
230200
}
231201
}
232202
```
233-
</CodeBlock>
234203

235204
### 10. Create an Outgoing Payment
236205

docs/src/content/docs/guides/make-recurring-payments.mdx

+9-40
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ import { Tabs, TabItem } from '@astrojs/starlight/components'
77
import HttpSig from '/src/partials/http-msg-sig-note.mdx'
88
import ChunkedSnippet from '/src/components/ChunkedSnippet.astro'
99
import Ts from '/src/partials/ts-prerequisites.mdx'
10+
import StartInteraction from '/src/partials/grant-start-interaction.mdx'
11+
import FinishInteraction from '/src/partials/grant-finish-interaction.mdx'
1012

1113
:::tip[Summary]
12-
A client can support recurring payments by obtaining the necessary grants and calling the Open Payments APIs to create the incoming payment, quote, and multiple outgoing payment resources.
14+
Add support for recurring payments to your client. A recurring payment requires the sender's authorization once, then automatically pays out at regular intervals.
1315
:::
1416

1517
The Open Payments APIs facilitate multiple use cases for recurring payments to and from Open Payments-enabled wallets. Buy Now Pay Later (BNPL) is one example, where a purchaser pays for an item in installments over regularly scheduled intervals.
@@ -150,42 +152,17 @@ Now indicate your client can receive a signal from the authorization server when
150152

151153
### 7. Start interaction with the user
152154

153-
Once your client receives the authorization server’s response, it must send the user to the `interact.redirect` URI contained in the response. This starts the interaction flow.
154-
155-
The response also includes a `continue` object, which is essential for managing the interaction and obtaining explicit user consent for outgoing payment grants. The `continue` object contains an access token and a URI that the client will use to finalize the grant request after the user has completed their interaction with the identity provider (IdP). This ensures that the client can securely obtain the necessary permissions to proceed with the payment process.
156-
157-
<CodeBlock title="Example response">
158-
```json
159-
{
160-
"interact": {
161-
"redirect": "https://auth.interledger-test.dev/4CF492MLVMSW9MKMXKHQ",
162-
"finish": "4105340a-05eb-4290-8739-f9e2b463bfa7"
163-
},
164-
"continue": {
165-
"access_token": {
166-
"value": "33OMUKMKSKU80UPRY5NM"
167-
},
168-
"uri": "https://auth.interledger-test.dev/continue/4CF492MLVMSW9MKMXKHQ",
169-
"wait": 30
170-
}
171-
}
172-
```
173-
</CodeBlock>
155+
<StartInteraction />
174156

175157
### 8. Finish interaction with the user
176158

177-
The user interacts with the authorization server through the server’s interface and approves or denies the grant.
178-
179-
Provided the user approves the grant, the authorization server:
180-
181-
- Sends the user to your client’s previously defined `finish.uri`. The means by which the server sends the user to the URI is out of scope, but common options include redirecting the user from a web page and launching the system browser with the target URI.
182-
- Secures the redirect by adding a unique hash, allowing your client to validate the `finish` call, and an interaction reference as query parameters to the URI.
159+
<FinishInteraction />
183160

184161
### 9. Request a grant continuation
185162

186-
After the user completes their interaction with the identity provider (IdP), they should be redirected back to your application. At this point, you can make the grant continuation request. In scenarios where a user interface is not available, consider implementing a polling mechanism to check for the completion of the interaction.
163+
After the user completes their interaction with the identity provider (IdP), they should be redirected back to your application. Now you can make the grant continuation request. In scenarios where a user interface is not available, consider implementing a polling mechanism to check for the completion of the interaction.
187164

188-
Add the authorization server’s interaction reference, as the `interact_ref` value, to the body of your continuation request.
165+
Add the authorization server’s interaction reference as the `interact_ref` value to the body of your continuation request.
189166

190167
<ChunkedSnippet
191168
source='https://raw.githubusercontent.com/interledger/open-payments-snippets/main/grant/grant-continuation.ts'
@@ -198,8 +175,7 @@ Issue the request to the `continue uri` supplied in the authorization server’s
198175

199176
A successful continuation response from the authorization server provides your client with an access token and other information necessary to continue the transaction.
200177

201-
<CodeBlock title="Example response">
202-
```json wrap
178+
```json title="Example response" wrap
203179
{
204180
"access_token": {
205181
"value": "OS9M2PMHKUR64TB8N6BW7OZB8CDFONP219RP1LT0",
@@ -208,13 +184,7 @@ A successful continuation response from the authorization server provides your c
208184
"access": [
209185
{
210186
"type": "outgoing-payment",
211-
"actions": [
212-
"create",
213-
"read",
214-
"read-all",
215-
"list",
216-
"list-all"
217-
],
187+
"actions": ["create", "read", "read-all", "list", "list-all"],
218188
"identifier": "https://ilp.interledger-test.dev/alice",
219189
"limits": {
220190
"receiver": "https://ilp.interledger-test.dev/bob/incoming-payments/48884225-b393-4872-90de-1b737e2491c2",
@@ -237,7 +207,6 @@ A successful continuation response from the authorization server provides your c
237207
}
238208
}
239209
```
240-
</CodeBlock>
241210

242211
### 10. Create an initial Outgoing Payment
243212

0 commit comments

Comments
 (0)