@openreceive/elements 0.4.14 → 0.4.17
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.
- package/README.md +11 -0
- package/dist/{chunk-DQ6FMWVX.js → chunk-HCRHC4CJ.js} +15 -2
- package/dist/index.js +1 -1
- package/dist/standalone/MANIFEST.json +5 -5
- package/dist/standalone/openreceive-checkout.js +5 -5
- package/dist/standalone/openreceive-checkout.js.map +3 -3
- package/dist/wrapper-shared.js +1 -1
- package/package.json +2 -3
- package/skills/debug-openreceive-payment/SKILL.md +0 -97
- package/skills/integrate-openreceive/SKILL.md +0 -139
- package/skills/integrate-openreceive/references/btcpay.md +0 -224
- package/skills/integrate-openreceive/references/django.md +0 -745
- package/skills/integrate-openreceive/references/fastapi.md +0 -619
- package/skills/integrate-openreceive/references/fastify.md +0 -615
- package/skills/integrate-openreceive/references/laravel.md +0 -749
- package/skills/integrate-openreceive/references/next.md +0 -660
- package/skills/integrate-openreceive/references/node.md +0 -588
- package/skills/integrate-openreceive/references/php.md +0 -682
- package/skills/integrate-openreceive/references/rails.md +0 -698
- package/skills/integrate-openreceive/references/woocommerce.md +0 -193
package/README.md
CHANGED
|
@@ -59,3 +59,14 @@ allow `data:`. See
|
|
|
59
59
|
[Images in `@openreceive/browser`](https://github.com/openreceive/openreceive/blob/master/packages/js/browser/README.md#images).
|
|
60
60
|
|
|
61
61
|
Part of [OpenReceive](https://openreceive.org). Start with the [Node quickstart](https://github.com/openreceive/openreceive/blob/master/docs/guides/quickstart-node.md); the full API is in the [API reference](https://github.com/openreceive/openreceive/blob/master/docs/guides/api-reference.md).
|
|
62
|
+
|
|
63
|
+
## Agent skills
|
|
64
|
+
|
|
65
|
+
Run `npx openreceive skills install` from your application after installing an
|
|
66
|
+
OpenReceive server adapter. The offline copy ships in `@openreceive/node`, a
|
|
67
|
+
server-adapter dependency. For a frontend-only project, use
|
|
68
|
+
`npx skills add OpenReceive/openreceive`.
|
|
69
|
+
See [agent setup](https://openreceive.org/agents). The bundled installers write
|
|
70
|
+
to `.agents/skills/`; use `--dir .claude/skills` for Claude Code. They replace
|
|
71
|
+
only `integrate-openreceive` and `debug-openreceive-payment`, preserving
|
|
72
|
+
unrelated skills.
|
|
@@ -194,7 +194,7 @@ import {
|
|
|
194
194
|
OPENRECEIVE_DEFAULT_PREFIX,
|
|
195
195
|
prepareCheckout,
|
|
196
196
|
requestCheckout,
|
|
197
|
-
|
|
197
|
+
resumeCheckoutAttempt
|
|
198
198
|
} from "@openreceive/browser/headless";
|
|
199
199
|
function createElementCheckoutSession(host) {
|
|
200
200
|
let creating = false;
|
|
@@ -305,13 +305,14 @@ function createElementCheckoutSession(host) {
|
|
|
305
305
|
});
|
|
306
306
|
if (!action.isCurrent()) return;
|
|
307
307
|
const resumeHash = host.resumePaymentHash();
|
|
308
|
-
const checkout = resumeHash === void 0 ? prepared : await
|
|
308
|
+
const checkout = resumeHash === void 0 ? prepared : await resumeCheckoutAttempt({
|
|
309
309
|
signal: action.signal,
|
|
310
310
|
fetch: globalThis.fetch,
|
|
311
311
|
prefix,
|
|
312
312
|
...csrfHeader === void 0 ? {} : { csrfHeader },
|
|
313
313
|
reference,
|
|
314
314
|
paymentHash: resumeHash,
|
|
315
|
+
rail: host.resumePaymentRail(),
|
|
315
316
|
snapshot: prepared
|
|
316
317
|
});
|
|
317
318
|
if (!action.isCurrent()) return;
|
|
@@ -320,6 +321,10 @@ function createElementCheckoutSession(host) {
|
|
|
320
321
|
host.swapSelection.setDismissedInvoiceId(null);
|
|
321
322
|
}
|
|
322
323
|
host.handleControllerSnapshot(checkout);
|
|
324
|
+
if (resumeHash !== void 0 && host.resumePaymentRail() === "lightning") {
|
|
325
|
+
host.focusLightning();
|
|
326
|
+
await session.ensureLightning();
|
|
327
|
+
}
|
|
323
328
|
applyOwnAttributes(
|
|
324
329
|
createCheckoutElementAttributes(checkout, {
|
|
325
330
|
prefix,
|
|
@@ -1695,6 +1700,13 @@ function defineElements(options = {}) {
|
|
|
1695
1700
|
this.syncResumePath(reference);
|
|
1696
1701
|
},
|
|
1697
1702
|
resumePaymentHash: () => this.resumePaymentHash(),
|
|
1703
|
+
resumePaymentRail: () => this.getAttribute("resume-payment-rail") === "lightning" ? "lightning" : "swap",
|
|
1704
|
+
focusLightning: () => {
|
|
1705
|
+
this.selection = updatePaymentWizardSelection(this.selection, {
|
|
1706
|
+
type: "select_method",
|
|
1707
|
+
method: "bitcoin"
|
|
1708
|
+
});
|
|
1709
|
+
},
|
|
1698
1710
|
resolvePollPrefix: (reference) => this.resolvePollPrefix(reference),
|
|
1699
1711
|
dispatchError: (error) => {
|
|
1700
1712
|
this.dispatchError(error);
|
|
@@ -1723,6 +1735,7 @@ function defineElements(options = {}) {
|
|
|
1723
1735
|
OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.resumePathPrefix,
|
|
1724
1736
|
OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.routeReference,
|
|
1725
1737
|
OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.resumePaymentHash,
|
|
1738
|
+
OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.resumePaymentRail,
|
|
1726
1739
|
OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.resumable,
|
|
1727
1740
|
OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.polling,
|
|
1728
1741
|
OPENRECEIVE_CHECKOUT_ELEMENT_ATTRIBUTES3.pollIntervalMs,
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@openreceive/elements",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.17",
|
|
4
4
|
"files": {
|
|
5
5
|
"openreceive-checkout.css": {
|
|
6
6
|
"bytes": 225527,
|
|
7
7
|
"sha256": "41b81cddbf0732c08e408ddc011649839289d19f279015842cec06736636bfbb"
|
|
8
8
|
},
|
|
9
9
|
"openreceive-checkout.js": {
|
|
10
|
-
"bytes":
|
|
11
|
-
"sha256": "
|
|
10
|
+
"bytes": 739598,
|
|
11
|
+
"sha256": "a1360e6a4313a52bf79ba03a4d27b2ecf4e13309e8e08dc9c9bf4a7ded88a98c"
|
|
12
12
|
},
|
|
13
13
|
"openreceive-checkout.js.map": {
|
|
14
|
-
"bytes":
|
|
15
|
-
"sha256": "
|
|
14
|
+
"bytes": 1236471,
|
|
15
|
+
"sha256": "cf6398278ee4bd47f82e4419276508db29fca9c49f7c8cc71c9ae8e566a83868"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"source": "https://github.com/openreceive/openreceive",
|