Context
The invoice callback response hard-codes two protocol fields:
src/Invoice/Application/InvoiceGenerator.php — mapResponseAsArray() always emits successAction => { tag: 'message', message: <config successMessage> } and disposable => false.
LUD-09 (successAction) supports a url action (open a URL after payment) in addition to message; LUD-11 defines disposable.
Goal
Make successAction and disposable configurable so operators can send a URL success action (e.g. an order/receipt page) and control disposability, per LUD-09 / LUD-11.
Scope / Tasks
Implementation notes
- LUD-09
url action shape: { "tag": "url", "description": <string>, "url": <string> }; message action: { "tag": "message", "message": <string ≤144 chars> }. Enforce the 144-char cap on message.
- Default remains the
message action using the existing success-message config, so current configs are unaffected.
- Follow the established config plumbing (
LightningConfig fluent setter + jsonSerialize(), InvoiceConfig::get(ConfigKey::…)).
Acceptance criteria
References
Context
The invoice callback response hard-codes two protocol fields:
src/Invoice/Application/InvoiceGenerator.php—mapResponseAsArray()always emitssuccessAction => { tag: 'message', message: <config successMessage> }anddisposable => false.LUD-09 (successAction) supports a
urlaction (open a URL after payment) in addition tomessage; LUD-11 definesdisposable.Goal
Make
successActionanddisposableconfigurable so operators can send a URL success action (e.g. an order/receipt page) and control disposability, per LUD-09 / LUD-11.Scope / Tasks
messagedefault, add an optionalurlaction. Suggested API:LightningConfig::setSuccessUrl(string $description, string $url)(LUD-09urlaction requires both adescriptionand aurl). Add matchingInvoiceConfiggetters +ConfigKeyentries.LightningConfig::setDisposable(bool)→InvoiceConfig::isDisposable(): bool, defaultfalse(unchanged).InvoiceGenerator::mapResponseAsArray()emits the configuredsuccessAction(message or url) anddisposablefrom config.successActionshape becomes a union) and the README.Implementation notes
urlaction shape:{ "tag": "url", "description": <string>, "url": <string> };messageaction:{ "tag": "message", "message": <string ≤144 chars> }. Enforce the 144-char cap onmessage.messageaction using the existingsuccess-messageconfig, so current configs are unaffected.LightningConfigfluent setter +jsonSerialize(),InvoiceConfig::get(ConfigKey::…)).Acceptance criteria
messageaction,disposable:false).urlsuccessAction.disposablereflects config.composer test-allgreen.References