| 2131 | } |
| 2132 | |
| 2133 | static void payment_notify_failure(struct payment *p, const char *error_message) |
| 2134 | { |
| 2135 | struct json_stream *n; |
| 2136 | |
| 2137 | n = plugin_notification_start_obs(p->plugin, "pay_failure"); |
| 2138 | /* Fake up the old "payload" style, *and* the old unwrapped style */ |
| 2139 | if (notification_deprecated_out_ok(p->plugin, "notification", "payload", |
| 2140 | "v25.09", "v26.09")) { |
| 2141 | json_add_string(n, "origin", "pay"); |
| 2142 | json_object_start(n, "payload"); |
| 2143 | payment_failure_notify_core(p, n, error_message); |
| 2144 | json_object_end(n); |
| 2145 | } |
| 2146 | |
| 2147 | json_object_start(n, "pay_failure"); |
| 2148 | payment_failure_notify_core(p, n, error_message); |
| 2149 | json_object_end(n); |
| 2150 | plugin_notification_end_obs(p->plugin, n); |
| 2151 | } |
| 2152 | |
| 2153 | /* Code shared by selfpay fast-path: populate JSON output for successful |
| 2154 | * payment, and send pay_success notification. */ |
no test coverage detected