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

Atualização do gerencianet para Efipay #2363

Merged
merged 4 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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',
'idenfied' => 'Pagamento identificado',
'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
13 changes: 6 additions & 7 deletions application/libraries/Gateways/GerencianetSdk.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

use Gerencianet\Gerencianet;
use Efi\EfiPay;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Colocar linha em branco após abrir a tag PHP.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adicionada a linha em branco como solicitado.

use Libraries\Gateways\BasePaymentGateway;
use Libraries\Gateways\Contracts\PaymentGateway;

Expand All @@ -23,7 +22,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 @@ -62,13 +61,13 @@ public function enviarPorEmail($id)
'cobrancas/emails/cobranca',
[
'cobranca' => $cobranca,
'emitente' => $emitente[0],
'emitente' => $emitente,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Está correto isso? Mudou aqui mas não mudou a forma de buscar o emitente.

Copy link
Contributor

Choose a reason for hiding this comment

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

Testei com ele e funcionou, com o array não estava funcionando.
Vou dar uma olhada melhor pra ter certeza que está tudo certo.

Copy link
Contributor Author

@cabralwms cabralwms Mar 29, 2024

Choose a reason for hiding this comment

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

Sim Predador está correto após essas alterações os emails entram na fila de envio pelo sistema e acabo de confirmar o recebimento.

Envio Vendas 88

image

recebido no outlook

image

'paymentGatewaysConfig' => $this->ci->config->item('payment_gateways'),
],
true
);

$assunto = "Cobrança - " . $emitente[0]->nome;
$assunto = "Cobrança - " . $emitente->nome;
if ($cobranca->os_id) {
$assunto .= ' - OS #' . $cobranca->os_id;
} else {
Expand All @@ -78,7 +77,7 @@ public function enviarPorEmail($id)
$remetentes = [$cobranca->email];
foreach ($remetentes as $remetente) {
$headers = [
'From' => $emitente[0]->email,
'From' => $emitente->email,
'Subject' => $assunto,
'Return-Path' => ''
];
Expand Down Expand Up @@ -269,7 +268,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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"ext-curl": "*",
"ext-gd": "*",
"mercadopago/dx-php": "^2.2.1",
"gerencianet/gerencianet-sdk-php": "^2.4.1",
"efipay/sdk-php-apis-efi": "^1.8",
"codeigniter/framework": "^3.1",
"mpdf/mpdf": "^8.0.10",
"filp/whoops": "^2.7",
Expand Down
Loading
Loading