You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+65Lines changed: 65 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -276,6 +276,71 @@ The Terminal class throws `\Exception` on failures. Common scenarios include:
276
276
277
277
Always wrap Terminal method calls in try-catch blocks for proper error handling.
278
278
279
+
## Webhook Push Notifications
280
+
281
+
When a payment succeeds, this package can automatically send a webhook to an external system (e.g. a financial tracking service). This uses [spatie/laravel-webhook-server](https://github.com/spatie/laravel-webhook-server) under the hood.
282
+
283
+
### Setup
284
+
285
+
1. Install the webhook server package:
286
+
287
+
```bash
288
+
composer require spatie/laravel-webhook-server
289
+
```
290
+
291
+
2. Set the webhook URL and signing secret in your `.env`:
Once configured, every `SuccessfulLaravelMultipayPaymentEvent` will trigger a signed webhook POST to the configured URL with the payload returned by your packager.
328
+
329
+
### Backfilling Existing Payments
330
+
331
+
To send existing successful payments to the webhook endpoint:
332
+
333
+
```bash
334
+
php artisan multipay:send-payments-webhook
335
+
```
336
+
337
+
Options:
338
+
-`--from=YYYY-MM-DD` — only payments created on or after this date
339
+
-`--to=YYYY-MM-DD` — only payments created on or before this date
340
+
-`--chunk=100` — number of payments per batch (default: 100)
341
+
342
+
The command fail-fast aborts after 3 consecutive batch failures.
0 commit comments