Skip to content

Commit 1eb4505

Browse files
authored
Merge pull request #3652 from bakaphp/hotfix-status-message
change to validStates
2 parents 7721dd7 + 2dd9671 commit 1eb4505

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/Console/Commands/Connectors/ESim/SyncEsimWithProviderCommand.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,12 @@ private function formatCmLinkResponse(Message $message, array $response, Custome
259259
$isValidState = in_array(strtolower($response['state']), $validStates);
260260
$remainingData = $totalBytesData;
261261

262-
if ($iccid && $isActive) {
262+
if ($iccid && $isValidState) {
263263
// Convert remainFlow to bytes - assuming it's in MB
264264
if (isset($activePlan['remainFlow'])) {
265265
$remainingData = (float)$activePlan['remainFlow'] * 1024 * 1024; // Convert MB to bytes
266266
}
267-
} elseif ($isActive == false && $remainingData <= 0) {
267+
} elseif ($isValidState == false && $remainingData <= 0) {
268268
$remainingData = $totalBytesData;
269269
}
270270

@@ -284,11 +284,11 @@ private function formatCmLinkResponse(Message $message, array $response, Custome
284284
}
285285
$today = Carbon::now()->setTimezone($estTimezone);
286286

287-
if ($remainingData <= 0 && $isActive == false) {
287+
if ($remainingData <= 0 && $isValidState == false) {
288288
$remainingData = $totalBytesData;
289289
} elseif ($remainingData > $totalBytesData) {
290290
$remainingData = $totalBytesData;
291-
} elseif ($remainingData == 0 && $isActive == true && $expirationDate != null) {
291+
} elseif ($remainingData == 0 && $isValidState == true && $expirationDate != null) {
292292
/**
293293
* @todo Move those spanish strings to app settings
294294
*/

0 commit comments

Comments
 (0)