@openreceive/angular 0.4.14 → 0.4.16

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 CHANGED
@@ -69,3 +69,14 @@ Event handlers (`onCopy`, `onOpenWallet`, `onState`, `onSettled`,
69
69
  `(settled)="..."`. Each receives the DOM `CustomEvent` the element dispatches.
70
70
 
71
71
  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).
72
+
73
+ ## Agent skills
74
+
75
+ Run `npx openreceive skills install` from your application after installing an
76
+ OpenReceive server adapter. The offline copy ships in `@openreceive/node`, a
77
+ server-adapter dependency. For a frontend-only project, use
78
+ `npx skills add OpenReceive/openreceive`.
79
+ See [agent setup](https://openreceive.org/agents). The bundled installers write
80
+ to `.agents/skills/`; use `--dir .claude/skills` for Claude Code. They replace
81
+ only `integrate-openreceive` and `debug-openreceive-payment`, preserving
82
+ unrelated skills.
package/dist/README.md CHANGED
@@ -69,3 +69,14 @@ Event handlers (`onCopy`, `onOpenWallet`, `onState`, `onSettled`,
69
69
  `(settled)="..."`. Each receives the DOM `CustomEvent` the element dispatches.
70
70
 
71
71
  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).
72
+
73
+ ## Agent skills
74
+
75
+ Run `npx openreceive skills install` from your application after installing an
76
+ OpenReceive server adapter. The offline copy ships in `@openreceive/node`, a
77
+ server-adapter dependency. For a frontend-only project, use
78
+ `npx skills add OpenReceive/openreceive`.
79
+ See [agent setup](https://openreceive.org/agents). The bundled installers write
80
+ to `.agents/skills/`; use `--dir .claude/skills` for Claude Code. They replace
81
+ only `integrate-openreceive` and `debug-openreceive-payment`, preserving
82
+ unrelated skills.
@@ -131,6 +131,7 @@ class CheckoutComponent {
131
131
  resumePathPrefix;
132
132
  routeReference;
133
133
  resumePaymentHash;
134
+ resumePaymentRail;
134
135
  resumable;
135
136
  onCopy;
136
137
  onOpenWallet;
@@ -191,6 +192,7 @@ class CheckoutComponent {
191
192
  resumePathPrefix: this.resumePathPrefix,
192
193
  routeReference: this.routeReference,
193
194
  resumePaymentHash: this.resumePaymentHash,
195
+ resumePaymentRail: this.resumePaymentRail,
194
196
  });
195
197
  const options = {
196
198
  ...this.options,
@@ -212,6 +214,9 @@ class CheckoutComponent {
212
214
  ...(this.resumePaymentHash === undefined
213
215
  ? {}
214
216
  : { resumePaymentHash: this.resumePaymentHash }),
217
+ ...(this.resumePaymentRail === undefined
218
+ ? {}
219
+ : { resumePaymentRail: this.resumePaymentRail }),
215
220
  ...(this.resumable === undefined ? {} : { resumable: this.resumable }),
216
221
  ...(this.onCopy === undefined ? {} : { onCopy: this.onCopy }),
217
222
  ...(this.onOpenWallet === undefined ? {} : { onOpenWallet: this.onOpenWallet }),
@@ -224,7 +229,7 @@ class CheckoutComponent {
224
229
  return createWrapperCheckoutShellBinding(this.checkout ?? null, options);
225
230
  }
226
231
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: CheckoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
227
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: CheckoutComponent, isStandalone: true, selector: "openreceive-angular-checkout", inputs: { checkout: "checkout", reference: "reference", prefix: "prefix", csrfHeader: "csrfHeader", paymentWizard: "paymentWizard", decodeLinkUrl: "decodeLinkUrl", themeToggle: "themeToggle", defaultTheme: "defaultTheme", storageKey: "storageKey", metadata: "metadata", syncUrl: "syncUrl", resumePathPrefix: "resumePathPrefix", routeReference: "routeReference", resumePaymentHash: "resumePaymentHash", resumable: "resumable", onCopy: "onCopy", onOpenWallet: "onOpenWallet", onState: "onState", onSettled: "onSettled", onProviderCopy: "onProviderCopy", onStartOver: "onStartOver", onError: "onError", options: "options" }, usesOnChanges: true, ngImport: i0, template: `
232
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: CheckoutComponent, isStandalone: true, selector: "openreceive-angular-checkout", inputs: { checkout: "checkout", reference: "reference", prefix: "prefix", csrfHeader: "csrfHeader", paymentWizard: "paymentWizard", decodeLinkUrl: "decodeLinkUrl", themeToggle: "themeToggle", defaultTheme: "defaultTheme", storageKey: "storageKey", metadata: "metadata", syncUrl: "syncUrl", resumePathPrefix: "resumePathPrefix", routeReference: "routeReference", resumePaymentHash: "resumePaymentHash", resumePaymentRail: "resumePaymentRail", resumable: "resumable", onCopy: "onCopy", onOpenWallet: "onOpenWallet", onState: "onState", onSettled: "onSettled", onProviderCopy: "onProviderCopy", onStartOver: "onStartOver", onError: "onError", options: "options" }, usesOnChanges: true, ngImport: i0, template: `
228
233
  <section [openreceiveElementBindings]="rootBindings">
229
234
  @if (elementsReady && shell; as shell) {
230
235
  @if (shell.themeToggle) {
@@ -285,6 +290,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImpor
285
290
  type: Input
286
291
  }], resumePaymentHash: [{
287
292
  type: Input
293
+ }], resumePaymentRail: [{
294
+ type: Input
288
295
  }], resumable: [{
289
296
  type: Input
290
297
  }], onCopy: [{
@@ -1 +1 @@
1
- {"version":3,"file":"openreceive-angular-checkout-component.mjs","sources":["../../src/element-bindings.ts","../../src/openreceive-element-bindings.directive.ts","../../src/openreceive-checkout.component.ts","../../src/openreceive-angular-checkout-component.ts"],"sourcesContent":["/**\n * Applying a wrapper binding to a custom element, independent of Angular.\n *\n * Angular templates can only bind attribute names written out literally, so a\n * hand-transcribed `[attr.*]` list silently drops any attribute the shared\n * factory later adds. Driving attributes and listeners from the binding object\n * keeps Angular in step with the other wrappers by construction.\n */\n\nexport interface ElementBindings {\n readonly attributes?: Readonly<Record<string, string | undefined>>;\n readonly listeners?: Readonly<Record<string, ((event: Event) => void) | undefined>>;\n}\n\nexport interface ElementBindingTarget {\n getAttribute(name: string): string | null;\n setAttribute(name: string, value: string): void;\n removeAttribute(name: string): void;\n addEventListener(name: string, listener: (event: Event) => void): void;\n removeEventListener(name: string, listener: (event: Event) => void): void;\n}\n\nexport type AttachedListeners = readonly (readonly [string, (event: Event) => void])[];\n\nexport interface AppliedElementBindings {\n readonly attributes: readonly string[];\n readonly listeners: AttachedListeners;\n}\n\nexport const EMPTY_APPLIED_ELEMENT_BINDINGS: AppliedElementBindings = {\n attributes: [],\n listeners: [],\n};\n\nexport function applyElementBindings(\n element: ElementBindingTarget,\n bindings: ElementBindings,\n applied: AppliedElementBindings,\n): AppliedElementBindings {\n return {\n attributes: syncAttributes(element, bindings.attributes ?? {}, applied.attributes),\n listeners: syncListeners(element, bindings.listeners ?? {}, applied.listeners),\n };\n}\n\nexport function detachElementListeners(\n element: ElementBindingTarget,\n listeners: AttachedListeners,\n): void {\n for (const [name, handler] of listeners) element.removeEventListener(name, handler);\n}\n\nfunction syncAttributes(\n element: ElementBindingTarget,\n attributes: Readonly<Record<string, string | undefined>>,\n applied: readonly string[],\n): readonly string[] {\n for (const name of applied) {\n if (attributes[name] === undefined) element.removeAttribute(name);\n }\n const next: string[] = [];\n for (const [name, value] of Object.entries(attributes)) {\n if (value === undefined) continue;\n if (element.getAttribute(name) !== value) element.setAttribute(name, value);\n next.push(name);\n }\n return next;\n}\n\nfunction syncListeners(\n element: ElementBindingTarget,\n listeners: Readonly<Record<string, ((event: Event) => void) | undefined>>,\n attached: AttachedListeners,\n): AttachedListeners {\n const next = Object.entries(listeners).flatMap(([name, handler]) =>\n handler === undefined ? [] : [[name, handler] as const],\n );\n const unchanged =\n next.length === attached.length &&\n next.every(([name, handler], index) => {\n const current = attached[index];\n return current !== undefined && current[0] === name && current[1] === handler;\n });\n if (unchanged) return attached;\n detachElementListeners(element, attached);\n for (const [name, handler] of next) element.addEventListener(name, handler);\n return next;\n}\n","import {\n Directive,\n ElementRef,\n Input,\n NgZone,\n inject,\n type OnChanges,\n type OnDestroy,\n} from \"@angular/core\";\nimport {\n type AppliedElementBindings,\n EMPTY_APPLIED_ELEMENT_BINDINGS,\n type ElementBindings,\n applyElementBindings,\n detachElementListeners,\n} from \"./element-bindings\";\n\n/** Applies a wrapper binding's attributes and listeners to the element host. */\n@Directive({\n selector: \"[openreceiveElementBindings]\",\n standalone: true,\n})\nexport class ElementBindingsDirective implements OnChanges, OnDestroy {\n @Input(\"openreceiveElementBindings\") bindings: ElementBindings = {};\n\n private applied: AppliedElementBindings = EMPTY_APPLIED_ELEMENT_BINDINGS;\n // Zone-wrapped handlers are cached per original handler: the applier compares\n // identity to decide whether to re-attach, so a fresh wrapper each pass would\n // detach and re-add every listener on every change.\n private readonly zoneWrapped = new WeakMap<(event: Event) => void, (event: Event) => void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly zone = inject(NgZone);\n\n ngOnChanges(): void {\n // Setting attributes restarts the element's poll/countdown timers. Applying them\n // outside Angular keeps those timers unpatched, so they never schedule a change\n // detection pass; the listeners below re-enter the zone for host callbacks.\n this.zone.runOutsideAngular(() => {\n this.applied = applyElementBindings(\n this.host.nativeElement,\n { ...this.bindings, listeners: this.zoneListeners(this.bindings.listeners) },\n this.applied,\n );\n });\n }\n\n ngOnDestroy(): void {\n detachElementListeners(this.host.nativeElement, this.applied.listeners);\n this.applied = EMPTY_APPLIED_ELEMENT_BINDINGS;\n }\n\n private zoneListeners(\n listeners: ElementBindings[\"listeners\"],\n ): Readonly<Record<string, ((event: Event) => void) | undefined>> {\n if (listeners === undefined) return {};\n const wrapped: Record<string, ((event: Event) => void) | undefined> = {};\n for (const [name, handler] of Object.entries(listeners)) {\n if (handler === undefined) continue;\n let entry = this.zoneWrapped.get(handler);\n if (entry === undefined) {\n entry = (event: Event) => this.zone.run(() => handler(event));\n this.zoneWrapped.set(handler, entry);\n }\n wrapped[name] = entry;\n }\n return wrapped;\n }\n}\n","import {\n type AfterViewInit,\n ChangeDetectorRef,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n Input,\n inject,\n NgZone,\n type OnChanges,\n} from \"@angular/core\";\nimport {\n type CheckoutSnapshot,\n createWrapperCheckoutShellBinding,\n defineElements,\n type ThemePreference,\n validateCheckoutProps,\n type WrapperCheckoutShellBinding,\n type WrapperCheckoutShellOptions,\n} from \"@openreceive/angular\";\nimport type { ElementBindings } from \"./element-bindings\";\nimport { ElementBindingsDirective } from \"./openreceive-element-bindings.directive\";\n\n@Component({\n selector: \"openreceive-angular-checkout\",\n standalone: true,\n imports: [ElementBindingsDirective],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <section [openreceiveElementBindings]=\"rootBindings\">\n @if (elementsReady && shell; as shell) {\n @if (shell.themeToggle) {\n <openreceive-theme-toggle\n [openreceiveElementBindings]=\"shell.themeToggle\"\n ></openreceive-theme-toggle>\n }\n <openreceive-checkout [openreceiveElementBindings]=\"shell.checkout\"></openreceive-checkout>\n }\n </section>\n `,\n})\nexport class CheckoutComponent implements AfterViewInit, OnChanges {\n // Prop names, defaults, and per-mode applicability are the shared contract in\n // docs/internal/wrapper-parity.md. These inputs RESTATE it because `@Input()`\n // is a decorator on a declared field: a type cannot generate fields, so they\n // cannot be derived from WrapperCheckoutComponentProps the way\n // Vue's defineProps and React's CheckoutProps are. The duplication is forced,\n // not neglected; tests/wrapper-parity.test.mjs is what keeps it in step.\n // Snapshot mode: bind a `checkout` to render it directly.\n // Create mode: omit `checkout` and bind `reference` (+ optional `prefix`); the underlying\n // <openreceive-checkout> element creates the checkout, then renders and polls itself.\n @Input() checkout?: CheckoutSnapshot | null;\n @Input() reference?: string;\n @Input() prefix?: string;\n @Input() csrfHeader?: string;\n @Input() paymentWizard?: boolean;\n @Input() decodeLinkUrl?: string;\n @Input() themeToggle?: boolean;\n @Input() defaultTheme?: ThemePreference;\n @Input() storageKey?: string;\n // Create mode only.\n @Input() metadata?: Record<string, unknown>;\n @Input() syncUrl?: boolean;\n @Input() resumePathPrefix?: string;\n @Input() routeReference?: string;\n @Input() resumePaymentHash?: string;\n @Input() resumable?: boolean;\n @Input() onCopy?: (event: Event) => void;\n @Input() onOpenWallet?: (event: Event) => void;\n @Input() onState?: (event: Event) => void;\n @Input() onSettled?: (event: Event) => void;\n @Input() onProviderCopy?: (event: Event) => void;\n @Input() onStartOver?: (event: Event) => void;\n @Input() onError?: (event: Event) => void;\n @Input() options: WrapperCheckoutShellOptions = {};\n\n /**\n * The custom elements render only once this flips, and it flips inside\n * `runOutsideAngular`: the element starts poll and countdown timers in its\n * connected callback, and zone-patched timers would schedule a change-detection\n * pass on every tick for the lifetime of the checkout.\n */\n protected elementsReady = false;\n\n private readonly zone = inject(NgZone);\n private readonly changeDetector = inject(ChangeDetectorRef);\n\n // Rebuilt on input changes only. A getter would rebuild the whole binding\n // (storage reads, matchMedia, fresh objects) on every change-detection pass.\n // Null until the first `ngOnChanges`: inputs are not set yet at construction,\n // so building (and validating) here would reject every instantiation.\n protected shellBinding: WrapperCheckoutShellBinding | null = null;\n\n // The shell root's attributes, driven by the same directive as the custom\n // elements: a hand-transcribed [attr.*] list would silently drop any root\n // attribute the shared factory later adds.\n protected rootBindings: ElementBindings = {};\n\n ngAfterViewInit(): void {\n // No-op during Angular Universal SSR: custom elements only exist in the\n // browser, and the element renders itself after hydration.\n if (globalThis.customElements === undefined || globalThis.HTMLElement === undefined) return;\n this.zone.runOutsideAngular(() => {\n defineElements();\n this.elementsReady = true;\n // Rebuild so the mounted shell carries the stored theme, not the deferred default.\n this.applyShell();\n this.changeDetector.detectChanges();\n });\n }\n\n ngOnChanges(): void {\n this.applyShell();\n }\n\n get shell(): WrapperCheckoutShellBinding | null {\n return this.shellBinding;\n }\n\n private applyShell(): void {\n this.shellBinding = this.buildShell();\n this.rootBindings = { attributes: this.shellBinding.rootAttributes };\n }\n\n private buildShell(): WrapperCheckoutShellBinding {\n validateCheckoutProps({\n framework: \"@openreceive/angular\",\n checkout: this.checkout,\n reference: this.reference,\n metadata: this.metadata,\n syncUrl: this.syncUrl,\n resumePathPrefix: this.resumePathPrefix,\n routeReference: this.routeReference,\n resumePaymentHash: this.resumePaymentHash,\n });\n const options: WrapperCheckoutShellOptions = {\n ...this.options,\n themeToggle: this.themeToggle ?? this.options.themeToggle ?? true,\n // Storage and matchMedia only exist in the browser: resolving the theme before\n // the elements mount would make a server-rendered shell disagree with hydration.\n deferThemeResolution: !this.elementsReady,\n ...(this.reference === undefined ? {} : { reference: this.reference }),\n ...(this.prefix === undefined ? {} : { prefix: this.prefix }),\n ...(this.csrfHeader === undefined ? {} : { csrfHeader: this.csrfHeader }),\n ...(this.paymentWizard === undefined ? {} : { paymentWizard: this.paymentWizard }),\n ...(this.decodeLinkUrl === undefined ? {} : { decodeLinkUrl: this.decodeLinkUrl }),\n ...(this.defaultTheme === undefined ? {} : { defaultTheme: this.defaultTheme }),\n ...(this.storageKey === undefined ? {} : { storageKey: this.storageKey }),\n ...(this.metadata === undefined ? {} : { metadata: this.metadata }),\n ...(this.syncUrl === undefined ? {} : { syncUrl: this.syncUrl }),\n ...(this.resumePathPrefix === undefined ? {} : { resumePathPrefix: this.resumePathPrefix }),\n ...(this.routeReference === undefined ? {} : { routeReference: this.routeReference }),\n ...(this.resumePaymentHash === undefined\n ? {}\n : { resumePaymentHash: this.resumePaymentHash }),\n ...(this.resumable === undefined ? {} : { resumable: this.resumable }),\n ...(this.onCopy === undefined ? {} : { onCopy: this.onCopy }),\n ...(this.onOpenWallet === undefined ? {} : { onOpenWallet: this.onOpenWallet }),\n ...(this.onState === undefined ? {} : { onState: this.onState }),\n ...(this.onSettled === undefined ? {} : { onSettled: this.onSettled }),\n ...(this.onProviderCopy === undefined ? {} : { onProviderCopy: this.onProviderCopy }),\n ...(this.onStartOver === undefined ? {} : { onStartOver: this.onStartOver }),\n ...(this.onError === undefined ? {} : { onError: this.onError }),\n };\n return createWrapperCheckoutShellBinding(this.checkout ?? null, options);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './openreceive-checkout.component';\n"],"names":[],"mappings":";;;;AAAA;;;;;;;AAOG;AAsBI,MAAM,8BAA8B,GAA2B;AACpE,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,SAAS,EAAE,EAAE;CACd;SAEe,oBAAoB,CAClC,OAA6B,EAC7B,QAAyB,EACzB,OAA+B,EAAA;IAE/B,OAAO;AACL,QAAA,UAAU,EAAE,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,IAAI,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC;AAClF,QAAA,SAAS,EAAE,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,IAAI,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC;KAC/E;AACH;AAEM,SAAU,sBAAsB,CACpC,OAA6B,EAC7B,SAA4B,EAAA;AAE5B,IAAA,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,SAAS;AAAE,QAAA,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC;AACrF;AAEA,SAAS,cAAc,CACrB,OAA6B,EAC7B,UAAwD,EACxD,OAA0B,EAAA;AAE1B,IAAA,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;AAC1B,QAAA,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,SAAS;AAAE,YAAA,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC;IACnE;IACA,MAAM,IAAI,GAAa,EAAE;AACzB,IAAA,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;QACtD,IAAI,KAAK,KAAK,SAAS;YAAE;AACzB,QAAA,IAAI,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,KAAK;AAAE,YAAA,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,KAA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AAEG;;;;"}
1
+ {"version":3,"file":"openreceive-angular-checkout-component.mjs","sources":["../../src/element-bindings.ts","../../src/openreceive-element-bindings.directive.ts","../../src/openreceive-checkout.component.ts","../../src/openreceive-angular-checkout-component.ts"],"sourcesContent":["/**\n * Applying a wrapper binding to a custom element, independent of Angular.\n *\n * Angular templates can only bind attribute names written out literally, so a\n * hand-transcribed `[attr.*]` list silently drops any attribute the shared\n * factory later adds. Driving attributes and listeners from the binding object\n * keeps Angular in step with the other wrappers by construction.\n */\n\nexport interface ElementBindings {\n readonly attributes?: Readonly<Record<string, string | undefined>>;\n readonly listeners?: Readonly<Record<string, ((event: Event) => void) | undefined>>;\n}\n\nexport interface ElementBindingTarget {\n getAttribute(name: string): string | null;\n setAttribute(name: string, value: string): void;\n removeAttribute(name: string): void;\n addEventListener(name: string, listener: (event: Event) => void): void;\n removeEventListener(name: string, listener: (event: Event) => void): void;\n}\n\nexport type AttachedListeners = readonly (readonly [string, (event: Event) => void])[];\n\nexport interface AppliedElementBindings {\n readonly attributes: readonly string[];\n readonly listeners: AttachedListeners;\n}\n\nexport const EMPTY_APPLIED_ELEMENT_BINDINGS: AppliedElementBindings = {\n attributes: [],\n listeners: [],\n};\n\nexport function applyElementBindings(\n element: ElementBindingTarget,\n bindings: ElementBindings,\n applied: AppliedElementBindings,\n): AppliedElementBindings {\n return {\n attributes: syncAttributes(element, bindings.attributes ?? {}, applied.attributes),\n listeners: syncListeners(element, bindings.listeners ?? {}, applied.listeners),\n };\n}\n\nexport function detachElementListeners(\n element: ElementBindingTarget,\n listeners: AttachedListeners,\n): void {\n for (const [name, handler] of listeners) element.removeEventListener(name, handler);\n}\n\nfunction syncAttributes(\n element: ElementBindingTarget,\n attributes: Readonly<Record<string, string | undefined>>,\n applied: readonly string[],\n): readonly string[] {\n for (const name of applied) {\n if (attributes[name] === undefined) element.removeAttribute(name);\n }\n const next: string[] = [];\n for (const [name, value] of Object.entries(attributes)) {\n if (value === undefined) continue;\n if (element.getAttribute(name) !== value) element.setAttribute(name, value);\n next.push(name);\n }\n return next;\n}\n\nfunction syncListeners(\n element: ElementBindingTarget,\n listeners: Readonly<Record<string, ((event: Event) => void) | undefined>>,\n attached: AttachedListeners,\n): AttachedListeners {\n const next = Object.entries(listeners).flatMap(([name, handler]) =>\n handler === undefined ? [] : [[name, handler] as const],\n );\n const unchanged =\n next.length === attached.length &&\n next.every(([name, handler], index) => {\n const current = attached[index];\n return current !== undefined && current[0] === name && current[1] === handler;\n });\n if (unchanged) return attached;\n detachElementListeners(element, attached);\n for (const [name, handler] of next) element.addEventListener(name, handler);\n return next;\n}\n","import {\n Directive,\n ElementRef,\n Input,\n NgZone,\n inject,\n type OnChanges,\n type OnDestroy,\n} from \"@angular/core\";\nimport {\n type AppliedElementBindings,\n EMPTY_APPLIED_ELEMENT_BINDINGS,\n type ElementBindings,\n applyElementBindings,\n detachElementListeners,\n} from \"./element-bindings\";\n\n/** Applies a wrapper binding's attributes and listeners to the element host. */\n@Directive({\n selector: \"[openreceiveElementBindings]\",\n standalone: true,\n})\nexport class ElementBindingsDirective implements OnChanges, OnDestroy {\n @Input(\"openreceiveElementBindings\") bindings: ElementBindings = {};\n\n private applied: AppliedElementBindings = EMPTY_APPLIED_ELEMENT_BINDINGS;\n // Zone-wrapped handlers are cached per original handler: the applier compares\n // identity to decide whether to re-attach, so a fresh wrapper each pass would\n // detach and re-add every listener on every change.\n private readonly zoneWrapped = new WeakMap<(event: Event) => void, (event: Event) => void>();\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly zone = inject(NgZone);\n\n ngOnChanges(): void {\n // Setting attributes restarts the element's poll/countdown timers. Applying them\n // outside Angular keeps those timers unpatched, so they never schedule a change\n // detection pass; the listeners below re-enter the zone for host callbacks.\n this.zone.runOutsideAngular(() => {\n this.applied = applyElementBindings(\n this.host.nativeElement,\n { ...this.bindings, listeners: this.zoneListeners(this.bindings.listeners) },\n this.applied,\n );\n });\n }\n\n ngOnDestroy(): void {\n detachElementListeners(this.host.nativeElement, this.applied.listeners);\n this.applied = EMPTY_APPLIED_ELEMENT_BINDINGS;\n }\n\n private zoneListeners(\n listeners: ElementBindings[\"listeners\"],\n ): Readonly<Record<string, ((event: Event) => void) | undefined>> {\n if (listeners === undefined) return {};\n const wrapped: Record<string, ((event: Event) => void) | undefined> = {};\n for (const [name, handler] of Object.entries(listeners)) {\n if (handler === undefined) continue;\n let entry = this.zoneWrapped.get(handler);\n if (entry === undefined) {\n entry = (event: Event) => this.zone.run(() => handler(event));\n this.zoneWrapped.set(handler, entry);\n }\n wrapped[name] = entry;\n }\n return wrapped;\n }\n}\n","import {\n type AfterViewInit,\n ChangeDetectorRef,\n Component,\n CUSTOM_ELEMENTS_SCHEMA,\n Input,\n inject,\n NgZone,\n type OnChanges,\n} from \"@angular/core\";\nimport {\n type CheckoutSnapshot,\n createWrapperCheckoutShellBinding,\n defineElements,\n type ThemePreference,\n validateCheckoutProps,\n type WrapperCheckoutShellBinding,\n type WrapperCheckoutShellOptions,\n} from \"@openreceive/angular\";\nimport type { ElementBindings } from \"./element-bindings\";\nimport { ElementBindingsDirective } from \"./openreceive-element-bindings.directive\";\n\n@Component({\n selector: \"openreceive-angular-checkout\",\n standalone: true,\n imports: [ElementBindingsDirective],\n schemas: [CUSTOM_ELEMENTS_SCHEMA],\n template: `\n <section [openreceiveElementBindings]=\"rootBindings\">\n @if (elementsReady && shell; as shell) {\n @if (shell.themeToggle) {\n <openreceive-theme-toggle\n [openreceiveElementBindings]=\"shell.themeToggle\"\n ></openreceive-theme-toggle>\n }\n <openreceive-checkout [openreceiveElementBindings]=\"shell.checkout\"></openreceive-checkout>\n }\n </section>\n `,\n})\nexport class CheckoutComponent implements AfterViewInit, OnChanges {\n // Prop names, defaults, and per-mode applicability are the shared contract in\n // docs/internal/wrapper-parity.md. These inputs RESTATE it because `@Input()`\n // is a decorator on a declared field: a type cannot generate fields, so they\n // cannot be derived from WrapperCheckoutComponentProps the way\n // Vue's defineProps and React's CheckoutProps are. The duplication is forced,\n // not neglected; tests/wrapper-parity.test.mjs is what keeps it in step.\n // Snapshot mode: bind a `checkout` to render it directly.\n // Create mode: omit `checkout` and bind `reference` (+ optional `prefix`); the underlying\n // <openreceive-checkout> element creates the checkout, then renders and polls itself.\n @Input() checkout?: CheckoutSnapshot | null;\n @Input() reference?: string;\n @Input() prefix?: string;\n @Input() csrfHeader?: string;\n @Input() paymentWizard?: boolean;\n @Input() decodeLinkUrl?: string;\n @Input() themeToggle?: boolean;\n @Input() defaultTheme?: ThemePreference;\n @Input() storageKey?: string;\n // Create mode only.\n @Input() metadata?: Record<string, unknown>;\n @Input() syncUrl?: boolean;\n @Input() resumePathPrefix?: string;\n @Input() routeReference?: string;\n @Input() resumePaymentHash?: string;\n @Input() resumePaymentRail?: \"lightning\" | \"swap\";\n @Input() resumable?: boolean;\n @Input() onCopy?: (event: Event) => void;\n @Input() onOpenWallet?: (event: Event) => void;\n @Input() onState?: (event: Event) => void;\n @Input() onSettled?: (event: Event) => void;\n @Input() onProviderCopy?: (event: Event) => void;\n @Input() onStartOver?: (event: Event) => void;\n @Input() onError?: (event: Event) => void;\n @Input() options: WrapperCheckoutShellOptions = {};\n\n /**\n * The custom elements render only once this flips, and it flips inside\n * `runOutsideAngular`: the element starts poll and countdown timers in its\n * connected callback, and zone-patched timers would schedule a change-detection\n * pass on every tick for the lifetime of the checkout.\n */\n protected elementsReady = false;\n\n private readonly zone = inject(NgZone);\n private readonly changeDetector = inject(ChangeDetectorRef);\n\n // Rebuilt on input changes only. A getter would rebuild the whole binding\n // (storage reads, matchMedia, fresh objects) on every change-detection pass.\n // Null until the first `ngOnChanges`: inputs are not set yet at construction,\n // so building (and validating) here would reject every instantiation.\n protected shellBinding: WrapperCheckoutShellBinding | null = null;\n\n // The shell root's attributes, driven by the same directive as the custom\n // elements: a hand-transcribed [attr.*] list would silently drop any root\n // attribute the shared factory later adds.\n protected rootBindings: ElementBindings = {};\n\n ngAfterViewInit(): void {\n // No-op during Angular Universal SSR: custom elements only exist in the\n // browser, and the element renders itself after hydration.\n if (globalThis.customElements === undefined || globalThis.HTMLElement === undefined) return;\n this.zone.runOutsideAngular(() => {\n defineElements();\n this.elementsReady = true;\n // Rebuild so the mounted shell carries the stored theme, not the deferred default.\n this.applyShell();\n this.changeDetector.detectChanges();\n });\n }\n\n ngOnChanges(): void {\n this.applyShell();\n }\n\n get shell(): WrapperCheckoutShellBinding | null {\n return this.shellBinding;\n }\n\n private applyShell(): void {\n this.shellBinding = this.buildShell();\n this.rootBindings = { attributes: this.shellBinding.rootAttributes };\n }\n\n private buildShell(): WrapperCheckoutShellBinding {\n validateCheckoutProps({\n framework: \"@openreceive/angular\",\n checkout: this.checkout,\n reference: this.reference,\n metadata: this.metadata,\n syncUrl: this.syncUrl,\n resumePathPrefix: this.resumePathPrefix,\n routeReference: this.routeReference,\n resumePaymentHash: this.resumePaymentHash,\n resumePaymentRail: this.resumePaymentRail,\n });\n const options: WrapperCheckoutShellOptions = {\n ...this.options,\n themeToggle: this.themeToggle ?? this.options.themeToggle ?? true,\n // Storage and matchMedia only exist in the browser: resolving the theme before\n // the elements mount would make a server-rendered shell disagree with hydration.\n deferThemeResolution: !this.elementsReady,\n ...(this.reference === undefined ? {} : { reference: this.reference }),\n ...(this.prefix === undefined ? {} : { prefix: this.prefix }),\n ...(this.csrfHeader === undefined ? {} : { csrfHeader: this.csrfHeader }),\n ...(this.paymentWizard === undefined ? {} : { paymentWizard: this.paymentWizard }),\n ...(this.decodeLinkUrl === undefined ? {} : { decodeLinkUrl: this.decodeLinkUrl }),\n ...(this.defaultTheme === undefined ? {} : { defaultTheme: this.defaultTheme }),\n ...(this.storageKey === undefined ? {} : { storageKey: this.storageKey }),\n ...(this.metadata === undefined ? {} : { metadata: this.metadata }),\n ...(this.syncUrl === undefined ? {} : { syncUrl: this.syncUrl }),\n ...(this.resumePathPrefix === undefined ? {} : { resumePathPrefix: this.resumePathPrefix }),\n ...(this.routeReference === undefined ? {} : { routeReference: this.routeReference }),\n ...(this.resumePaymentHash === undefined\n ? {}\n : { resumePaymentHash: this.resumePaymentHash }),\n ...(this.resumePaymentRail === undefined\n ? {}\n : { resumePaymentRail: this.resumePaymentRail }),\n ...(this.resumable === undefined ? {} : { resumable: this.resumable }),\n ...(this.onCopy === undefined ? {} : { onCopy: this.onCopy }),\n ...(this.onOpenWallet === undefined ? {} : { onOpenWallet: this.onOpenWallet }),\n ...(this.onState === undefined ? {} : { onState: this.onState }),\n ...(this.onSettled === undefined ? {} : { onSettled: this.onSettled }),\n ...(this.onProviderCopy === undefined ? {} : { onProviderCopy: this.onProviderCopy }),\n ...(this.onStartOver === undefined ? {} : { onStartOver: this.onStartOver }),\n ...(this.onError === undefined ? {} : { onError: this.onError }),\n };\n return createWrapperCheckoutShellBinding(this.checkout ?? null, options);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './openreceive-checkout.component';\n"],"names":[],"mappings":";;;;AAAA;;;;;;;AAOG;AAsBI,MAAM,8BAA8B,GAA2B;AACpE,IAAA,UAAU,EAAE,EAAE;AACd,IAAA,SAAS,EAAE,EAAE;CACd;SAEe,oBAAoB,CAClC,OAA6B,EAC7B,QAAyB,EACzB,OAA+B,EAAA;IAE/B,OAAO;AACL,QAAA,UAAU,EAAE,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,IAAI,EAAE,EAAE,OAAO,CAAC,UAAU,CAAC;AAClF,QAAA,SAAS,EAAE,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,IAAI,EAAE,EAAE,OAAO,CAAC,SAAS,CAAC;KAC/E;AACH;AAEM,SAAU,sBAAsB,CACpC,OAA6B,EAC7B,SAA4B,EAAA;AAE5B,IAAA,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,SAAS;AAAE,QAAA,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,OAAO,CAAC;AACrF;AAEA,SAAS,cAAc,CACrB,OAA6B,EAC7B,UAAw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,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAbS,wBAAwB,EAAA,QAAA,EAAA,8BAAA,EAAA,MAAA,EAAA,CAAA,4BAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;2FAevB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAlB7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,8BAA8B;AACxC,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,wBAAwB,CAAC;oBACnC,OAAO,EAAE,CAAC,sBAAsB,CAAC;AACjC,oBAAA,QAAQ,EAAE;;;;;;;;;;;AAWT,EAAA,CAAA;AACF,iBAAA;;sBAWE;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBAEA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;sBACA;;;AC1EH;;AAEG;;;;"}
@@ -30,6 +30,7 @@ declare class CheckoutComponent implements AfterViewInit, OnChanges {
30
30
  resumePathPrefix?: string;
31
31
  routeReference?: string;
32
32
  resumePaymentHash?: string;
33
+ resumePaymentRail?: "lightning" | "swap";
33
34
  resumable?: boolean;
34
35
  onCopy?: (event: Event) => void;
35
36
  onOpenWallet?: (event: Event) => void;
@@ -56,7 +57,7 @@ declare class CheckoutComponent implements AfterViewInit, OnChanges {
56
57
  private applyShell;
57
58
  private buildShell;
58
59
  static ɵfac: i0.ɵɵFactoryDeclaration<CheckoutComponent, never>;
59
- static ɵcmp: i0.ɵɵComponentDeclaration<CheckoutComponent, "openreceive-angular-checkout", never, { "checkout": { "alias": "checkout"; "required": false; }; "reference": { "alias": "reference"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "csrfHeader": { "alias": "csrfHeader"; "required": false; }; "paymentWizard": { "alias": "paymentWizard"; "required": false; }; "decodeLinkUrl": { "alias": "decodeLinkUrl"; "required": false; }; "themeToggle": { "alias": "themeToggle"; "required": false; }; "defaultTheme": { "alias": "defaultTheme"; "required": false; }; "storageKey": { "alias": "storageKey"; "required": false; }; "metadata": { "alias": "metadata"; "required": false; }; "syncUrl": { "alias": "syncUrl"; "required": false; }; "resumePathPrefix": { "alias": "resumePathPrefix"; "required": false; }; "routeReference": { "alias": "routeReference"; "required": false; }; "resumePaymentHash": { "alias": "resumePaymentHash"; "required": false; }; "resumable": { "alias": "resumable"; "required": false; }; "onCopy": { "alias": "onCopy"; "required": false; }; "onOpenWallet": { "alias": "onOpenWallet"; "required": false; }; "onState": { "alias": "onState"; "required": false; }; "onSettled": { "alias": "onSettled"; "required": false; }; "onProviderCopy": { "alias": "onProviderCopy"; "required": false; }; "onStartOver": { "alias": "onStartOver"; "required": false; }; "onError": { "alias": "onError"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, {}, never, never, true, never>;
60
+ static ɵcmp: i0.ɵɵComponentDeclaration<CheckoutComponent, "openreceive-angular-checkout", never, { "checkout": { "alias": "checkout"; "required": false; }; "reference": { "alias": "reference"; "required": false; }; "prefix": { "alias": "prefix"; "required": false; }; "csrfHeader": { "alias": "csrfHeader"; "required": false; }; "paymentWizard": { "alias": "paymentWizard"; "required": false; }; "decodeLinkUrl": { "alias": "decodeLinkUrl"; "required": false; }; "themeToggle": { "alias": "themeToggle"; "required": false; }; "defaultTheme": { "alias": "defaultTheme"; "required": false; }; "storageKey": { "alias": "storageKey"; "required": false; }; "metadata": { "alias": "metadata"; "required": false; }; "syncUrl": { "alias": "syncUrl"; "required": false; }; "resumePathPrefix": { "alias": "resumePathPrefix"; "required": false; }; "routeReference": { "alias": "routeReference"; "required": false; }; "resumePaymentHash": { "alias": "resumePaymentHash"; "required": false; }; "resumePaymentRail": { "alias": "resumePaymentRail"; "required": false; }; "resumable": { "alias": "resumable"; "required": false; }; "onCopy": { "alias": "onCopy"; "required": false; }; "onOpenWallet": { "alias": "onOpenWallet"; "required": false; }; "onState": { "alias": "onState"; "required": false; }; "onSettled": { "alias": "onSettled"; "required": false; }; "onProviderCopy": { "alias": "onProviderCopy"; "required": false; }; "onStartOver": { "alias": "onStartOver"; "required": false; }; "onError": { "alias": "onError"; "required": false; }; "options": { "alias": "options"; "required": false; }; }, {}, never, never, true, never>;
60
61
  }
61
62
 
62
63
  export { CheckoutComponent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openreceive/angular",
3
- "version": "0.4.14",
3
+ "version": "0.4.16",
4
4
  "description": "Angular component for Bitcoin Lightning checkout and optional USDT, USDC, SOL and ETH swaps.",
5
5
  "keywords": [
6
6
  "bitcoin",
@@ -20,8 +20,8 @@
20
20
  "module": "./dist/fesm2022/openreceive-angular.mjs",
21
21
  "types": "./dist/types/openreceive-angular.d.ts",
22
22
  "dependencies": {
23
- "@openreceive/browser": "0.4.14",
24
- "@openreceive/elements": "0.4.14"
23
+ "@openreceive/browser": "0.4.16",
24
+ "@openreceive/elements": "0.4.16"
25
25
  },
26
26
  "peerDependencies": {
27
27
  "@angular/core": ">=17.0.0"
@@ -39,7 +39,6 @@
39
39
  },
40
40
  "files": [
41
41
  "dist",
42
- "skills",
43
42
  "README.md",
44
43
  "LICENSE"
45
44
  ],
@@ -1,97 +0,0 @@
1
- ---
2
- name: debug-openreceive-payment
3
- description: >
4
- Diagnose a failing OpenReceive integration. Use when an OpenReceive-powered
5
- checkout misbehaves: the server refuses to boot, checkout routes return 403,
6
- 404, 409, or 5xx, a paid invoice never settles, a swap refund seems
7
- unreachable, or the checkout UI renders nothing.
8
- license: MIT
9
- ---
10
-
11
- # Debug an OpenReceive payment
12
-
13
- Work top-down: configuration, then the request, then settlement. Every guide
14
- URL below is raw markdown — fetch it when the step needs it.
15
-
16
- ## 1. Run the doctor first
17
-
18
- ```sh
19
- npx openreceive doctor # Node version, NWC_URI, swap config, wallet probe
20
- npx openreceive doctor --db <db> # + are openreceive_payments/openreceive_meta migrated?
21
- npx openreceive doctor --url http://localhost:3000 # + are the routes actually mounted?
22
- ```
23
-
24
- Each failing line states its own fix. `npx openreceive debug-report` prints the
25
- same diagnostics redacted, always exit 0 — safe to share.
26
-
27
- ## 2. Boot failures
28
-
29
- | Symptom | Cause and fix |
30
- | --- | --- |
31
- | `MISSING_NWC` / "needs a receive-only NWC code" | `NWC_URI` is not in the server process env. A `.env` file alone is not enough — something must load it (`dotenv/config`, Next auto-load). Get a code: https://openreceive.org/get_a_nwc_code_to_receive_payments |
32
- | `INVALID_NWC` / "not a valid NWC code" | The value is malformed (must be `nostr+walletconnect://` with 64-hex pubkey and secret, ≥1 `wss` relay). Re-copy it from the wallet. |
33
- | "NOT receive-only" / spend methods advertised | The wallet minted a spend-capable code; OpenReceive fails closed because a leak would drain the wallet. Mint a receive-only code. Overriding (`allowSpendCapableWallet` / `OPENRECEIVE_ALLOW_SPEND_CAPABLE_NWC`) is a last resort. |
34
- | Wallet preflight failed (methods/encryption) | The wallet must advertise `make_invoice` + `list_transactions` and NIP-04 or NIP-44 v2. Use a compatible wallet. |
35
- | "The openreceive_meta table does not exist" / raw `no such table: openreceive_payments` | The migration was never applied. Node: `npx openreceive scaffold payments --orm <yours>`, then run the emitted migration through the app's normal workflow. Rails: `bin/rails generate openreceive:install`, then `bin/rails db:migrate`. https://openreceive.org/guides/storage.md |
36
- | "requires amountFor / onPaid / authorize / host" | The factory is missing a required hook — see the host contract in https://openreceive.org/guides/api-reference.md |
37
-
38
- ## 3. Request-time errors from the routes
39
-
40
- | Status | Meaning | Where to look |
41
- | --- | --- | --- |
42
- | 403 FORBIDDEN | Your own `authorize` hook denied it, or the request looked cross-site. Check the session/cookie actually reaches the checkout routes. https://openreceive.org/guides/authorization.md |
43
- | Never 403s — any visitor can mint, poll, or refund for any reference | The opposite failure: on Rails the generated `config.authorize = OpenReceive::ALLOW_ALL_AUTHORIZE` placeholder is still installed (the engine warns at boot; `bin/rails openreceive:doctor` reports it). Replace it with the app's real ownership check. https://openreceive.org/guides/authorization.md |
44
- | 404 NOT_FOUND | `amountFor` returned `null` (unknown reference), or the `payment_hash` does not belong to that reference. |
45
- | 409 CONFLICT | **Normal state, not a bug**: the reference already settled, or an unpaid checkout for that method is already live. Show it as order state; never retry-loop. |
46
- | 503 retryable | The host hook failed while persisting the attempt (instructions withheld), or the wallet is unavailable. Read the server log for the underlying error. |
47
- | Framework 404 / HTML error page | The router is not mounted, or mounted at a different prefix than the UI's `prefix` prop. `doctor --url` distinguishes these. |
48
-
49
- ## 4. Paid but never settles
50
-
51
- - Settlement is opportunistic: any OpenReceive request runs one reconcile pass
52
- through a durable gate (min 3s between wallet scans, stretched by invoice
53
- age). A quiet server settles on the next request — or run the optional
54
- notification worker. No timer is missing; that is the design.
55
- - An unpaid attempt closes only after a successful wallet scan at/after expiry
56
- plus a 900s grace constant — a local clock alone never closes one. `expired`
57
- arriving "late" is correct.
58
- - `onPaid` runs once per reference, first settled attempt only, inside the
59
- settlement transaction. If your fulfillment did not run, check whether the
60
- guarded `UPDATE … WHERE` matched zero rows (already transitioned).
61
- https://openreceive.org/guides/storage.md
62
-
63
- ## 5. Swaps and refunds
64
-
65
- - A deposit that arrives short or late becomes `refund_required`; the payer
66
- claims it on a second visit. That needs a per-order URL you serve
67
- (`/checkout/:reference`, `syncUrl` on the drop-ins). Keep the
68
- `payment_hash`: `POST /swaps/status` reopens the attempt with no expiry
69
- window, while re-picking the coin mints a new deposit after ~30 minutes.
70
- - Refunds exist only for swap deposits from `refund_required`. There is **no
71
- Lightning refund** — the wallet cannot spend. Do not chase one.
72
- https://openreceive.org/guides/swap-refunds.md
73
- - "Payer reports two different amounts on a stablecoin checkout" (50.05 or
74
- 50.03?): the deposit amount is a token quantity, `fee.pay_in_fiat` is its
75
- fiat valuation. Only `swap.deposit_amount` is an instruction. From 0.4.10 the
76
- packaged checkout renders a USD stablecoin's breakdown in the token and never
77
- shows `pay_in_fiat`; on an older bundle, upgrade `@openreceive/*`. To verify,
78
- read the row's `deposit_amount` and `fee` and confirm the UI shows only the
79
- deposit amount. A custom UI must call `createSwapFeeBreakdown(fee, swap)`
80
- with the swap, not the fee alone.
81
-
82
- ## 6. Checkout UI shows nothing
83
-
84
- - The components require `prefix` — the exact base path the routes are mounted
85
- at (`"/openreceive"` unless you changed it).
86
- - Import the stylesheet (`@openreceive/react/styles.css` or the elements
87
- sheet).
88
- - "invoice must not be an NWC connection string" means a server secret leaked
89
- into a browser payload — stop and fix the server response; never render it.
90
- https://openreceive.org/guides/frontend-checkout.md
91
-
92
- ## Still stuck
93
-
94
- The full route/option/error reference:
95
- https://openreceive.org/guides/api-reference.md · machine-readable contract:
96
- https://openreceive.org/openapi.yaml · library bug reports:
97
- https://openreceive.org/contact
@@ -1,139 +0,0 @@
1
- ---
2
- name: integrate-openreceive
3
- description: >
4
- Integrate OpenReceive inbound Bitcoin Lightning payments into an application.
5
- Use when adding Bitcoin, Lightning, or crypto checkout to a Node.js, Express,
6
- Fastify, Next.js, Rails, React, Vue, Svelte, Angular, or plain-HTML
7
- application with OpenReceive (the @openreceive/* npm packages or the
8
- openreceive-rails gem), or when connecting a BTCPay Server store to a
9
- receive-only NWC wallet with the OpenReceive plugin.
10
- license: MIT
11
- ---
12
-
13
- # Integrate OpenReceive
14
-
15
- OpenReceive is a payment library that runs inside the application you are
16
- editing. It mounts HTTP routes there, issues Lightning invoices against a
17
- wallet the merchant already controls, and calls back into your code when one
18
- settles. There is no OpenReceive account and no API key; funds land directly in
19
- the merchant's wallet. The one required credential is a **receive-only NWC
20
- code** (`NWC_URI`).
21
-
22
- ## Pick the stack, then follow its directions
23
-
24
- 1. Identify the server stack of the application you are in.
25
- 2. Open the matching reference — it is complete (quickstart inlined) and needs
26
- no network access:
27
- - Node, Express: [references/node.md](references/node.md)
28
- - Node, Fastify: [references/fastify.md](references/fastify.md)
29
- - Node, Next.js App Router: [references/next.md](references/next.md)
30
- - Rails: [references/rails.md](references/rails.md)
31
- - Django: [references/django.md](references/django.md)
32
- - Laravel: [references/laravel.md](references/laravel.md)
33
- - WordPress + WooCommerce: [references/woocommerce.md](references/woocommerce.md) — the packaged gateway and merchant settings.
34
- - BTCPay Server: [references/btcpay.md](references/btcpay.md) — a plugin,
35
- configured in BTCPay's store UI or Greenfield API; no application code,
36
- no npm packages, no gem. The rest of this file is about the library.
37
- 3. Follow its **Step 0** first: before writing code or searching the machine,
38
- ask the user for the receive-only NWC code (then the swap URI), one question
39
- per message, and store each pasted code in the project's env file yourself.
40
- Never print the value; never invent a placeholder.
41
-
42
- Install, per adapter — Express: `npm install @openreceive/express @openreceive/react`;
43
- Fastify: `npm install @openreceive/fastify @openreceive/react`; Next.js:
44
- `npm install @openreceive/next @openreceive/react`. Swap the UI package (`vue`,
45
- `svelte`, `angular`, `elements`) for the frontend the app already has. Install
46
- (Rails): `bundle add openreceive-rails`.
47
-
48
- ## The three server objects
49
-
50
- | Object | Built with | Talks to |
51
- | --- | --- | --- |
52
- | Wallet client | `createOpenReceive()` | the merchant's wallet — mints invoices, reads settlement, holds the NWC code |
53
- | Host | `createHost()` | your database — your hooks plus the `openreceive_payments` table |
54
- | HTTP routes | `openReceiveExpress()` / `openReceiveFastify()` / `openReceiveNext()` / the Rails engine | the browser — mounted at `/openreceive` by default |
55
-
56
- The quickstart's one-factory form (`openReceiveExpress({ wallet, storage,
57
- amountFor, authorize })`) builds all three; compose them separately only for a
58
- shared wallet client or a custom repository. The checkout UI
59
- (`<Checkout reference={...} prefix="/openreceive" />`) is the optional fourth
60
- piece.
61
-
62
- ## The host contract: authorize, amountFor, onPaid
63
-
64
- Your application keeps orders, users, prices, and fulfillment. Three hooks are
65
- the entire bridge — wire them to the models this app already has, never to
66
- copied demo models:
67
-
68
- - `amountFor(reference)` — the authoritative price, read from your own data.
69
- Return `{ currency, value, description }` with `value` a **decimal string**
70
- (never a float, never payer input), or `null` when there is nothing to pay
71
- for. The `reference` is your order id: one per thing you fulfill, created
72
- before checkout, kept across retries, never reused.
73
- - `authorize({ action, request, resource })` — your own access check, run on
74
- every request. `resource.reference` is a claim the payer made, not proof;
75
- read a real session.
76
- - `onPaid({ reference, paidAt, query })` — fulfillment, run once per reference
77
- inside the settlement transaction, only for the first settled attempt. Use
78
- the provided `query`, not your ORM's other connection, and guard the
79
- transition (`UPDATE … WHERE state = 'awaiting_payment'`).
80
-
81
- ## 409 is a state, not a failure
82
-
83
- The library serializes attempts per reference. A create that returns **409
84
- CONFLICT** is normal checkout flow: the reference already settled, or an unpaid
85
- checkout for that payment method is already in progress. Surface it as order
86
- state; do not retry-loop it, and do not build an idempotency store around it —
87
- that serialization is the library's job. (A hook failure while persisting an
88
- attempt is a **503 retryable**, deliberately distinct.)
89
-
90
- ## Amounts on the deposit panel
91
-
92
- `swap.deposit_amount` is the ONLY amount a payer is ever told to send, in the
93
- pay-in token. `swap.fee.pay_in_fiat` / `payout_fiat` are fiat valuations that
94
- explain the spread (why the deposit exceeds the cart total); they are not
95
- instructions. For a stablecoin pegged to the fee currency (USDT, USDC) the
96
- packaged checkout expresses the breakdown in the token and never renders
97
- `pay_in_fiat` — "$50.03" under "50.05 USDC" reads as the same number with a
98
- typo. A custom UI gets the same rule from `createSwapFeeBreakdown(fee, swap)`;
99
- pass the swap, not just the fee.
100
-
101
- ## Secrets
102
-
103
- `NWC_URI` and `LSC_URI_*` are server-only. Never put them in browser code,
104
- logs, assets, or tests. Boot fails closed if the NWC code advertises spend
105
- methods such as `pay_invoice` — mint a receive-only code
106
- (https://openreceive.org/get_a_nwc_code_to_receive_payments) instead of
107
- overriding.
108
-
109
- ## Database tables
110
-
111
- ```sh
112
- npx openreceive scaffold payments --orm prisma # or drizzle | typeorm | sequelize | knex
113
- ```
114
-
115
- emits the `openreceive_payments` + `openreceive_meta` migration for THIS app's
116
- database (Rails: `bin/rails generate openreceive:install`); run it through the
117
- app's normal migration workflow. The tables sit beside your models — no
118
- relations to them, no separate database, no Redis.
119
-
120
- ## Verify, and test without a real wallet
121
-
122
- `npx openreceive doctor` checks the configuration and says what to fix.
123
-
124
- For tests, inject a fake wallet at the stable seams — `client` on
125
- `createOpenReceive` (any object with `preflight`, `makeInvoice`,
126
- `listTransactions`) or `config.nwc_client` in Rails — plus
127
- `StaticPriceProvider` for fiat pricing without a network. Your routes,
128
- persistence, reconcile, and `onPaid` then run the production code paths.
129
- Details: https://openreceive.org/guides/host-testing.md
130
-
131
- ## Deeper documentation
132
-
133
- Fetch on demand — each URL is raw markdown:
134
- https://openreceive.org/guides/authorization.md ·
135
- https://openreceive.org/guides/storage.md ·
136
- https://openreceive.org/guides/api-reference.md ·
137
- https://openreceive.org/guides/security.md ·
138
- https://openreceive.org/openapi.yaml (the normative HTTP contract) ·
139
- https://openreceive.org/llms.txt (the full index)