feat: refactor purchase status handling and add finalize endpoint for purchases
This commit is contained in:
@@ -83,16 +83,14 @@ class TelepagosWebhookTest extends TestCase
|
||||
|
||||
$this->assertDatabaseHas('compras', [
|
||||
'id' => $matchingPurchase->id,
|
||||
'status' => 'paid',
|
||||
'payment_status' => 'approved',
|
||||
'status' => Purchase::STATUS_PAID,
|
||||
'payment_method' => 'transfer',
|
||||
'total' => 50,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('compras', [
|
||||
'id' => $newerPurchase->id,
|
||||
'status' => 'pending',
|
||||
'payment_status' => 'pending',
|
||||
'status' => Purchase::STATUS_PENDING_PAYMENT,
|
||||
'payment_method' => 'transfer',
|
||||
'total' => 100,
|
||||
]);
|
||||
@@ -154,6 +152,8 @@ class TelepagosWebhookTest extends TestCase
|
||||
'payment_method' => 'transfer',
|
||||
]);
|
||||
|
||||
$checkoutService->finalizePurchase($purchase);
|
||||
|
||||
return $purchase->fresh();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user