Fix bill payment forms to use major currency units.
Deploy Ladill Care / deploy (push) Successful in 56s
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:
@@ -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
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user