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

Corrige o fluxo em compras com suspeita de fraude #55

Merged
merged 3 commits into from
Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
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