| 2115 | } |
| 2116 | |
| 2117 | static void payment_notify_failure(struct payment *p, const char *error_message) |
| 2118 | { |
| 2119 | struct json_stream *n; |
| 2120 | |
| 2121 | n = plugin_notification_start_obs(p->plugin, "pay_failure"); |
| 2122 | /* Fake up the old "payload" style, *and* the old unwrapped style */ |
| 2123 | if (notification_deprecated_out_ok(p->plugin, "notification", "payload", |
| 2124 | "v25.09", "v26.09")) { |
| 2125 | json_add_string(n, "origin", "pay"); |
| 2126 | json_object_start(n, "payload"); |
| 2127 | payment_failure_notify_core(p, n, error_message); |
| 2128 | json_object_end(n); |
| 2129 | } |
| 2130 | |
| 2131 | json_object_start(n, "pay_failure"); |
| 2132 | payment_failure_notify_core(p, n, error_message); |
| 2133 | json_object_end(n); |
| 2134 | plugin_notification_end_obs(p->plugin, n); |
| 2135 | } |
| 2136 | |
| 2137 | /* Code shared by selfpay fast-path: populate JSON output for successful |
| 2138 | * payment, and send pay_success notification. */ |
no test coverage detected