openreceive 0.4.26 → 0.4.28
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 +14 -0
- data/lib/openreceive/version.rb +1 -1
- data/skills/integrate-openreceive/SKILL.md +37 -5
- data/skills/integrate-openreceive/references/astro.md +653 -0
- data/skills/integrate-openreceive/references/bolt.md +580 -0
- data/skills/integrate-openreceive/references/btcpay.md +1 -1
- data/skills/integrate-openreceive/references/django.md +23 -2
- data/skills/integrate-openreceive/references/edd.md +407 -0
- data/skills/integrate-openreceive/references/fastapi.md +23 -2
- data/skills/integrate-openreceive/references/fastify.md +31 -6
- data/skills/integrate-openreceive/references/flask.md +23 -2
- data/skills/integrate-openreceive/references/fossbilling.md +433 -0
- data/skills/integrate-openreceive/references/laravel.md +1 -1
- data/skills/integrate-openreceive/references/lovable.md +6 -2
- data/skills/integrate-openreceive/references/medusa.md +468 -0
- data/skills/integrate-openreceive/references/mobile.md +492 -0
- data/skills/integrate-openreceive/references/nestjs.md +41 -16
- data/skills/integrate-openreceive/references/next.md +34 -7
- data/skills/integrate-openreceive/references/node.md +34 -7
- data/skills/integrate-openreceive/references/nuxt.md +606 -0
- data/skills/integrate-openreceive/references/paymenter.md +369 -0
- data/skills/integrate-openreceive/references/php.md +7 -4
- data/skills/integrate-openreceive/references/rails.md +14 -9
- data/skills/integrate-openreceive/references/react-router.md +617 -0
- data/skills/integrate-openreceive/references/sveltekit.md +650 -0
- data/skills/integrate-openreceive/references/tanstack-start.md +734 -0
- data/skills/integrate-openreceive/references/woocommerce.md +8 -6
- metadata +12 -1
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
This is the full file; follow it from Step 0.
|
|
2
|
+
|
|
3
|
+
# OpenReceive agent directions (Paymenter)
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
# READ THIS FIRST: this file is 19 KB and a summary drops required steps. Download it whole:
|
|
7
|
+
curl -fsSL https://openreceive.org/agent-directions/paymenter/full.md
|
|
8
|
+
# Skip the download only if you already have all of it: pasted, read from disk or fetched raw.
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Step 0 in brief** (Step 0 below has the details):
|
|
12
|
+
|
|
13
|
+
- Before installing or editing anything, ask the user for a receive-only NWC code. One question per message.
|
|
14
|
+
- Next ask for the LSC code. If the user wants stablecoins, USDT, USDC, ETH, SOL or crypto, do not ask yes/no first.
|
|
15
|
+
- The user only pastes codes into this chat. Never ask them to run a command, edit a file or use an admin page.
|
|
16
|
+
- Store each code yourself as Step 2 says. Never put a code in a shell command.
|
|
17
|
+
- Do not suggest rotating or revoking a code because it was pasted here.
|
|
18
|
+
- Setup is done only when the NWC code is saved, and the LSC code is saved or the user said "Bitcoin only".
|
|
19
|
+
|
|
20
|
+
These directions describe OpenReceive 0.4.28.
|
|
21
|
+
|
|
22
|
+
Install and configure the OpenReceive payment gateway in the Paymenter billing
|
|
23
|
+
panel you are working in. Preserve its theme, clients, products, invoices and
|
|
24
|
+
prices. The extension is one folder that bundles the PHP engine and the
|
|
25
|
+
checkout's script: do not install Composer or npm packages into Paymenter, and
|
|
26
|
+
do not clone the OpenReceive repository.
|
|
27
|
+
|
|
28
|
+
The one required credential is a receive-only NWC code (Nostr Wallet Connect):
|
|
29
|
+
a string from the merchant's wallet that can create invoices and read their
|
|
30
|
+
status, and cannot spend. A swap provider (an "LSC" code) optionally lets
|
|
31
|
+
clients pay with USDT, USDC, ETH or SOL instead; the provider converts the
|
|
32
|
+
payment to BTC over Lightning in the merchant's connected wallet. Available
|
|
33
|
+
assets and networks depend on the provider.
|
|
34
|
+
|
|
35
|
+
Run every `php artisan` command below in Paymenter's directory, as the web
|
|
36
|
+
server's user, never as root: a root run can leave Paymenter's log file owned
|
|
37
|
+
by root, and then every page fails. With Paymenter's official Docker image,
|
|
38
|
+
that is `docker compose exec -T -u nginx paymenter php artisan …` (`-T` passes
|
|
39
|
+
stdin through; use the Paymenter service's own name). On a server, it is
|
|
40
|
+
`sudo -u www-data php artisan …` with the site's own user.
|
|
41
|
+
|
|
42
|
+
## Step 0 — ask for the two codes, one question at a time
|
|
43
|
+
|
|
44
|
+
Before anything else, check one thing: whether OpenReceive is already
|
|
45
|
+
installed (`php artisan openreceive:doctor`). If the command exists, it prints
|
|
46
|
+
`NWC_URI: set` or `unset` (likewise `LSC_URI_PRIMARY`), never the values. A
|
|
47
|
+
code that is already set is not asked for again; if both are set, skip to
|
|
48
|
+
Step 3.
|
|
49
|
+
|
|
50
|
+
Otherwise your next action is a question to the user. Do not download the
|
|
51
|
+
extension, edit Docker files or search anywhere else before asking it. Do not
|
|
52
|
+
read Paymenter's `.env`, deploy config, container environments or other
|
|
53
|
+
projects looking for a code: a new install has neither code yet.
|
|
54
|
+
|
|
55
|
+
The user never runs a command and never edits a file. They paste each code
|
|
56
|
+
into this chat; you store it. That is the supported path: do not ask them to
|
|
57
|
+
run the save command themselves, and do not tell them to revoke or replace a
|
|
58
|
+
code because it was pasted here. Ask one question per message.
|
|
59
|
+
|
|
60
|
+
1. **First message — the NWC code, and nothing else.**
|
|
61
|
+
|
|
62
|
+
> To receive payments I need a receive-only wallet code. In Rizful: open
|
|
63
|
+
> the menu, tap NWC, choose Receive-only NWC code, and tap Copy
|
|
64
|
+
> (https://openreceive.org/get_a_nwc_code_to_receive_payments). If you would
|
|
65
|
+
> rather run your own wallet, Alby Hub works too: Connections → Add
|
|
66
|
+
> Connection → Read Only. Paste the code here and I will store it.
|
|
67
|
+
|
|
68
|
+
2. **When they paste it.** If it does not start with `nostr+walletconnect://`,
|
|
69
|
+
ask them to copy the receive-only code again. Otherwise do not repeat it:
|
|
70
|
+
reply only that you have it, then ask the next question. You store it in
|
|
71
|
+
Step 2.
|
|
72
|
+
3. **Second message — swaps.** If the user asked for stablecoins, USDT, USDC,
|
|
73
|
+
ETH, SOL, altcoins or "crypto" (as in "Bitcoin and stablecoin payments"),
|
|
74
|
+
this message IS the walkthrough below: do not skip it, and do not ask yes
|
|
75
|
+
or no first. Otherwise ask whether clients should also be able to pay
|
|
76
|
+
with USDT, USDC, ETH or SOL, then give the walkthrough. The walkthrough:
|
|
77
|
+
|
|
78
|
+
> Go to https://lightning-swap.com, sign in for API keys, create a key, and
|
|
79
|
+
> copy the whole URI (https://openreceive.org/set_up_swap_provider). Paste
|
|
80
|
+
> it here and I will store it — or say "Bitcoin only" and I will continue
|
|
81
|
+
> without it.
|
|
82
|
+
|
|
83
|
+
Mention FixedFloat only if they already use it.
|
|
84
|
+
4. **When they paste it.** If it does not start with
|
|
85
|
+
`lightning+swapconnect://`, ask them to copy it again. Swaps are now on,
|
|
86
|
+
so keep the route back (the swap non-negotiable below).
|
|
87
|
+
|
|
88
|
+
Do not report setup as complete until the NWC code is saved, and the LSC code
|
|
89
|
+
is saved or the user said "Bitcoin only". Never invent a placeholder code.
|
|
90
|
+
|
|
91
|
+
## Step 1 — install the extension
|
|
92
|
+
|
|
93
|
+
The extension is the ZIP attached to this GitHub release. It holds one
|
|
94
|
+
`OpenReceive` folder, which goes into Paymenter's `extensions/Gateways/`
|
|
95
|
+
directory. Never install the GitHub source-code ZIP or a ZIP from an older
|
|
96
|
+
release. With Paymenter's official Docker image, download and unpack it inside
|
|
97
|
+
the container, as the web user:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
docker compose exec -T -u nginx paymenter sh -c 'cd /app/extensions/Gateways && curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.28/openreceive-paymenter-0.4.28.zip && unzip -q openreceive-paymenter-0.4.28.zip && rm openreceive-paymenter-0.4.28.zip'
|
|
101
|
+
docker compose exec -T -u nginx paymenter php artisan app:extension:install gateway OpenReceive
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
On a server, unpack it into `<paymenter>/extensions/Gateways/` the same way,
|
|
105
|
+
make the folder the web user's, and run the same `app:extension:install`. That
|
|
106
|
+
command creates the extension's two tables in Paymenter's database and its
|
|
107
|
+
gateway, "Bitcoin Lightning". Checkout offers it once a wallet code is saved.
|
|
108
|
+
|
|
109
|
+
The extension needs Paymenter 1.5 or later on 64-bit PHP 8.3+ with GMP and
|
|
110
|
+
sodium. The official image has all of them. If doctor reports a missing PHP
|
|
111
|
+
extension on a server, say which one and stop: installing PHP extensions on
|
|
112
|
+
the user's server is theirs to decide.
|
|
113
|
+
|
|
114
|
+
## Step 2 — store the codes
|
|
115
|
+
|
|
116
|
+
Store each code yourself, one per command, and never as a shell argument:
|
|
117
|
+
|
|
118
|
+
1. Write the code with your file-editing tool, not a shell command (no
|
|
119
|
+
`echo`, `printf` or heredoc), to a new file outside the Paymenter
|
|
120
|
+
directory, such as `/tmp/openreceive-code`.
|
|
121
|
+
2. Run `php artisan openreceive:configure --nwc-uri=- < /tmp/openreceive-code`.
|
|
122
|
+
In Docker: `docker compose exec -T -u nginx paymenter php artisan openreceive:configure --nwc-uri=- < /tmp/openreceive-code`.
|
|
123
|
+
For the LSC code, use `--lsc-uri-primary=-`.
|
|
124
|
+
3. Delete the file (`rm /tmp/openreceive-code`), whether the command passed
|
|
125
|
+
or not.
|
|
126
|
+
|
|
127
|
+
The command asks the wallet first and saves the code, encrypted with
|
|
128
|
+
Paymenter's `APP_KEY`, only when the wallet answers as receive-only; a failure
|
|
129
|
+
saves nothing. If it reports spend methods such as `pay_invoice`, ask the user
|
|
130
|
+
for a receive-only code again. Saving the swap code renames the gateway to
|
|
131
|
+
"Bitcoin & stablecoins". Never write a code into Paymenter's settings table,
|
|
132
|
+
`.env` or any file in the Paymenter directory yourself.
|
|
133
|
+
|
|
134
|
+
Then run `php artisan openreceive:doctor`. It names any failed check and exits
|
|
135
|
+
nonzero; fix it before going on.
|
|
136
|
+
|
|
137
|
+
## Step 3 — mint a test invoice, then stop
|
|
138
|
+
|
|
139
|
+
Create a small unpaid test invoice, billed to the first admin account without
|
|
140
|
+
Paymenter's new-invoice email, and mint its Lightning invoice:
|
|
141
|
+
|
|
142
|
+
```sh
|
|
143
|
+
php artisan openreceive:test-invoice --new
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
To use an invoice that already exists, pass its id instead of `--new`.
|
|
147
|
+
`test-invoice` goes through the same route as the invoice's payment dialog. It
|
|
148
|
+
prints the amount in sats, the BOLT11 invoice, the invoice page and the
|
|
149
|
+
methods the dialog offers, each swap asset marked available or followed by
|
|
150
|
+
the reason it is not. That reason is the answer; report it. "Below the
|
|
151
|
+
provider minimum" or "above the provider maximum" is about this invoice's
|
|
152
|
+
amount, not a fault. Only when the reason says the provider is unreachable
|
|
153
|
+
does doctor's "Swap provider" line have more detail. `test-invoice` and
|
|
154
|
+
`doctor` are the whole check.
|
|
155
|
+
|
|
156
|
+
Give the user the invoice page; its **Pay** button opens the checkout on this
|
|
157
|
+
same invoice. Tell them the test invoice is theirs to cancel.
|
|
158
|
+
|
|
159
|
+
You cannot pay the invoice: the code is receive-only. Do not pay, settle or
|
|
160
|
+
mark the invoice paid, and do not look for a way to (a wallet control port, a
|
|
161
|
+
test endpoint, another wallet). If the user wants a real settlement test, they
|
|
162
|
+
pay from the invoice page with their own wallet; afterwards the invoice reads
|
|
163
|
+
paid.
|
|
164
|
+
|
|
165
|
+
Setup ends here. Once doctor is clean and the user has the link, your last
|
|
166
|
+
message starts "Setup is finished" and has at most six short lines: the
|
|
167
|
+
invoice page, the methods the checkout offers (Bitcoin, plus USDT, USDC, ETH
|
|
168
|
+
and SOL when the swap code is saved), and one line of what to look at. Do not
|
|
169
|
+
list each coin's availability, mention a minimum, or say a coin will not work:
|
|
170
|
+
a provider minimum depends on the invoice total, and real invoices will
|
|
171
|
+
differ. Do not list what you changed or what doctor checked. Send nothing
|
|
172
|
+
after it. Do not add containers, services, workers or cron jobs: Paymenter's
|
|
173
|
+
own cron job runs the extension's every-minute pass. If doctor says
|
|
174
|
+
Paymenter's scheduler has never run, say so in one line of that message.
|
|
175
|
+
|
|
176
|
+
## Non-negotiables
|
|
177
|
+
|
|
178
|
+
- Never print, log or commit a code, never put one in a shell argument, and
|
|
179
|
+
never write one into source files, `.env`, the database or browser code.
|
|
180
|
+
Doctor's set/unset is all you report.
|
|
181
|
+
- Do not suggest rotating, revoking or replacing a code because it was pasted
|
|
182
|
+
into this chat; that is the supported path.
|
|
183
|
+
- Work only in this Paymenter. Never read or run anything from another project
|
|
184
|
+
or directory on this machine (its `node_modules`, tools or source), for any
|
|
185
|
+
reason. A browser, Playwright, hand-made calls to the checkout's routes,
|
|
186
|
+
`tinker` and reading the extension's source are not part of setup: when
|
|
187
|
+
doctor or `test-invoice` fails, report its output.
|
|
188
|
+
- Run `php artisan` as the web server's user, never as root.
|
|
189
|
+
- Receive-only NWC is required. Never get past the preflight with a code that
|
|
190
|
+
can spend.
|
|
191
|
+
- The extension owns only its two payment tables in Paymenter's database.
|
|
192
|
+
Paymenter owns clients, invoices, prices, services and email. Do not add an
|
|
193
|
+
external payment database or custom fulfillment code, and do not edit
|
|
194
|
+
Paymenter's own files.
|
|
195
|
+
- IF SWAPS ARE ON, KEEP THE ROUTE BACK. A deposit that arrives short or late
|
|
196
|
+
becomes refundable, and the client claims it later from the same invoice's
|
|
197
|
+
payment dialog. Keep the extension installed while swap payments may still
|
|
198
|
+
need a refund. https://openreceive.org/guides/swap-refunds.md
|
|
199
|
+
- A receive-only wallet cannot send refunds. Refund a settled payment manually
|
|
200
|
+
from the wallet.
|
|
201
|
+
|
|
202
|
+
## Further reading
|
|
203
|
+
|
|
204
|
+
- [Paymenter Quickstart](https://openreceive.org/guides/quickstart-paymenter.md)
|
|
205
|
+
- [Automated Swaps](https://openreceive.org/guides/automated-swaps.md)
|
|
206
|
+
- [Swap Refunds](https://openreceive.org/guides/swap-refunds.md)
|
|
207
|
+
- [Lightning Swap Connect URI](https://openreceive.org/guides/lightning-swap-connect.md)
|
|
208
|
+
- [Security](https://openreceive.org/guides/security.md)
|
|
209
|
+
- [Price Feeds](https://openreceive.org/guides/price-feeds.md)
|
|
210
|
+
- [Payment Safety Upgrade](https://openreceive.org/guides/payment-safety-upgrade.md)
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## The quickstart, in full
|
|
215
|
+
|
|
216
|
+
Inlined verbatim so this file needs no network access. Steps 0–3 above are the setup and this is their reference: where the two differ, the steps win, and its admin-area screens are only for a Paymenter with no shell.
|
|
217
|
+
The page it comes from is https://openreceive.org/guides/quickstart-paymenter.
|
|
218
|
+
|
|
219
|
+
## Paymenter quickstart
|
|
220
|
+
|
|
221
|
+
[Paymenter](https://paymenter.org) is an open-source billing panel for hosting
|
|
222
|
+
companies. The OpenReceive extension adds a payment method to it: the client
|
|
223
|
+
pays an invoice with Bitcoin over Lightning, straight into your own wallet,
|
|
224
|
+
from Paymenter's own payment dialog. With a swap provider, the same dialog
|
|
225
|
+
also takes USDT, USDC, SOL and ETH, which the provider converts to BTC over
|
|
226
|
+
Lightning into the same wallet.
|
|
227
|
+
|
|
228
|
+
Paymenter keeps owning clients, invoices, prices and services. The extension
|
|
229
|
+
keeps its payment attempts in two tables of Paymenter's own database. When a
|
|
230
|
+
payment settles, it records the payment on the invoice with Paymenter's own
|
|
231
|
+
payment call, so the invoice turns paid and Paymenter activates or renews the
|
|
232
|
+
service as it does for any other gateway.
|
|
233
|
+
|
|
234
|
+
Requirements: Paymenter 1.5 or later, on 64-bit PHP 8.3 or later with GMP and
|
|
235
|
+
sodium, and MySQL or MariaDB. Paymenter's official Docker image has all of
|
|
236
|
+
them. Paymenter's cron job must run, as Paymenter's own install guide sets up.
|
|
237
|
+
|
|
238
|
+
### Install the extension
|
|
239
|
+
|
|
240
|
+
Each GitHub release attaches the extension as a ZIP that holds one
|
|
241
|
+
`OpenReceive` folder. It belongs in Paymenter's `extensions/Gateways/`
|
|
242
|
+
directory, next to Stripe and PayPal:
|
|
243
|
+
|
|
244
|
+
```sh
|
|
245
|
+
cd /var/www/paymenter
|
|
246
|
+
curl -fsSLO https://github.com/OpenReceive/openreceive/releases/download/v0.4.28/openreceive-paymenter-0.4.28.zip
|
|
247
|
+
unzip -q openreceive-paymenter-0.4.28.zip -d extensions/Gateways
|
|
248
|
+
rm openreceive-paymenter-0.4.28.zip
|
|
249
|
+
chown -R www-data:www-data extensions/Gateways/OpenReceive
|
|
250
|
+
sudo -u www-data php artisan app:extension:install gateway OpenReceive
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Use your own Paymenter directory and web server user. The last command creates
|
|
254
|
+
the extension's two tables and its gateway, named "Bitcoin Lightning". Until a
|
|
255
|
+
wallet code is saved, checkout does not offer it.
|
|
256
|
+
|
|
257
|
+
The ZIP already bundles the extension's dependencies and the checkout's
|
|
258
|
+
script, under their own prefixed names, so Composer never runs and nothing in
|
|
259
|
+
Paymenter's own `vendor/` changes. Paymenter updates leave the folder alone.
|
|
260
|
+
The GitHub source-code ZIP is not an installable extension.
|
|
261
|
+
|
|
262
|
+
#### Paymenter in Docker
|
|
263
|
+
|
|
264
|
+
The official Compose file mounts `./extensions` into the container, so unzip
|
|
265
|
+
into the `extensions/Gateways` folder next to `compose.yml`. Run the artisan
|
|
266
|
+
commands inside the container as its web user, `nginx`:
|
|
267
|
+
|
|
268
|
+
```sh
|
|
269
|
+
docker compose exec -u nginx paymenter php artisan app:extension:install gateway OpenReceive
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
Always pass `-u nginx`. A command that runs as root can create Paymenter's
|
|
273
|
+
daily log file as root, and every web request then fails with a 500 until you
|
|
274
|
+
fix the ownership with `chown -R nginx:nginx /app/storage`.
|
|
275
|
+
|
|
276
|
+
### Configure the wallet
|
|
277
|
+
|
|
278
|
+
You need a receive-only NWC code: a Nostr Wallet Connect code that can create
|
|
279
|
+
invoices and read payments but cannot spend. The extension refuses a code that
|
|
280
|
+
can spend.
|
|
281
|
+
|
|
282
|
+
In the admin area, open **Gateways**, edit **Bitcoin Lightning**, paste the
|
|
283
|
+
code into **Receive-only NWC code** and save. To accept stablecoins too, paste a
|
|
284
|
+
swap provider code into **Swap provider code**. Paymenter stores both
|
|
285
|
+
encrypted with its `APP_KEY`.
|
|
286
|
+
|
|
287
|
+
From a terminal, pipe each code into `openreceive:configure` from your secret
|
|
288
|
+
manager or a protected file. Never type a code as a command argument:
|
|
289
|
+
|
|
290
|
+
```sh
|
|
291
|
+
sudo -u www-data php artisan openreceive:configure --nwc-uri=- < /secure/path/wallet-code
|
|
292
|
+
sudo -u www-data php artisan openreceive:configure --lsc-uri-primary=- < /secure/path/swap-code
|
|
293
|
+
sudo -u www-data php artisan openreceive:doctor
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
`configure` asks the wallet first and saves the code only when it answers as a
|
|
297
|
+
receive-only wallet. Saving a swap code renames the default "Bitcoin Lightning"
|
|
298
|
+
to "Bitcoin & stablecoins"; `--name="…"` sets your own. Omit the swap command
|
|
299
|
+
for Bitcoin-only checkout.
|
|
300
|
+
|
|
301
|
+
`doctor` checks the gateway, GMP and sodium, each code as set or unset (never
|
|
302
|
+
its value), the tables, the routes, the wallet, the price feed for every
|
|
303
|
+
Paymenter currency, each swap provider and the scheduled pass. It exits
|
|
304
|
+
nonzero when a check fails.
|
|
305
|
+
|
|
306
|
+
### Check it
|
|
307
|
+
|
|
308
|
+
Make a Lightning invoice through the same route the payment dialog uses, for a
|
|
309
|
+
new $5 test invoice billed to the first admin account, or for any unpaid
|
|
310
|
+
invoice by its id:
|
|
311
|
+
|
|
312
|
+
```sh
|
|
313
|
+
sudo -u www-data php artisan openreceive:test-invoice --new
|
|
314
|
+
sudo -u www-data php artisan openreceive:test-invoice <invoice id>
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
`--new` sends no new-invoice email; `--amount=` and `--user=<email>` change
|
|
318
|
+
what it bills and to whom. Cancel the test invoice in the admin area when you
|
|
319
|
+
are done.
|
|
320
|
+
|
|
321
|
+
It prints the amount in sats, the Lightning invoice and the invoice page, then
|
|
322
|
+
each method the dialog offers: Bitcoin Lightning, and each swap asset with its
|
|
323
|
+
network and whether it is available for this amount. A small invoice is often
|
|
324
|
+
below a swap provider's minimum; that is the amount, not a fault.
|
|
325
|
+
|
|
326
|
+
### How a payment works
|
|
327
|
+
|
|
328
|
+
1. The client opens the invoice, presses **Pay** and picks the OpenReceive
|
|
329
|
+
method. The checkout opens inside Paymenter's payment dialog.
|
|
330
|
+
2. The extension charges what is still due on the invoice, in the invoice's
|
|
331
|
+
currency, converted to sats at the current BTC price. Only the client the
|
|
332
|
+
invoice belongs to, signed in, can make or follow its payment.
|
|
333
|
+
3. Once the wallet reports the payment, the extension records it on the
|
|
334
|
+
invoice in the same database transaction that settles it. The payment hash
|
|
335
|
+
is the transaction id. Paymenter then marks the invoice paid and runs its
|
|
336
|
+
usual work, such as activating the service and sending the receipt.
|
|
337
|
+
4. The dialog returns the client to the invoice, now paid.
|
|
338
|
+
|
|
339
|
+
The checkout asks the wallet while the dialog is open. If the client closes it
|
|
340
|
+
before the payment settles, the extension's pass on Paymenter's scheduler finds
|
|
341
|
+
the payment within a minute or so. `php artisan openreceive:reconcile` runs one
|
|
342
|
+
pass by hand.
|
|
343
|
+
|
|
344
|
+
A client who closes the dialog and comes back to the invoice gets the same
|
|
345
|
+
Lightning invoice again while it is still valid.
|
|
346
|
+
|
|
347
|
+
### Refunds and removal
|
|
348
|
+
|
|
349
|
+
The receive-only wallet cannot send refunds. Send a refund from your own
|
|
350
|
+
wallet, then record it in Paymenter. A client whose swap deposit never
|
|
351
|
+
converted reclaims it from the same invoice's payment dialog, while the invoice
|
|
352
|
+
is still unpaid. If you turn on swaps, you commit to keeping that path
|
|
353
|
+
available. See [swap refunds](https://openreceive.org/guides/swap-refunds.md).
|
|
354
|
+
|
|
355
|
+
Deleting the gateway keeps the two tables: they are a record of payments
|
|
356
|
+
received.
|
|
357
|
+
|
|
358
|
+
### Tested, and not tested
|
|
359
|
+
|
|
360
|
+
Tested on 2026-10-16 with Paymenter 1.5.9's official Docker image and MariaDB
|
|
361
|
+
11.8, a test wallet and a test swap provider: install from the built ZIP,
|
|
362
|
+
configure from stdin, the doctor, and a client paying an invoice by Lightning
|
|
363
|
+
in Chromium, after which the invoice reads paid with the payment hash as its
|
|
364
|
+
transaction.
|
|
365
|
+
|
|
366
|
+
Not tested: PostgreSQL or SQLite, Paymenter in a subdirectory of a domain, and
|
|
367
|
+
Paymenter's automatic charges of saved payment methods. Lightning cannot pull
|
|
368
|
+
a payment, so OpenReceive offers no saved payment method: the client pays
|
|
369
|
+
each renewal invoice.
|
|
@@ -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 43 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.28.
|
|
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
|
|
@@ -737,8 +737,11 @@ foreach (\OpenReceive\Server\Doctor::report(
|
|
|
737
737
|
- where the handler is mounted;
|
|
738
738
|
- the receive-only wallet preflight.
|
|
739
739
|
|
|
740
|
-
`$engine->doctor()` is the same report for an engine you already built
|
|
741
|
-
|
|
740
|
+
`$engine->doctor()` is the same report for an engine you already built, but it
|
|
741
|
+
runs the wallet preflight only when you pass the same factory:
|
|
742
|
+
`$engine->doctor(walletCheck: static fn () => \OpenReceive\Server\Service::fromEnvironment())`.
|
|
743
|
+
Without it the preflight line reads `skipped`. Put the report behind a
|
|
744
|
+
`bin/doctor` script. The demo's is twelve lines.
|
|
742
745
|
→ [Doctor](https://openreceive.org/guides/api-reference.md#openreceiveserverdoctor)
|
|
743
746
|
|
|
744
747
|
Then open the checkout in a browser. Confirm the payment-method icons and
|
|
@@ -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.28.
|
|
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
|
|
@@ -422,13 +422,16 @@ That is the whole install. `openreceive-rails` depends on `openreceive`,
|
|
|
422
422
|
nothing else added. It is built from `NWC_URI`. If your app brings its own NWC
|
|
423
423
|
client, set `config.nwc_client` instead.
|
|
424
424
|
|
|
425
|
-
|
|
426
|
-
libsecp256k1 from source
|
|
427
|
-
|
|
428
|
-
`
|
|
425
|
+
Two native builds need system packages. `nwc-ruby` uses `rbsecp256k1`, which
|
|
426
|
+
builds libsecp256k1 from source and needs the autotools; without them
|
|
427
|
+
`bundle install` fails with `autoreconf: not found`. Its connection libraries
|
|
428
|
+
also need a newer `openssl` gem than Ruby ships, and Bundler compiles that gem
|
|
429
|
+
against the OpenSSL headers; without them it fails installing `openssl` at
|
|
430
|
+
`checking for openssl/ssl.h... no`. Minimal images (`ruby:3.3-slim`, fresh
|
|
431
|
+
Docker builds) have neither. Install them before bundling:
|
|
429
432
|
|
|
430
433
|
```sh
|
|
431
|
-
apt-get install -y autoconf automake libtool build-essential pkg-config
|
|
434
|
+
apt-get install -y autoconf automake libtool build-essential pkg-config libssl-dev
|
|
432
435
|
```
|
|
433
436
|
|
|
434
437
|
Full Ruby images and typical developer machines already have these.
|
|
@@ -616,9 +619,11 @@ settlement transaction, only for the first settled attempt for a reference.
|
|
|
616
619
|
|
|
617
620
|
The engine's controllers inherit from `config.parent_controller`. The generated
|
|
618
621
|
initializer sets it to `"ApplicationController"`. That is how the engine picks
|
|
619
|
-
up your application's `protect_from_forgery`.
|
|
620
|
-
|
|
621
|
-
it automatically
|
|
622
|
+
up your application's `protect_from_forgery`. The layout that renders the
|
|
623
|
+
checkout needs `<%= csrf_meta_tags %>` in its `<head>`: add it if it is not
|
|
624
|
+
there. The checkout client sends `X-CSRF-Token` from it automatically; without
|
|
625
|
+
it, every checkout answers 403 "Can't verify CSRF token authenticity". Do not
|
|
626
|
+
skip forgery protection for the engine to get past that 403.
|
|
622
627
|
|
|
623
628
|
The same inheritance also brings every global `before_action` that your
|
|
624
629
|
`ApplicationController` declares. A filter that redirects signed-out users to a
|