Add Paystack, Flutterwave, and Hubtel for encounter billing.
Deploy Ladill Care / deploy (push) Successful in 1m0s

Clinics on Pro/Enterprise can connect their own gateway in Integrations and collect card or MoMo on bills with 0% Ladill fee, while cash payments and balance totals stay correct for pending checkouts.
This commit is contained in:
isaacclad
2026-07-16 10:24:28 +00:00
parent 068c5aa63f
commit 7a0a7fcb88
19 changed files with 1283 additions and 31 deletions
@@ -0,0 +1,29 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('care_payment_gateway_settings', function (Blueprint $table) {
$table->id();
$table->string('owner_ref')->index();
$table->foreignId('organization_id')->unique()->constrained('care_organizations')->cascadeOnDelete();
$table->string('provider', 32); // paystack|flutterwave|hubtel
$table->text('public_key')->nullable();
$table->text('secret_key')->nullable();
$table->text('webhook_secret')->nullable();
$table->boolean('is_active')->default(true);
$table->json('metadata')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('care_payment_gateway_settings');
}
};
@@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('care_payments', function (Blueprint $table) {
$table->string('status', 20)->default('paid')->after('method'); // pending|paid|failed
$table->string('gateway_provider', 32)->nullable()->after('status');
$table->index(['reference']);
$table->index(['bill_id', 'status']);
});
}
public function down(): void
{
Schema::table('care_payments', function (Blueprint $table) {
$table->dropIndex(['care_payments_reference_index']);
$table->dropIndex(['care_payments_bill_id_status_index']);
$table->dropColumn(['status', 'gateway_provider']);
});
}
};