Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correção gerencianet para Efipay #2306

Closed
wants to merge 10 commits into from
Closed

Correção gerencianet para Efipay #2306

wants to merge 10 commits into from

Conversation

cabralwms
Copy link
Contributor

Fiz a correção do api do gerencianet para Efipay, atualizando o composer e arquivos necessários para o funcionamento, corrigindo bug de data ao criar boletos para datas futuras que estava dando erro.

image

@Fesantt
Copy link
Contributor

Fesantt commented Dec 26, 2023

precisa desse rolê todo n mano, só dei updade na biblioteca aqui no meu e ta funcionando de boa
image

@Pr3d4dor
Copy link
Collaborator

@cabralwms Favor atualizar a PR com a sugestão do @Fesantt, precisa apenas atualizar a biblioteca.

@cabralwms
Copy link
Contributor Author

cabralwms commented Jan 18, 2024

Fiz a remoção do Gerencianet pelo EFIPAY e assim testado funcionou corretamente. Pq o gerencianet está descontinuado.

image

Copy link
Collaborator

@willph willph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No geral é apenas renomear variáveis, textos e correção da dependência no arquivo composer.json/composer.lock

Pois agora se chama EfiPay o SDK da GerenciaNet.

Obrigado pela PR e fico no aguardo das alterações para aprovar a mesma.

Atenciosamente, Equipe MapOS

"codeigniter/framework": "^3.1",
"mpdf/mpdf": "^8.0.10",
"filp/whoops": "^2.7",
"mk-j/php_xlsxwriter": "^0.38.0",
"mpdf/qrcode": "^1.1",
"phpoffice/phpword": "^0.18.0",
"piggly/php-pix": "^2.0",
"codephix/asaas-sdk": "dev-master"
"codephix/asaas-sdk": "dev-master",
"efipay/sdk-php-apis-efi": "^1.7.1"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vai precisar remover "efipay/sdk-php-apis-efi": "^1.7.1" e depois rodar o comando composer require efipay/sdk-php-apis-efi:^1.7.1 --with-all-dependencies

Pois a maioria tem o SDK do Gerencianet instalado, com o comando ele removi e instala o Efipay.

Do jeito que esta aqui da erro ao rodar o comando composer install --no-dev, devido a dependência do Gerencianet ainda esta no composer.lock

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linha 6, 7, 8 precisara altera para o seguinte código

    `'EfiPaySdk' => [
    'name' => 'EfiPay by GerenciaNet',
    'library_name' => 'EfiPaySdk',`

Na linha 32 alterar o nome Gerencianet para EfiPay

'refunded' => 'Pagamento devolvido pelo lojista ou pelo intermediador EfiPay',

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nesse Arquivo precisara renomear o arquivo, para EfiPaySdk.php

Na linha 7 renomear a a class para EfiPaySdk

class EfiPaySdk extends BasePaymentGateway

Linhas 9, 10 e 12 alterar para

/** @var EfiPay $efiPayApi */
    private $efiPayApi;
    private $efiPayConfig;

Da linha 24 a 30 alterar

        $efiPayConfig = $this->ci->config->item('payment_gateways')['EfiPaySdk'];
        $this->efiPayConfig = $efiPayConfig;
        $this->efiPayApi = new EfiPay([
            'client_id' => $efiPayConfig['credentials']['client_id'],
            'client_secret' => $efiPayConfig['credentials']['client_secret'],
            'sandbox' => $efiPayConfig['production'] !== true,
            'timeout' => $efiPayConfig['timeout'],

linha 41 alterar para

$response = $this->efiPayApi->cancelCharge(['id' => $cobranca->charge_id], []);

linha 43 para

     `   throw new \Exception('Erro ao chamar EfiPay!');`

Linha 103 e 105 para

  $result = $this->efiPayApi->detailCharge(['id' => $cobranca->charge_id], []);
      
   throw new \Exception('Erro ao chamar EfiPay!');

Linha 138 e 140 para

           $response = $this->efiPayApi->settleCharge(['id' => $cobranca->charge_id], []);
            throw new \Exception('Erro ao chamar EfiPay!');

Linha 250 para

    `$expirationDate = (new DateTime())->add(new DateInterval($this->efiPayConfig['boleto_expiration']));`

Linha 272 e 274 para

        $result = $this->efiPayApi->createOneStepCharge([], $body);
            throw new \Exception('Erro ao chamar EfiPay!');

Linha 288 para

'payment_gateway' => 'EfiPaySdk',

Linha 368 para

$response = $this->efiPayApi->createCharge(

Linha 381 para

       ` throw new \Exception('Erro ao chamar EfiPay!');`

Linha 388 para

$result = $this->efiPayApi->linkCharge(

Linha 400 para

throw new \Exception('Erro ao chamar EfiPay!');

Linha 410 para

'payment_gateway' => 'EfiPaySdk',

@cabralwms cabralwms closed this Feb 14, 2024
@cabralwms cabralwms deleted the Correção-Gerencianet-para-Efipay branch March 27, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants