Skip to content

Commit

Permalink
Corrige o fluxo em compras com suspeita de fraude (#55)
Browse files Browse the repository at this point in the history
* Corrige o fluxo em compras com suspeita de fraude

* Versão 1.2.0
  • Loading branch information
laerte-guimaraes committed Aug 19, 2019
1 parent 2beef3b commit cc6fb99
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 13 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Notas das versões
## [1.2.0 - 19/08/2019](https://github.com/vindi/vindi-magento2/releases/tag/1.2.0)
- Corrige falha ao salvar as configurações de métodos de pagamento sem informar a chave API
- Adiciona atribuicão de status padrao após confirmação de pagamento dos pedidos
- Ajusta envio de descontos, fretes e taxas para a plataforma Vindi
- Ajusta fluxo de compra em transações com suspeita de fraude

## [1.1.0 - 15/05/2019](https://github.com/vindi/vindi-magento2/releases/tag/1.1.0)
- Insere método de pagamento Boleto Bancário

Expand Down
2 changes: 1 addition & 1 deletion Model/Payment/AbstractMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ protected function processPayment(\Magento\Payment\Model\InfoInterface $payment,
|| $body['payment_method_code'] === PaymentMethod::DEBIT_CARD
|| $bill['status'] === Bill::PAID_STATUS
|| $bill['status'] === Bill::REVIEW_STATUS
|| $bill['charges'][0]['status'] === Bill::FRAUD_REVIEW_STATUS
|| reset($bill['charges'])['status'] === Bill::FRAUD_REVIEW_STATUS
) {
$order->setVindiBillId($bill['id']);
return $bill['id'];
Expand Down
2 changes: 1 addition & 1 deletion Model/Payment/Bill.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Bill
private $api;
const PAID_STATUS = 'paid';
const REVIEW_STATUS = 'review';
const FRAUD_REVIEW_STATUS = 'review';
const FRAUD_REVIEW_STATUS = 'fraud_review';

public function __construct(Api $api)
{
Expand Down
18 changes: 9 additions & 9 deletions Plugin/SetOrderStatusOnPlace.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ public function __construct(
$this->helperData = $helperData;
}

/**
* Faz com que os status de pagamento dos pedidos
* sejam atualizados exclusivamente via webhooks da Vindi
*
* @param Payment $subject, mixed $result
*
* @return mixed
*/
public function afterPlace(Payment $subject, $result)
{
switch ($subject->getMethod()) {
case BankSlip::CODE:
$this->pendingStatus($subject);
break;
case Vindi::CODE:
$this->completeStatus($subject);
break;
}

$this->pendingStatus($subject);
return $result;
}

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vindi/vindi-magento2",
"description": "Módulo de cobrança Vindi para o Magento 2",
"type": "magento2-module",
"version": "1.1.0",
"version": "1.2.0",
"license": "GPL-3.0",
"authors": [
{
Expand Down
2 changes: 1 addition & 1 deletion etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<allow_installments>0</allow_installments>
<title>Vindi</title>
<allowspecific>0</allowspecific>
<payment_action>authorize_capture</payment_action>
<payment_action>authorize</payment_action>
<group>offline</group>
</vindi>
<vindi_bankslip>
Expand Down

0 comments on commit cc6fb99

Please sign in to comment.