Add integrations health monitoring
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\CheckoutSession;
|
||||
use App\Models\IntegrationWebhookEvent;
|
||||
use App\Models\Package;
|
||||
use App\Models\PackagePurchase;
|
||||
use App\Models\Tenant;
|
||||
@@ -25,6 +26,7 @@ class PaddleWebhookControllerTest extends TestCase
|
||||
[$tenant, $package, $session] = $this->prepareSession();
|
||||
|
||||
$payload = [
|
||||
'event_id' => 'evt_123',
|
||||
'event_type' => 'transaction.completed',
|
||||
'data' => [
|
||||
'id' => 'txn_123',
|
||||
@@ -56,6 +58,13 @@ class PaddleWebhookControllerTest extends TestCase
|
||||
|
||||
$response->assertOk()->assertJson(['status' => 'processed']);
|
||||
|
||||
$this->assertDatabaseHas('integration_webhook_events', [
|
||||
'provider' => 'paddle',
|
||||
'event_id' => 'evt_123',
|
||||
'event_type' => 'transaction.completed',
|
||||
'status' => IntegrationWebhookEvent::STATUS_PROCESSED,
|
||||
]);
|
||||
|
||||
$session->refresh();
|
||||
|
||||
$this->assertEquals(CheckoutSession::STATUS_COMPLETED, $session->status);
|
||||
|
||||
Reference in New Issue
Block a user