openreceive 0.4.21 → 0.4.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/lib/openreceive/version.rb +1 -1
- data/skills/integrate-openreceive/SKILL.md +3 -0
- data/skills/integrate-openreceive/references/btcpay.md +85 -27
- data/skills/integrate-openreceive/references/django.md +55 -26
- data/skills/integrate-openreceive/references/fastapi.md +59 -31
- data/skills/integrate-openreceive/references/fastify.md +63 -33
- data/skills/integrate-openreceive/references/laravel.md +81 -32
- data/skills/integrate-openreceive/references/lovable.md +531 -0
- data/skills/integrate-openreceive/references/next.md +51 -27
- data/skills/integrate-openreceive/references/node.md +61 -31
- data/skills/integrate-openreceive/references/php.md +55 -29
- data/skills/integrate-openreceive/references/rails.md +51 -26
- data/skills/integrate-openreceive/references/woocommerce.md +41 -24
- metadata +2 -1
|
@@ -3,7 +3,7 @@ This is the full file; follow it from Step 0.
|
|
|
3
3
|
# OpenReceive agent directions (Node.js)
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
# READ THIS FIRST: this file is
|
|
6
|
+
# READ THIS FIRST: this file is 37 KB and a summary drops required steps. Download it whole:
|
|
7
7
|
curl -fsSL https://openreceive.org/agent-directions/node/full.md
|
|
8
8
|
# Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
|
|
9
9
|
```
|
|
@@ -17,7 +17,7 @@ curl -fsSL https://openreceive.org/agent-directions/node/full.md
|
|
|
17
17
|
- Do not suggest rotating or revoking a code because it was pasted here.
|
|
18
18
|
- Start the quickstart only once the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
|
|
19
19
|
|
|
20
|
-
These directions describe OpenReceive 0.4.
|
|
20
|
+
These directions describe OpenReceive 0.4.23.
|
|
21
21
|
|
|
22
22
|
Add OpenReceive to a Node application — the app you are already working in. You
|
|
23
23
|
do not need a copy of the OpenReceive source: the packages are on npm, and the
|
|
@@ -55,11 +55,12 @@ owns orders, users, prices, or fulfillment.
|
|
|
55
55
|
|
|
56
56
|
## Step 0 — ask for the two codes, one question at a time
|
|
57
57
|
|
|
58
|
-
Before anything else,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
Before anything else, check one file: the project's `.env`, if it exists.
|
|
59
|
+
`grep -E '^(NWC_URI|LSC_URI_PRIMARY)=.' .env | cut -d= -f1` names the codes
|
|
60
|
+
it sets without printing them. Check with that, here and after each write,
|
|
61
|
+
not by reading the file, and never print the values. A code that is already
|
|
62
|
+
set is not asked for again; if both are set, skip to step 5 (making the
|
|
63
|
+
server load the file), then the quickstart.
|
|
63
64
|
|
|
64
65
|
On a hosted builder (v0, Vercel, Replit, Lovable), the user may say instead
|
|
65
66
|
that both codes are already set as the project's environment variables or
|
|
@@ -95,14 +96,17 @@ you store it. Ask one question per message.
|
|
|
95
96
|
Do not mention `.env`, exports, or "tell me when it's set".
|
|
96
97
|
2. **When they paste it.** If it does not start with `nostr+walletconnect://`,
|
|
97
98
|
ask them to copy the receive-only code again. Otherwise write
|
|
98
|
-
`NWC_URI=<paste>` into the project's `.env
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
99
|
+
`NWC_URI=<paste>` into the project's `.env` with your file-editing tool,
|
|
100
|
+
creating the file if needed. Never write it with a shell command (`echo`,
|
|
101
|
+
`printf`, a heredoc, `python -c`): the command line shows the code. Make
|
|
102
|
+
sure `.gitignore` covers `.env` (and `.dockerignore`, if the app has one).
|
|
103
|
+
Never echo the value, commit it, or put it in client code. Reply only that
|
|
104
|
+
it is saved, then ask the next question.
|
|
105
|
+
3. **Second message — swaps.** If the user asked for stablecoins, USDT, USDC,
|
|
106
|
+
ETH, SOL, altcoins or "crypto" (as in "Bitcoin and stablecoin payments"),
|
|
107
|
+
this message IS the walkthrough below: send it as it is, and do not ask yes
|
|
108
|
+
or no first. Otherwise ask whether payers should also be able to pay with
|
|
109
|
+
USDT, USDC, ETH or SOL, then give the walkthrough. The walkthrough:
|
|
106
110
|
|
|
107
111
|
> Go to https://lightning-swap.com, sign in for API keys, create a key, and
|
|
108
112
|
> copy the whole URI (https://openreceive.org/set_up_swap_provider). Paste
|
|
@@ -112,10 +116,10 @@ you store it. Ask one question per message.
|
|
|
112
116
|
Mention FixedFloat only if they already use it.
|
|
113
117
|
4. **When they paste it.** If it does not start with
|
|
114
118
|
`lightning+swapconnect://`, ask them to copy it again. Otherwise add
|
|
115
|
-
`LSC_URI_PRIMARY=<paste>` to the same `.env
|
|
116
|
-
are now on, so build the refund route back
|
|
117
|
-
part of this integration. If they chose
|
|
118
|
-
`LSC_URI_PRIMARY` unset and skip that route.
|
|
119
|
+
`LSC_URI_PRIMARY=<paste>` to the same `.env` with the file-editing tool,
|
|
120
|
+
never a shell command. Swaps are now on, so build the refund route back
|
|
121
|
+
(the swap non-negotiable below) as part of this integration. If they chose
|
|
122
|
+
Bitcoin only, leave `LSC_URI_PRIMARY` unset and skip that route.
|
|
119
123
|
5. **Make the server load the file — yourself.** OpenReceive reads
|
|
120
124
|
`process.env`, and a `.env` file on disk is not in it. Put
|
|
121
125
|
`import "dotenv/config";` at the top of the server entry, as the quickstart
|
|
@@ -148,24 +152,29 @@ names any failed check and exits nonzero; fix it before going on.
|
|
|
148
152
|
Doctor reads `.env` itself. Never source it into a shell: the `&` in a
|
|
149
153
|
code splits the value and prints the pieces.
|
|
150
154
|
|
|
151
|
-
Give the user that checkout link. The browser check in the quickstart's
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
Give the user that checkout link. The browser check in the quickstart's step 6
|
|
156
|
+
(payment-method icons, wallet logos, a pay tutorial) is theirs: name it in one
|
|
157
|
+
line of your closing message, and do not run it yourself.
|
|
154
158
|
|
|
155
159
|
You cannot pay the invoice: the code is receive-only. Do not pay, settle or
|
|
156
160
|
mark an order paid, and do not look for a way to (a wallet control port, a
|
|
157
161
|
test endpoint, another wallet). If the user wants a real settlement test, they
|
|
158
162
|
pay on that link from their own wallet, and `onPaid` marks the order paid.
|
|
159
163
|
|
|
160
|
-
Setup ends here.
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
Setup ends here. Your last message starts "Setup is finished" and has at most
|
|
165
|
+
five short lines (about 80 characters each): the link, the methods it offers,
|
|
166
|
+
and one line of what to look at. Send nothing after it. Do not list what
|
|
167
|
+
changed, copy out the quickstart's browser checklist, offer more work, or end
|
|
168
|
+
the message on a question.
|
|
163
169
|
|
|
164
170
|
- The link is to a real unpaid order. Keep that order; do not delete it.
|
|
171
|
+
- When this app's orders belong to a session or cookie, the user's browser
|
|
172
|
+
cannot open the order you made. Then the link is the shop's own page:
|
|
173
|
+
"Open <shop url> and click Buy: it opens the checkout." Do not explain order
|
|
174
|
+
ownership or mention your test order.
|
|
165
175
|
- Name the methods it offers: Bitcoin, plus USDT, USDC, ETH and SOL when
|
|
166
|
-
`LSC_URI_PRIMARY` is saved.
|
|
167
|
-
|
|
168
|
-
order's total says so on its own tile.
|
|
176
|
+
`LSC_URI_PRIMARY` is saved. Do not mention minimums, and never say a coin
|
|
177
|
+
will not work or will not be offered.
|
|
169
178
|
|
|
170
179
|
## Non-negotiables
|
|
171
180
|
|
|
@@ -182,6 +191,21 @@ itself, and they hold for every integration.
|
|
|
182
191
|
- Work only in this application. Never read or run anything from another
|
|
183
192
|
project on this machine (its `node_modules`, tools or source), for any
|
|
184
193
|
reason. A browser and Playwright are not part of setup.
|
|
194
|
+
- Restart only this app's server, on the port it already uses: stop the
|
|
195
|
+
process you started, or the one listening on that port, by its pid (or
|
|
196
|
+
restart its Compose service). Never `pkill` or `killall` by name: that
|
|
197
|
+
stops other people's servers too. Start it the way this project already
|
|
198
|
+
does (its README, Procfile, compose file or package script), on its own
|
|
199
|
+
port, not a port you pick.
|
|
200
|
+
- Run commands where the app runs. When a compose file builds it, run its
|
|
201
|
+
package manager, generators, migrations and doctor inside that service
|
|
202
|
+
(`docker compose exec` or `run`), and rebuild the image after adding a
|
|
203
|
+
package. This machine's language version and database path are not the
|
|
204
|
+
app's.
|
|
205
|
+
- To check that the running app sees the codes, run doctor: it reports each
|
|
206
|
+
one as present or missing and never prints a value. Never print the
|
|
207
|
+
environment (`printenv`, `env`, `docker compose config`), even filtered to
|
|
208
|
+
names.
|
|
185
209
|
- The host owns the price. `amountFor` reads it from your own data; reject
|
|
186
210
|
payer-supplied amounts.
|
|
187
211
|
- `authorize` runs on every request, and the `resource` it receives is a CLAIM
|
|
@@ -252,7 +276,10 @@ products, and you do not join them.
|
|
|
252
276
|
are buying.
|
|
253
277
|
- **Users own the order; OpenReceive never sees them.** `authorize` uses the
|
|
254
278
|
same ownership check this app already uses on the order show / pay page —
|
|
255
|
-
`sessions.currentUser(
|
|
279
|
+
`sessions.currentUser(native)`, a cookie, whatever it is. Pass `native` (the
|
|
280
|
+
Express request) to this app's own cookie and session helpers, never
|
|
281
|
+
`request`: that one is a Web Request, a helper that reads
|
|
282
|
+
`req.headers.cookie` finds nothing on it, and every payer gets a 403.
|
|
256
283
|
`resource.reference` is a claim the payer sent, not proof.
|
|
257
284
|
- **The order is unpaid or paid.** Do not copy `pending` / `expired` / `failed`
|
|
258
285
|
/ `attention` onto it. Those are attempt statuses on `openreceive_payments`. An
|
|
@@ -505,9 +532,12 @@ const openreceive = openReceiveExpress({
|
|
|
505
532
|
// Your own access check: may this caller do this action to this reference?
|
|
506
533
|
// `resource.reference` is your own order id, sent back by the payer's
|
|
507
534
|
// browser — a claim, not proof — already validated as a non-empty string.
|
|
508
|
-
|
|
535
|
+
// `native` is the untouched Express request: pass it to this app's own
|
|
536
|
+
// cookie and session helpers. `request` is a Web Request, so a helper that
|
|
537
|
+
// reads `req.headers.cookie` finds nothing on it and every payer gets a 403.
|
|
538
|
+
authorize: async ({ action, native, resource }) =>
|
|
509
539
|
orders.viewerMay(
|
|
510
|
-
await sessions.currentUser(
|
|
540
|
+
await sessions.currentUser(native),
|
|
511
541
|
resource.reference,
|
|
512
542
|
action,
|
|
513
543
|
),
|
|
@@ -3,7 +3,7 @@ This is the full file; follow it from Step 0.
|
|
|
3
3
|
# OpenReceive agent directions (PHP)
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
# READ THIS FIRST: this file is
|
|
6
|
+
# READ THIS FIRST: this file is 40 KB and a summary drops required steps. Download it whole:
|
|
7
7
|
curl -fsSL https://openreceive.org/agent-directions/php/full.md
|
|
8
8
|
# Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
|
|
9
9
|
```
|
|
@@ -17,7 +17,7 @@ curl -fsSL https://openreceive.org/agent-directions/php/full.md
|
|
|
17
17
|
- Do not suggest rotating or revoking a code because it was pasted here.
|
|
18
18
|
- Start the quickstart only once the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
|
|
19
19
|
|
|
20
|
-
These directions describe OpenReceive 0.4.
|
|
20
|
+
These directions describe OpenReceive 0.4.23.
|
|
21
21
|
|
|
22
22
|
Add OpenReceive to a PHP application — the app you are already working in. You
|
|
23
23
|
do not need a copy of the OpenReceive source: the engine is on Packagist
|
|
@@ -59,11 +59,12 @@ owns orders, users, prices, or fulfillment.
|
|
|
59
59
|
|
|
60
60
|
## Step 0 — ask for the two codes, one question at a time
|
|
61
61
|
|
|
62
|
-
Before anything else,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
Before anything else, check one file: the project's `.env`, if it exists.
|
|
63
|
+
`grep -E '^(NWC_URI|LSC_URI_PRIMARY)=.' .env | cut -d= -f1` names the codes
|
|
64
|
+
it sets without printing them. Check with that, here and after each write,
|
|
65
|
+
not by reading the file, and never print the values. A code that is already
|
|
66
|
+
set is not asked for again; if both are set, skip to step 5 (making the
|
|
67
|
+
server load the file), then the quickstart.
|
|
67
68
|
|
|
68
69
|
Otherwise your next action is a question to the user. Do not run `composer require`,
|
|
69
70
|
edit the app, write `.env.example`, or search anywhere else before asking
|
|
@@ -94,14 +95,17 @@ you store it. Ask one question per message.
|
|
|
94
95
|
Do not mention `.env`, exports, or "tell me when it's set".
|
|
95
96
|
2. **When they paste it.** If it does not start with `nostr+walletconnect://`,
|
|
96
97
|
ask them to copy the receive-only code again. Otherwise write
|
|
97
|
-
`NWC_URI=<paste>` into the project's `.env
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
`NWC_URI=<paste>` into the project's `.env` with your file-editing tool,
|
|
99
|
+
creating the file if needed. Never write it with a shell command (`echo`,
|
|
100
|
+
`printf`, a heredoc, `python -c`): the command line shows the code. Make
|
|
101
|
+
sure `.gitignore` covers `.env` (and `.dockerignore`, if the app has one).
|
|
102
|
+
Never echo the value, commit it, or put it in client code. Reply only that
|
|
103
|
+
it is saved, then ask the next question.
|
|
104
|
+
3. **Second message — swaps.** If the user asked for stablecoins, USDT, USDC,
|
|
105
|
+
ETH, SOL, altcoins or "crypto" (as in "Bitcoin and stablecoin payments"),
|
|
106
|
+
this message IS the walkthrough below: send it as it is, and do not ask yes
|
|
107
|
+
or no first. Otherwise ask whether payers should also be able to pay with
|
|
108
|
+
USDT, USDC, ETH or SOL, then give the walkthrough. The walkthrough:
|
|
105
109
|
|
|
106
110
|
> Go to https://lightning-swap.com, sign in for API keys, create a key, and
|
|
107
111
|
> copy the whole URI (https://openreceive.org/set_up_swap_provider). Paste
|
|
@@ -111,10 +115,10 @@ you store it. Ask one question per message.
|
|
|
111
115
|
Mention FixedFloat only if they already use it.
|
|
112
116
|
4. **When they paste it.** If it does not start with
|
|
113
117
|
`lightning+swapconnect://`, ask them to copy it again. Otherwise add
|
|
114
|
-
`LSC_URI_PRIMARY=<paste>` to the same `.env
|
|
115
|
-
are now on, so build the refund route back
|
|
116
|
-
part of this integration. If they chose
|
|
117
|
-
`LSC_URI_PRIMARY` unset and skip that route.
|
|
118
|
+
`LSC_URI_PRIMARY=<paste>` to the same `.env` with the file-editing tool,
|
|
119
|
+
never a shell command. Swaps are now on, so build the refund route back
|
|
120
|
+
(the swap non-negotiable below) as part of this integration. If they chose
|
|
121
|
+
Bitcoin only, leave `LSC_URI_PRIMARY` unset and skip that route.
|
|
118
122
|
5. **Make the server load the file — yourself.** Nothing in PHP
|
|
119
123
|
reads `.env` on its own. Add `vlucas/phpdotenv` and load the file in the
|
|
120
124
|
front controller before `Service::fromEnvironment()`. When the app is started
|
|
@@ -129,8 +133,10 @@ again. Never set the spend-capable override to get past it.
|
|
|
129
133
|
|
|
130
134
|
Then check the PHP runtime: `php -m` must list `gmp`, `sodium`, `mbstring`,
|
|
131
135
|
`json`, `pdo` and one PDO driver. `ext-gmp` is REQUIRED — the NWC transport
|
|
132
|
-
signs every request with it — and `php:*-cli`/`-fpm` images do not ship it
|
|
133
|
-
|
|
136
|
+
signs every request with it — and `php:*-cli`/`-fpm` images do not ship it:
|
|
137
|
+
install `libgmp-dev` first, then `docker-php-ext-install gmp`, in the
|
|
138
|
+
Dockerfile. Never pass `--ignore-platform-req=ext-gmp` to Composer. PHP must
|
|
139
|
+
be ≥ 8.2 and 64-bit.
|
|
134
140
|
|
|
135
141
|
### Upgrading an existing install
|
|
136
142
|
|
|
@@ -155,23 +161,28 @@ this app serves the checkout page for one of its orders. Doctor names any
|
|
|
155
161
|
failed check; fix it before going on.
|
|
156
162
|
|
|
157
163
|
Give the user that checkout link. The browser check in the quickstart's step 6
|
|
158
|
-
(payment-method icons, wallet logos, a pay tutorial) is theirs:
|
|
159
|
-
|
|
164
|
+
(payment-method icons, wallet logos, a pay tutorial) is theirs: name it in one
|
|
165
|
+
line of your closing message, and do not run it yourself.
|
|
160
166
|
|
|
161
167
|
You cannot pay the invoice: the code is receive-only. Do not pay, settle or
|
|
162
168
|
mark an order paid, and do not look for a way to (a wallet control port, a
|
|
163
169
|
test endpoint, another wallet). If the user wants a real settlement test, they
|
|
164
170
|
pay on that link from their own wallet, and `onPaid` marks the order paid.
|
|
165
171
|
|
|
166
|
-
Setup ends here.
|
|
167
|
-
|
|
168
|
-
|
|
172
|
+
Setup ends here. Your last message starts "Setup is finished" and has at most
|
|
173
|
+
five short lines (about 80 characters each): the link, the methods it offers,
|
|
174
|
+
and one line of what to look at. Send nothing after it. Do not list what
|
|
175
|
+
changed, copy out the quickstart's browser checklist, offer more work, or end
|
|
176
|
+
the message on a question.
|
|
169
177
|
|
|
170
178
|
- The link is to a real unpaid order. Keep that order; do not delete it.
|
|
179
|
+
- When this app's orders belong to a session or cookie, the user's browser
|
|
180
|
+
cannot open the order you made. Then the link is the shop's own page:
|
|
181
|
+
"Open <shop url> and click Buy: it opens the checkout." Do not explain order
|
|
182
|
+
ownership or mention your test order.
|
|
171
183
|
- Name the methods it offers: Bitcoin, plus USDT, USDC, ETH and SOL when
|
|
172
|
-
`LSC_URI_PRIMARY` is saved.
|
|
173
|
-
|
|
174
|
-
order's total says so on its own tile.
|
|
184
|
+
`LSC_URI_PRIMARY` is saved. Do not mention minimums, and never say a coin
|
|
185
|
+
will not work or will not be offered.
|
|
175
186
|
|
|
176
187
|
## Non-negotiables
|
|
177
188
|
|
|
@@ -188,6 +199,21 @@ itself, and they hold for every integration.
|
|
|
188
199
|
- Work only in this application. Never read or run anything from another
|
|
189
200
|
project on this machine (its `node_modules`, tools or source), for any
|
|
190
201
|
reason. A browser and Playwright are not part of setup.
|
|
202
|
+
- Restart only this app's server, on the port it already uses: stop the
|
|
203
|
+
process you started, or the one listening on that port, by its pid (or
|
|
204
|
+
restart its Compose service). Never `pkill` or `killall` by name: that
|
|
205
|
+
stops other people's servers too. Start it the way this project already
|
|
206
|
+
does (its README, Procfile, compose file or package script), on its own
|
|
207
|
+
port, not a port you pick.
|
|
208
|
+
- Run commands where the app runs. When a compose file builds it, run its
|
|
209
|
+
package manager, generators, migrations and doctor inside that service
|
|
210
|
+
(`docker compose exec` or `run`), and rebuild the image after adding a
|
|
211
|
+
package. This machine's language version and database path are not the
|
|
212
|
+
app's.
|
|
213
|
+
- To check that the running app sees the codes, run doctor: it reports each
|
|
214
|
+
one as present or missing and never prints a value. Never print the
|
|
215
|
+
environment (`printenv`, `env`, `docker compose config`), even filtered to
|
|
216
|
+
names.
|
|
191
217
|
- The host owns the price. `amountFor` reads it from your own data; reject
|
|
192
218
|
payer-supplied amounts.
|
|
193
219
|
- `authorize` runs on every request, and the `resource` it receives is a CLAIM
|
|
@@ -3,7 +3,7 @@ This is the full file; follow it from Step 0.
|
|
|
3
3
|
# OpenReceive agent directions (Rails)
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
# READ THIS FIRST: this file is
|
|
6
|
+
# READ THIS FIRST: this file is 42 KB and a summary drops required steps. Download it whole:
|
|
7
7
|
curl -fsSL https://openreceive.org/agent-directions/rails/full.md
|
|
8
8
|
# Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
|
|
9
9
|
```
|
|
@@ -17,7 +17,7 @@ curl -fsSL https://openreceive.org/agent-directions/rails/full.md
|
|
|
17
17
|
- Do not suggest rotating or revoking a code because it was pasted here.
|
|
18
18
|
- Start the quickstart only once the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
|
|
19
19
|
|
|
20
|
-
These directions describe OpenReceive 0.4.
|
|
20
|
+
These directions describe OpenReceive 0.4.23.
|
|
21
21
|
|
|
22
22
|
Add OpenReceive to a Rails application — the app you are already working in. You
|
|
23
23
|
do not need a copy of the OpenReceive source: the gem is on RubyGems, the
|
|
@@ -57,11 +57,12 @@ owns orders, users, prices, or fulfillment.
|
|
|
57
57
|
|
|
58
58
|
## Step 0 — ask for the two codes, one question at a time
|
|
59
59
|
|
|
60
|
-
Before anything else,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
Before anything else, check one file: the project's `.env`, if it exists.
|
|
61
|
+
`grep -E '^(NWC_URI|LSC_URI_PRIMARY)=.' .env | cut -d= -f1` names the codes
|
|
62
|
+
it sets without printing them. Check with that, here and after each write,
|
|
63
|
+
not by reading the file, and never print the values. A code that is already
|
|
64
|
+
set is not asked for again; if both are set, skip to step 5 (making the
|
|
65
|
+
server load the file), then the quickstart.
|
|
65
66
|
|
|
66
67
|
Otherwise your next action is a question to the user. Do not install the gem,
|
|
67
68
|
edit the app, write `.env.example`, or search anywhere else before asking
|
|
@@ -92,14 +93,17 @@ you store it. Ask one question per message.
|
|
|
92
93
|
Do not mention `.env`, exports, or "tell me when it's set".
|
|
93
94
|
2. **When they paste it.** If it does not start with `nostr+walletconnect://`,
|
|
94
95
|
ask them to copy the receive-only code again. Otherwise write
|
|
95
|
-
`NWC_URI=<paste>` into the project's `.env
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
`NWC_URI=<paste>` into the project's `.env` with your file-editing tool,
|
|
97
|
+
creating the file if needed. Never write it with a shell command (`echo`,
|
|
98
|
+
`printf`, a heredoc, `python -c`): the command line shows the code. Make
|
|
99
|
+
sure `.gitignore` covers `.env` (and `.dockerignore`, if the app has one).
|
|
100
|
+
Never echo the value, commit it, or put it in client code. Reply only that
|
|
101
|
+
it is saved, then ask the next question.
|
|
102
|
+
3. **Second message — swaps.** If the user asked for stablecoins, USDT, USDC,
|
|
103
|
+
ETH, SOL, altcoins or "crypto" (as in "Bitcoin and stablecoin payments"),
|
|
104
|
+
this message IS the walkthrough below: send it as it is, and do not ask yes
|
|
105
|
+
or no first. Otherwise ask whether payers should also be able to pay with
|
|
106
|
+
USDT, USDC, ETH or SOL, then give the walkthrough. The walkthrough:
|
|
103
107
|
|
|
104
108
|
> Go to https://lightning-swap.com, sign in for API keys, create a key, and
|
|
105
109
|
> copy the whole URI (https://openreceive.org/set_up_swap_provider). Paste
|
|
@@ -109,10 +113,10 @@ you store it. Ask one question per message.
|
|
|
109
113
|
Mention FixedFloat only if they already use it.
|
|
110
114
|
4. **When they paste it.** If it does not start with
|
|
111
115
|
`lightning+swapconnect://`, ask them to copy it again. Otherwise add
|
|
112
|
-
`LSC_URI_PRIMARY=<paste>` to the same `.env
|
|
113
|
-
are now on, so build the refund route back
|
|
114
|
-
part of this integration. If they chose
|
|
115
|
-
`LSC_URI_PRIMARY` unset and skip that route.
|
|
116
|
+
`LSC_URI_PRIMARY=<paste>` to the same `.env` with the file-editing tool,
|
|
117
|
+
never a shell command. Swaps are now on, so build the refund route back
|
|
118
|
+
(the swap non-negotiable below) as part of this integration. If they chose
|
|
119
|
+
Bitcoin only, leave `LSC_URI_PRIMARY` unset and skip that route.
|
|
116
120
|
5. **Make the server load the file — yourself.** Rails does not read
|
|
117
121
|
`.env` on its own. When the app is started with `bin/rails` or `bin/dev`,
|
|
118
122
|
add `dotenv-rails` to the Gemfile. When it is started with Docker Compose,
|
|
@@ -147,22 +151,28 @@ check; fix it before going on.
|
|
|
147
151
|
|
|
148
152
|
Give the user that checkout link. The browser check in the quickstart's
|
|
149
153
|
"Render the checkout" section (payment-method icons, wallet logos, a pay
|
|
150
|
-
tutorial) is theirs:
|
|
154
|
+
tutorial) is theirs: name it in one line of your closing message, and do not
|
|
155
|
+
run it yourself.
|
|
151
156
|
|
|
152
157
|
You cannot pay the invoice: the code is receive-only. Do not pay, settle or
|
|
153
158
|
mark an order paid, and do not look for a way to (a wallet control port, a
|
|
154
159
|
test endpoint, another wallet). If the user wants a real settlement test, they
|
|
155
160
|
pay on that link from their own wallet, and `on_paid` marks the order paid.
|
|
156
161
|
|
|
157
|
-
Setup ends here.
|
|
158
|
-
|
|
159
|
-
|
|
162
|
+
Setup ends here. Your last message starts "Setup is finished" and has at most
|
|
163
|
+
five short lines (about 80 characters each): the link, the methods it offers,
|
|
164
|
+
and one line of what to look at. Send nothing after it. Do not list what
|
|
165
|
+
changed, copy out the quickstart's browser checklist, offer more work, or end
|
|
166
|
+
the message on a question.
|
|
160
167
|
|
|
161
168
|
- The link is to a real unpaid order. Keep that order; do not delete it.
|
|
169
|
+
- When this app's orders belong to a session or cookie, the user's browser
|
|
170
|
+
cannot open the order you made. Then the link is the shop's own page:
|
|
171
|
+
"Open <shop url> and click Buy: it opens the checkout." Do not explain order
|
|
172
|
+
ownership or mention your test order.
|
|
162
173
|
- Name the methods it offers: Bitcoin, plus USDT, USDC, ETH and SOL when
|
|
163
|
-
`LSC_URI_PRIMARY` is saved.
|
|
164
|
-
|
|
165
|
-
order's total says so on its own tile.
|
|
174
|
+
`LSC_URI_PRIMARY` is saved. Do not mention minimums, and never say a coin
|
|
175
|
+
will not work or will not be offered.
|
|
166
176
|
|
|
167
177
|
## Non-negotiables
|
|
168
178
|
|
|
@@ -179,6 +189,21 @@ itself, and they hold for every integration.
|
|
|
179
189
|
- Work only in this application. Never read or run anything from another
|
|
180
190
|
project on this machine (its `node_modules`, tools or source), for any
|
|
181
191
|
reason. A browser and Playwright are not part of setup.
|
|
192
|
+
- Restart only this app's server, on the port it already uses: stop the
|
|
193
|
+
process you started, or the one listening on that port, by its pid (or
|
|
194
|
+
restart its Compose service). Never `pkill` or `killall` by name: that
|
|
195
|
+
stops other people's servers too. Start it the way this project already
|
|
196
|
+
does (its README, Procfile, compose file or package script), on its own
|
|
197
|
+
port, not a port you pick.
|
|
198
|
+
- Run commands where the app runs. When a compose file builds it, run its
|
|
199
|
+
package manager, generators, migrations and doctor inside that service
|
|
200
|
+
(`docker compose exec` or `run`), and rebuild the image after adding a
|
|
201
|
+
package. This machine's language version and database path are not the
|
|
202
|
+
app's.
|
|
203
|
+
- To check that the running app sees the codes, run doctor: it reports each
|
|
204
|
+
one as present or missing and never prints a value. Never print the
|
|
205
|
+
environment (`printenv`, `env`, `docker compose config`), even filtered to
|
|
206
|
+
names.
|
|
182
207
|
- The host owns the price. `config.amount_for` reads it from your own data;
|
|
183
208
|
reject payer-supplied amounts.
|
|
184
209
|
- `config.authorize` runs on every request, and the `resource` it receives is a
|
|
@@ -3,7 +3,7 @@ This is the full file; follow it from Step 0.
|
|
|
3
3
|
# OpenReceive agent directions (WordPress + WooCommerce)
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
# READ THIS FIRST: this file is
|
|
6
|
+
# READ THIS FIRST: this file is 23 KB and a summary drops required steps. Download it whole:
|
|
7
7
|
curl -fsSL https://openreceive.org/agent-directions/woocommerce/full.md
|
|
8
8
|
# Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
|
|
9
9
|
```
|
|
@@ -17,7 +17,7 @@ curl -fsSL https://openreceive.org/agent-directions/woocommerce/full.md
|
|
|
17
17
|
- Do not suggest rotating or revoking a code because it was pasted here.
|
|
18
18
|
- Setup is done only when the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
|
|
19
19
|
|
|
20
|
-
These directions describe OpenReceive 0.4.
|
|
20
|
+
These directions describe OpenReceive 0.4.23.
|
|
21
21
|
|
|
22
22
|
Install and configure the OpenReceive payment gateway in the WooCommerce store
|
|
23
23
|
you are working in. Preserve its theme, checkout, customer accounts, order
|
|
@@ -92,20 +92,27 @@ is saved or the user said "Bitcoin only". Never invent a placeholder code.
|
|
|
92
92
|
|
|
93
93
|
## Step 1 — install the plugin
|
|
94
94
|
|
|
95
|
-
Install
|
|
95
|
+
Install this release from the WordPress.org plugin directory:
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
wp plugin install openreceive --version=0.4.23 --activate
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
If that fails because WordPress.org does not have this version yet, install
|
|
102
|
+
the ZIP attached to the same GitHub release. Never install the GitHub
|
|
96
103
|
source-code ZIP or a ZIP from an older release:
|
|
97
104
|
|
|
98
105
|
```sh
|
|
99
|
-
wp plugin install https://github.com/OpenReceive/openreceive/releases/download/v0.4.
|
|
106
|
+
wp plugin install https://github.com/OpenReceive/openreceive/releases/download/v0.4.23/openreceive-wordpress-0.4.23.zip --activate
|
|
100
107
|
```
|
|
101
108
|
|
|
102
109
|
It needs WooCommerce active, and PHP 8.2+ with GMP and sodium in BOTH the web
|
|
103
110
|
PHP and the WP-CLI PHP. On the official `wordpress` and `wordpress:cli` Docker
|
|
104
|
-
images, activation
|
|
105
|
-
|
|
111
|
+
images, activation warns "OpenReceive is not running: this site needs the PHP
|
|
112
|
+
GMP extension" and the plugin stays idle: add GMP to both images as "Enable GMP in both PHP runtimes" below
|
|
106
113
|
says, rebuild both, then install again. If the Compose file has only `image:`
|
|
107
114
|
lines, use the two Dockerfiles and `build:` keys under "Compose files with only
|
|
108
|
-
`image:` lines" below, and add no other service. If the URL answers 404, build the same
|
|
115
|
+
`image:` lines" below, and add no other service. If the ZIP URL answers 404, build the same
|
|
109
116
|
tag as "Get the installable archive" below says.
|
|
110
117
|
|
|
111
118
|
## Step 2 — store the codes, then enable the gateway
|
|
@@ -163,13 +170,19 @@ pay on the order-pay link from their own wallet; afterwards
|
|
|
163
170
|
`wp wc shop_order get <order id> --user=<admin user id> --field=status` is no
|
|
164
171
|
longer `pending`.
|
|
165
172
|
|
|
166
|
-
Setup ends here. Once doctor is clean and the user has the link,
|
|
167
|
-
is finished
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
+
Setup ends here. Once doctor is clean and the user has the link, your last
|
|
174
|
+
message starts "Setup is finished" and has at most six short lines: the pay
|
|
175
|
+
link, the methods the checkout offers (Bitcoin, plus USDT, USDC, ETH and SOL
|
|
176
|
+
when the swap code is saved), and one line of what to look at. Do not list
|
|
177
|
+
each coin's availability, mention a minimum, or say a coin will not work: a
|
|
178
|
+
provider minimum depends on the order total, and the user's own orders will
|
|
179
|
+
differ. Do not list what you changed or what doctor checked. Send nothing
|
|
180
|
+
after it. Do not install mail software, add containers or services, or set up
|
|
181
|
+
cron. If doctor's "Reconcile scheduled" check fails, fix that. On a store with
|
|
182
|
+
little traffic, add one sentence to that message: a system cron for WordPress
|
|
183
|
+
scheduled work settles orders sooner, and this setup does not add one. State
|
|
184
|
+
it as a recommendation. Do not offer to set it up or end the message on a
|
|
185
|
+
question.
|
|
173
186
|
|
|
174
187
|
## Non-negotiables
|
|
175
188
|
|
|
@@ -224,10 +237,11 @@ The [WordPress integration entry point](https://openreceive.org/integrations/wor
|
|
|
224
237
|
redirects to the WooCommerce integration, which uses this same guide and agent
|
|
225
238
|
directions. OpenReceive checkout on WordPress requires WooCommerce.
|
|
226
239
|
|
|
227
|
-
Activate WooCommerce first. Then install
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
240
|
+
Activate WooCommerce first. Then install OpenReceive from the
|
|
241
|
+
[WordPress.org plugin directory](https://wordpress.org/plugins/openreceive/):
|
|
242
|
+
in **Plugins → Add New**, search for **OpenReceive**, then install and
|
|
243
|
+
activate it. With WP-CLI, run `wp plugin install openreceive --activate`.
|
|
244
|
+
WordPress offers each new release as an ordinary plugin update.
|
|
231
245
|
|
|
232
246
|
Requirements: WordPress 6.6+, WooCommerce 9+, 64-bit PHP 8.2+ with GMP and sodium,
|
|
233
247
|
and MySQL 8 or MariaDB 10.5+. When you activate the plugin, it creates tables for
|
|
@@ -236,16 +250,19 @@ database or application.
|
|
|
236
250
|
|
|
237
251
|
### Get the installable archive
|
|
238
252
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
253
|
+
Each GitHub release also attaches the same plugin as a ZIP, for a site that
|
|
254
|
+
cannot reach WordPress.org or when WordPress.org does not list a release yet.
|
|
255
|
+
Download [openreceive-wordpress-0.4.23.zip](https://github.com/OpenReceive/openreceive/releases/download/v0.4.23/openreceive-wordpress-0.4.23.zip)
|
|
256
|
+
and install it through **Plugins → Add New → Upload Plugin**. Historical
|
|
257
|
+
releases may lack this asset. If that exact URL returns 404, build the same tag
|
|
258
|
+
below; never silently install an older ZIP. The GitHub source-code ZIP is not
|
|
259
|
+
an installable plugin. On a development machine with Node 22+, PHP 8.2+ with
|
|
260
|
+
GMP/sodium, Composer and WP-CLI:
|
|
244
261
|
|
|
245
262
|
```sh
|
|
246
263
|
git clone https://github.com/OpenReceive/openreceive.git
|
|
247
264
|
cd openreceive
|
|
248
|
-
git checkout v0.4.
|
|
265
|
+
git checkout v0.4.23
|
|
249
266
|
npm ci
|
|
250
267
|
npm run build:packages
|
|
251
268
|
composer install --working-dir=packages/php/wordpress
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: openreceive
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.23
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- OpenReceive
|
|
@@ -61,6 +61,7 @@ files:
|
|
|
61
61
|
- skills/integrate-openreceive/references/fastapi.md
|
|
62
62
|
- skills/integrate-openreceive/references/fastify.md
|
|
63
63
|
- skills/integrate-openreceive/references/laravel.md
|
|
64
|
+
- skills/integrate-openreceive/references/lovable.md
|
|
64
65
|
- skills/integrate-openreceive/references/next.md
|
|
65
66
|
- skills/integrate-openreceive/references/node.md
|
|
66
67
|
- skills/integrate-openreceive/references/php.md
|