Add Business tier and Paystack prepaid billing for POS.
Deploy Ladill POS / deploy (push) Successful in 35s
Deploy Ladill POS / deploy (push) Successful in 35s
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -21,6 +21,8 @@ class PosProTest extends TestCase
|
||||
'billing.api_key' => 'pos-billing-key',
|
||||
'pos.pro.enabled' => true,
|
||||
'pos.pro.price_minor' => 7900,
|
||||
'pos.plans.pro.price_minor' => 7900,
|
||||
'pos.plans.enterprise.price_minor' => 24900,
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -47,6 +49,21 @@ class PosProTest extends TestCase
|
||||
$this->assertFalse(app(SubscriptionService::class)->canUseRestaurantMode($this->user()));
|
||||
}
|
||||
|
||||
public function test_subscribe_enterprise_charges_wallet_and_activates(): void
|
||||
{
|
||||
Http::fake(['*/debit' => Http::response(['id' => 1], 201)]);
|
||||
$user = $this->user();
|
||||
$svc = app(SubscriptionService::class);
|
||||
|
||||
[$ok] = $svc->subscribeEnterprise($user);
|
||||
|
||||
$this->assertTrue($ok);
|
||||
$this->assertTrue($svc->isEnterprise($user));
|
||||
$sub = ProSubscription::where('user_id', $user->id)->first();
|
||||
$this->assertSame('enterprise', $sub->plan);
|
||||
$this->assertSame(24900, $sub->price_minor);
|
||||
}
|
||||
|
||||
public function test_renew_suspends_after_grace_when_unpaid(): void
|
||||
{
|
||||
Http::fake(['*/debit' => Http::response(['balance_minor' => 0], 402)]);
|
||||
|
||||
Reference in New Issue
Block a user