feat: add total field to purchases and update related logic for payment processing
This commit is contained in:
@@ -29,6 +29,10 @@ class CheckoutService
|
||||
]);
|
||||
}
|
||||
|
||||
$cartItems->load('variant.product');
|
||||
$cart->setRelation('items', $cartItems);
|
||||
$totalAmount = $cart->getTotalAmount();
|
||||
|
||||
/** @var Purchase $purchase */
|
||||
$purchase = Purchase::query()->updateOrCreate(
|
||||
[
|
||||
@@ -41,6 +45,7 @@ class CheckoutService
|
||||
...$purchaseData,
|
||||
'payment_status' => 'pending',
|
||||
'payment_method' => null,
|
||||
'total' => $totalAmount,
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user