Fix bill payment forms to use major currency units.
Deploy Ladill Care / deploy (push) Successful in 56s

Cashiers saw pesewa integers (e.g. 4000) while history showed GHS 40.00; accept and prefill major amounts and convert to minor on record/checkout.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 23:30:31 +00:00
co-authored by Cursor
parent a34d6579cd
commit e69c7da0d6
4 changed files with 38 additions and 16 deletions
+8 -3
View File
@@ -125,7 +125,7 @@ class CareBillTest extends TestCase
$this->actingAs($this->user)
->post(route('care.bills.payments.store', $bill), [
'amount_minor' => 3000,
'amount' => 30.00,
'method' => 'cash',
])
->assertRedirect();
@@ -136,7 +136,7 @@ class CareBillTest extends TestCase
$this->actingAs($this->user)
->post(route('care.bills.payments.store', $bill), [
'amount_minor' => $bill->balance_minor,
'amount' => $bill->balance_minor / 100,
'method' => 'momo',
'reference' => 'MOMO-123',
])
@@ -209,10 +209,15 @@ class CareBillTest extends TestCase
->assertSee('Pay')
->assertSee('Actions');
$balanceMajor = number_format($bill->balance_minor / 100, 2, '.', '');
$this->actingAs($this->user)
->get(route('care.bills.show', $bill))
->assertOk()
->assertSee('Record payment');
->assertSee('Record payment')
->assertSee('name="amount"', false)
->assertSee('value="'.$balanceMajor.'"', false)
->assertDontSee('value="'.$bill->balance_minor.'"', false);
}
public function test_call_next_empty_booth_explains_walk_up_invoices(): void
+3 -3
View File
@@ -175,7 +175,7 @@ class CarePaymentGatewayTest extends TestCase
$this->actingAs($this->user)
->post(route('care.bills.payments.gateway', $this->bill), [
'amount_minor' => $balance,
'amount' => $balance / 100,
])
->assertRedirect('https://checkout.paystack.com/care-test');
@@ -224,7 +224,7 @@ class CarePaymentGatewayTest extends TestCase
$this->actingAs($this->user)
->post(route('care.bills.payments.gateway', $this->bill), [
'amount_minor' => 5000,
'amount' => 50.00,
])
->assertRedirect('https://checkout.flutterwave.com/v3/hosted/pay/test');
@@ -258,7 +258,7 @@ class CarePaymentGatewayTest extends TestCase
$this->actingAs($this->user)
->post(route('care.bills.payments.gateway', $this->bill), [
'amount_minor' => 2500,
'amount' => 25.00,
])
->assertRedirect('https://pay.hubtel.com/checkout/test');