This commit is contained in:
Hritikkk9
2024-07-16 12:17:23 +05:30
18 changed files with 1702 additions and 956 deletions

View File

@@ -187,4 +187,29 @@ class CustomerControllerApi extends Controller
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
}
}
/**
* Created By : sayli Raut
* Created at : 15 July 2024
* Use : To get user subscription status.
*/
public function CheckSubscription()
{
try {
$token = readHeaderToken();
if ($token) {
$customerIamId = $token['sub'];
$response = $this->CustomerApiServices->CheckSubscription($customerIamId);
return jsonResponseWithSuccessMessageApi(__('auth.data_fetched_successfully'), ['is_subscribed' => $response], 200);
} else {
return jsonResponseWithErrorMessageApi(__('auth.user_deleted'), 409);
}
} catch (Exception $e) {
Log::error("An error occurred in " . __METHOD__ . ": " . $e->getMessage(), ['exception' => $e]);
return jsonResponseWithErrorMessage(__('auth.something_went_wrong'), 500);
}
}
}