没有任何广告账号则自动解绑授权 2
This commit is contained in:
parent
4dbc21ebfa
commit
9323e69abd
@ -107,13 +107,16 @@ class OAuthController
|
||||
//如果这个授权用户名下没有任何广告账号
|
||||
$option = [];
|
||||
$option['refresh_token'] = $tokens['refresh_token'];
|
||||
|
||||
$listAccessibleCustomers = $this->googleAdsAccountService->runListAccessibleCustomers($option);
|
||||
try {
|
||||
$listAccessibleCustomers = $this->googleAdsAccountService->runListAccessibleCustomers($option);
|
||||
}catch (\Exception $e) {
|
||||
return $this->errorResponse(300, 'The Google account (@gmail.com user) that generated the OAuth access tokens is not associated with any Ads accounts. Create a new account, or add the Google account to an existing Ads account.');
|
||||
}
|
||||
if (empty($listAccessibleCustomers)) {
|
||||
$googleOAuthService = new GoogleOAuthService();
|
||||
$googleOAuthService->revokeToken($tokens['refresh_token'], $merchantId);
|
||||
|
||||
return $this->errorResponse(300, 'has not any google ads account');
|
||||
return $this->errorResponse(300, 'The Google account (@gmail.com user) that generated the OAuth access tokens is not associated with any active Ads accounts. Create a active account and try again.');
|
||||
}
|
||||
|
||||
// $googleOAuthService->saveRefreshToken($tokens['refresh_token'], $state); //作废2025-2-13
|
||||
|
Loading…
Reference in New Issue
Block a user