Fix PayPal billing flow and mobile admin UX
This commit is contained in:
27
tests/Feature/Api/Tenant/BillingReceiptTest.php
Normal file
27
tests/Feature/Api/Tenant/BillingReceiptTest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Api\Tenant;
|
||||
|
||||
use App\Models\Package;
|
||||
use App\Models\PackagePurchase;
|
||||
use Tests\Feature\Tenant\TenantTestCase;
|
||||
|
||||
class BillingReceiptTest extends TenantTestCase
|
||||
{
|
||||
public function test_receipt_endpoint_returns_pdf(): void
|
||||
{
|
||||
$package = Package::factory()->create(['name' => 'Starter']);
|
||||
$purchase = PackagePurchase::factory()->create([
|
||||
'tenant_id' => $this->tenant->id,
|
||||
'package_id' => $package->id,
|
||||
'provider' => 'paypal',
|
||||
'provider_id' => 'ORDER-123',
|
||||
'price' => 49.0,
|
||||
]);
|
||||
|
||||
$response = $this->authenticatedRequest('GET', '/api/v1/tenant/billing/transactions/'.$purchase->id.'/receipt');
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertHeader('Content-Type', 'application/pdf');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user