Fix docs for invoice_payment hook and notification
The data-format changed in 2019. The field `amount_msat` was renamed to `msat` (See2907e430d5
) The data-format changed again in november 2023. The content of the field `amount_msat` was changed. It was a string `"1000msat"` and became a number `1000`. (See0b23133ab2
) The current documentation still mentions the data-format before2907e430d5
. I've updated the docs to reflect the latest changes. I've also incluced a short mention of0b23133ab2
to help help developers create plugins that work both pre 23.11 and post 23.11.
This commit is contained in:
parent
4d22f5af2d
commit
acce3b1b32
|
@ -114,12 +114,14 @@ A notification for topic `invoice_payment` is sent every time an invoice is paid
|
|||
"invoice_payment": {
|
||||
"label": "unique-label-for-invoice",
|
||||
"preimage": "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"amount_msat": 10000
|
||||
"msat": 10000,
|
||||
}
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Before version `23.11` the `msat` field was a string with msat-suffix, e.g: `"10000msat"`.
|
||||
|
||||
Note that there will be a string member "outpoint" ("txid:outnum") if
|
||||
the payment was onchain (possible with the *invoices-onchain-fallback*
|
||||
config option).
|
||||
|
|
|
@ -163,12 +163,11 @@ This hook is called whenever a valid payment for an unpaid invoice has arrived.
|
|||
"payment": {
|
||||
"label": "unique-label-for-invoice",
|
||||
"preimage": "0000000000000000000000000000000000000000000000000000000000000000",
|
||||
"amount_msat": 10000
|
||||
"msat": 10000
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Before version `23.11` the `msat` field was a string with msat-suffix, e.g: `"10000msat"`.
|
||||
|
||||
The hook is deliberately sparse, since the plugin can use the JSON-RPC `listinvoices` command to get additional details about this invoice. It can return a `failure_message` field as defined for final nodes in [BOLT 4](https://github.com/lightning/bolts/blob/master/04-onion-routing.md#failure-messages), a `result` field with the string
|
||||
`reject` to fail it with `incorrect_or_unknown_payment_details`, or a `result` field with the string `continue` to accept the payment.
|
||||
|
|
Loading…
Reference in New Issue