diff --git a/Helper/Data.php b/Helper/Data.php index 2222076..0dfb905 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -611,7 +611,13 @@ public function getBuyer($order, $quote = null) $buyerFirstname = $billingAddress->getFirstname(); $buyerLastname = $billingAddress->getLastname(); - $buyerDocument = $this->_formatTaxVat($taxvat); + $buyerDocument = !empty($taxvat) ? $this->_formatTaxVat($taxvat) : false; + if(!$buyerDocument) + { + throw new \Magento\Framework\Exception\LocalizedException( + __('It is necessary to put CPF/VAT Number in your registration to finalize the purchase.') + ); + } $buyerEmail = $billingAddress->getEmail(); $buyerPhone = $this->_extractPhone($billingAddress->getTelephone());