.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user