Notifications: notification_preferences + Laravel notifications inbox.
SmsChannel adapter for our SmsService. RoutesByPreferences trait reads
per-user toggles. HouseholdApproved/Rejected, QrBalanceLow, and
CodesPurchased notifications wired in via auto-discovered listeners
or direct dispatch from controllers/StoreOperations.
Payments: payments table + PaymentDriver interface. ManualPaymentDriver
works out of the box; PayMongoDriver activates when
PAYMONGO_SECRET_KEY is set, falls back to manual otherwise. Resident
initiates code-purchase, admin can mark paid manually, webhook applies
real provider events. Fulfillment runs StoreOperations::sellToHousehold.
Live tracking (HTTP polling): truck_location_history (with SPATIAL
INDEX + 7-day retention plan). Driver POST /driver/trucks/{uuid}/location
writes history, updates trucks.last_known_coordinates, caches in Redis,
flags geofence-trigger when entering active trip dumpsite. Admin
GET /admin/live/trucks returns active truck positions. Reverb broadcast
deferred.
Flow corrections:
- QrAllocator now idempotent — re-approving a household no longer
re-dispenses free codes.
- arrive-dumpsite enforces dumpsite geofence via ST_Contains; can be
bypassed with override_geofence: true.
171 feature tests passing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
27 lines
689 B
PHP
27 lines
689 B
PHP
<?php
|
|
|
|
namespace App\Services\Payment;
|
|
|
|
use App\Models\Payment;
|
|
|
|
interface PaymentDriver
|
|
{
|
|
/**
|
|
* Initiate a payment with the provider. Returns a checkout URL or
|
|
* provider session id. Updates the payment row with provider_payment_id
|
|
* and provider_data.
|
|
*/
|
|
public function initiate(Payment $payment): InitiateResult;
|
|
|
|
/**
|
|
* Verify a webhook signature. Returns true if signature matches.
|
|
*/
|
|
public function verifyWebhook(string $rawBody, string $signature): bool;
|
|
|
|
/**
|
|
* Apply a webhook event to the corresponding payment row, returning
|
|
* the updated payment.
|
|
*/
|
|
public function applyWebhook(array $payload): ?Payment;
|
|
}
|