Fix payment QR edits and mobile payment sheet keyboard gap.
Deploy Ladill Mini / deploy (push) Successful in 40s

Persist payment QR business fields on update, handle is_active correctly, and keep the amount bottom sheet flush to the screen while moving with the keyboard on iOS.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-06-07 23:16:55 +00:00
co-authored by Cursor
parent 2b81462e39
commit 99dae20743
6 changed files with 219 additions and 57 deletions
@@ -0,0 +1,57 @@
<?php
namespace Tests\Unit\Services\Qr;
use App\Models\QrCode;
use App\Models\User;
use App\Services\Qr\QrCodeManagerService;
use App\Services\Qr\QrImageGeneratorService;
use App\Services\Qr\QrPayloadValidator;
use App\Services\Qr\QrWalletBillingService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Str;
use Tests\TestCase;
class PaymentQrUpdateTest extends TestCase
{
use RefreshDatabase;
public function test_payment_qr_update_persists_business_fields(): void
{
$user = User::create([
'public_id' => (string) Str::uuid(),
'name' => 'Trader',
'email' => 'trader@example.com',
]);
$qrCode = QrCode::create([
'user_id' => $user->id,
'short_code' => 'paytest01',
'type' => QrCode::TYPE_PAYMENT,
'label' => 'Till 1',
'payload' => [
'content' => [
'business_name' => 'Old Shop',
'branch_label' => 'Main',
'currency' => 'GHS',
],
'style' => [],
],
'is_active' => true,
]);
$manager = new QrCodeManagerService(
$this->createMock(QrWalletBillingService::class),
$this->createMock(QrImageGeneratorService::class),
new QrPayloadValidator(),
);
$updated = $manager->update($qrCode, [
'business_name' => 'New Shop',
'branch_label' => 'Accra Mall',
]);
$this->assertSame('New Shop', $updated->content()['business_name']);
$this->assertSame('Accra Mall', $updated->content()['branch_label']);
}
}