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, [
|
||||
|
||||
@@ -411,6 +411,19 @@ class WalletController extends Controller
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
if (app(ConfigService::class)->isZarinAccounting()) {
|
||||
try {
|
||||
app(\App\Http\Controllers\Admin\ZarinController::class)->wallet([
|
||||
"customer_id" => auth('customer')->id(),
|
||||
"value" => $data['value'],
|
||||
"direction" => 1,
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
report($e);
|
||||
}
|
||||
}
|
||||
|
||||
$companyName = $this->Config('name_fa'); // Company name from configuration
|
||||
$message = "کاربر $userName با شماره موبایل $userMobile درخواست برداشت مبلغ " . number_format($withdrawAmount) . " ریال را دارد. با تشکر، $companyName";
|
||||
if (isset($request->otp)) {
|
||||
|
||||
Reference in New Issue
Block a user