added zarin
This commit is contained in:
@@ -384,6 +384,26 @@ class CartController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
if ($config->isZarinAccounting()) {
|
||||
try {
|
||||
app(\App\Http\Controllers\Admin\ZarinController::class)->storeTrade([
|
||||
'customer_id' => $order->customer_id,
|
||||
'amount' => $order->amount,
|
||||
'direction' => (int) ($order->direction ?? 1),
|
||||
'price' => $order->price,
|
||||
'total_price' => $order->total_price,
|
||||
'pay_at' => $order->pay_at ?? $order->created_at,
|
||||
'product' => [
|
||||
'metal_id' => $metalId,
|
||||
'id' => $primaryProduct?->id,
|
||||
],
|
||||
'order' => ['id' => $order->id],
|
||||
]);
|
||||
} catch (\Throwable $e) {
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
if ($config->isPargarAccounting()) {
|
||||
try {
|
||||
app(PargarSyncService::class)->recordTrade($order, true, [
|
||||
|
||||
Reference in New Issue
Block a user