<commit_before><?php

namespace SubscribePro\Service\OauthToken;

use SubscribePro\Service\AbstractService;

class OauthTokenService extends AbstractService
{
    /**
     * Service name
     */
    const NAME = 'oauth_token';

    const OAUTH_TOKEN = 'access_token';

    /**
     * @param string $customerId
     * @return string
     */
    public function retrieveToken($customerEmail)
    {
        try {
            $response = $this->httpClient->get("/oauth/v2/token?grant_type=client_credentials&scope=widget&customer_id=$customerEmail");
        } catch (SubscribePro\Exception\HttpException $e) {
            echo $e->getResponse();
        }

        var_dump($response);die();
        return $this->retrieveItem($response, self::OAUTH_TOKEN);
    }
}<commit_msg>Fixed the oauthTokenService<commit_after><?php

namespace SubscribePro\Service\OauthToken;

use SubscribePro\Service\AbstractService;

class OauthTokenService extends AbstractService
{
    /**
     * Service name
     */
    const NAME = 'oauth_token';

    const OAUTH_TOKEN = 'access_token';

    /**
     * @param string $customerId
     * @return string
     */
    public function retrieveToken($customerEmail)
    {
        $email = urlencode($customerEmail);
        try {
            $response = $this->httpClient->get("/oauth/v2/token?grant_type=client_credentials&scope=widget&customer_email=$email");
        } catch (\SubscribePro\Exception\HttpException $e) {
            return false;
        }

        return (isset($response[self::OAUTH_TOKEN])) ? $response[self::OAUTH_TOKEN] : false;
    }
}
{'fraction_non_alphanumeric': 0.12247474747474747, 'fraction_numerical': 0.0012626262626262627, 'mean_word_length': 3.0126582278481013, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2400822', 'n_tokens_mistral': 468, 'n_tokens_neox': 461, 'n_words': 78}