This commit is contained in:
2026-11-02 11:21:36 +03:30
parent 1cd6c61e0f
commit 8ccdea99c8
4 changed files with 78 additions and 23 deletions
+9 -5
View File
@@ -138,16 +138,20 @@ class ShayeganSyncService
$result = $this->client->put('Account/Put', $put);
$accountNumber = trim((string) ($result['number'] ?? ''));
$exchange = $this->client->debugExchange($result);
if (! empty($result['timeout'])) {
return ['ok' => false, 'message' => (string) ($result['message'] ?? 'timeout')];
return array_merge([
'ok' => false,
'message' => (string) ($result['message'] ?? 'timeout'),
], $exchange);
}
if (empty($result['ok']) || $accountNumber === '') {
return [
return array_merge([
'ok' => false,
'message' => (string) ($result['message'] ?? 'ثبت حساب مشتری در شایگان ناموفق بود'),
];
], $exchange);
}
$customer->moshtari_code = $accountNumber;
@@ -174,11 +178,11 @@ class ShayeganSyncService
$row->res = json_encode($result['body'] ?? [], JSON_UNESCAPED_UNICODE);
$row->save();
return [
return array_merge([
'ok' => true,
'message' => 'حساب تفصیلی مشتری در شایگان ایجاد شد',
'moshtari_code' => $accountNumber,
];
], $exchange);
}
/**