-
-
Notifications
You must be signed in to change notification settings - Fork 624
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
<?php | ||
|
||
use Gerencianet\Gerencianet; | ||
use Efi\EfiPay; | ||
use Libraries\Gateways\BasePaymentGateway; | ||
use Libraries\Gateways\Contracts\PaymentGateway; | ||
|
||
|
@@ -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, | ||
|
@@ -62,13 +61,13 @@ public function enviarPorEmail($id) | |
'cobrancas/emails/cobranca', | ||
[ | ||
'cobranca' => $cobranca, | ||
'emitente' => $emitente[0], | ||
'emitente' => $emitente, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Testei com ele e funcionou, com o array não estava funcionando. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
'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 { | ||
|
@@ -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' => '' | ||
]; | ||
|
@@ -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!'); | ||
} | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.