d19a14a45e
- InitiatePaymentAction + POST /api/v1/payments/{booking}/initiate
- Generic KBZ webhook (POST /api/v1/webhooks/{method}/{encryptBookingId?}),
signature verification per KBZ's real callback spec, PaymentGatewayInterface::handleWebhook()
- ConfirmPaymentAction: idempotent confirmation, PaymentCompleted/PaymentFailed events,
MarkBookingPaid listener
- RefundBookingAction + POST /api/v1/bookings/{booking}/refund: partial refunds validated
against remaining balance, RefundProcessed event, MarkBookingRefunded listener
- CancelBookingAction now refunds confirmed bookings instead of rejecting; BookingPolicy::cancel
requires process_refunds for confirmed bookings
- PaymentPlugin + PaymentResource/RefundResource Filament admin UI (read-only payments,
refund list + Process action)
- Booking detail page now shows related payments
- Fix CACHE_STORE mismatch (database -> redis) so tagged route caching works
- CLAUDE.md: never run migrate:fresh/migrate:refresh/db:wipe on dev without being asked
19 lines
988 B
PHP
19 lines
988 B
PHP
<?php
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
use Modules\Payment\Http\Controllers\PaymentController;
|
|
use Modules\Payment\Http\Controllers\PaymentWebhookController;
|
|
use Modules\Payment\Http\Controllers\RefundController;
|
|
|
|
Route::prefix('api/v1')->middleware(['api', 'auth:sanctum', 'throttle:60,1'])->group(function () {
|
|
Route::post('/payments/{booking:booking_ref}/initiate', [PaymentController::class, 'initiate'])->name('payment.payments.initiate');
|
|
Route::post('/bookings/{booking:booking_ref}/refund', [RefundController::class, 'refund'])->name('payment.bookings.refund');
|
|
});
|
|
|
|
// No auth:sanctum — the gateway authenticates itself via its own signed
|
|
// payload (verified inside each gateway's handleWebhook()), not a bearer
|
|
// token (domain.md §6).
|
|
Route::prefix('api/v1')->middleware(['api', 'throttle:60,1'])->group(function () {
|
|
Route::post('/webhooks/{method}/{encryptBookingId?}', [PaymentWebhookController::class, 'handle'])->name('payment.webhooks.handle');
|
|
});
|