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
1 change: 1 addition & 0 deletions application/config/payment_gateways.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'new' => 'Cobrança / Assinatura gerada',
'waiting' => 'Aguardando a confirmação do pagamento',
'paid' => 'Pagamento confirmado',
'identified' => 'Pagamento confirmado',
'unpaid' => 'Não foi possível confirmar o pagamento da cobrança',
'refunded' => 'Pagamento devolvido pelo lojista ou pelo intermediador Gerencianet',
'contested' => 'Pagamento em processo de contestação',
Expand Down
6 changes: 3 additions & 3 deletions application/libraries/Gateways/GerencianetSdk.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

use Gerencianet\Gerencianet;
use Efi\EfiPay;
use Libraries\Gateways\BasePaymentGateway;
use Libraries\Gateways\Contracts\PaymentGateway;

Expand All @@ -23,7 +23,7 @@ public function __construct()

$gerenciaNetConfig = $this->ci->config->item('payment_gateways')['GerencianetSdk'];
$this->gerenciaNetConfig = $gerenciaNetConfig;
$this->gerenciaNetApi = new Gerencianet([
$this->gerenciaNetApi = new EfiPay([
'client_id' => $gerenciaNetConfig['credentials']['client_id'],
'client_secret' => $gerenciaNetConfig['credentials']['client_secret'],
'sandbox' => $gerenciaNetConfig['production'] !== true,
Expand Down Expand Up @@ -269,7 +269,7 @@ function ($total, $item) {
]
];

$result = $this->gerenciaNetApi->oneStep([], $body);
$result = $this->gerenciaNetApi->createOneStepCharge([], $body);
if (intval($result['code']) !== 200) {
throw new \Exception('Erro ao chamar GerenciaNet!');
}
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
"ext-curl": "*",
"ext-gd": "*",
"mercadopago/dx-php": "^2.2.1",
"gerencianet/gerencianet-sdk-php": "^2.4.1",
"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

},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.0",
Expand Down
Loading