diff --git a/CHANGELOG.md b/CHANGELOG.md index 836541f2..c6230a6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Model/Payment/AbstractMethod.php b/Model/Payment/AbstractMethod.php index a1826f4e..951a6624 100644 --- a/Model/Payment/AbstractMethod.php +++ b/Model/Payment/AbstractMethod.php @@ -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']; diff --git a/Model/Payment/Bill.php b/Model/Payment/Bill.php index 8ec44eab..fabf2f54 100644 --- a/Model/Payment/Bill.php +++ b/Model/Payment/Bill.php @@ -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) { diff --git a/Plugin/SetOrderStatusOnPlace.php b/Plugin/SetOrderStatusOnPlace.php index e9a0c34b..18926d2c 100644 --- a/Plugin/SetOrderStatusOnPlace.php +++ b/Plugin/SetOrderStatusOnPlace.php @@ -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; } diff --git a/composer.json b/composer.json index 6a391f48..3726c9f3 100644 --- a/composer.json +++ b/composer.json @@ -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": [ { diff --git a/etc/config.xml b/etc/config.xml index d6ac7c0e..48efb7fe 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -8,7 +8,7 @@ 0 Vindi 0 - authorize_capture + authorize offline