From 74cb6554a62933a03e6b12c9f978c90dcb3e9f5e Mon Sep 17 00:00:00 2001 From: "k.verschoor@pay.nl" Date: Mon, 1 Mar 2021 09:07:25 +0100 Subject: [PATCH 01/10] Option for no invoices for B2B with billink --- Controller/Checkout/Exchange.php | 13 +++++++++++++ Model/Config.php | 6 ++++++ etc/adminhtml/paymentmethods/billink.xml | 8 ++++++++ etc/config.xml | 1 + 4 files changed, 28 insertions(+) diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php index f9b213df..4b1e00a9 100644 --- a/Controller/Checkout/Exchange.php +++ b/Controller/Checkout/Exchange.php @@ -297,6 +297,19 @@ private function processPaidOrder(Transaction $transaction, Order $order) ); } + //Skip creation of invoice for B2B + $skipB2BInvoice = $this->config->ignoreB2BInvoice($order->getPayment()->getMethod()); + $orderCompany = $order->getBillingAddress()->getCompany(); + if($skipB2BInvoice == 1 && strlen($orderCompany) > 0){ + $this->orderSender->send($order); + $order->addStatusHistoryComment( + __('Order paid, but transaction is B2B so invoice has not been created.') + )->setIsCustomerNotified( + true + )->save(); + return $this->result->setContents("TRUE| B2B - No invoice created"); + } + // Force order state/status to processing $order->setState(Order::STATE_PROCESSING); diff --git a/Model/Config.php b/Model/Config.php index 2416262c..3b65d212 100644 --- a/Model/Config.php +++ b/Model/Config.php @@ -125,6 +125,12 @@ public function getPaidStatus($methodCode){ return $this->store->getConfig('payment/' . $methodCode . '/order_status_processing'); } + public function ignoreB2BInvoice($methodCode) + { + return $this->store->getConfig('payment/' . $methodCode . '/turn_off_invoices_b2b'); + } + + /** * @param $methodCode string * @return string diff --git a/etc/adminhtml/paymentmethods/billink.xml b/etc/adminhtml/paymentmethods/billink.xml index f33e70d4..651a81f4 100644 --- a/etc/adminhtml/paymentmethods/billink.xml +++ b/etc/adminhtml/paymentmethods/billink.xml @@ -144,6 +144,14 @@ payment/paynl_payment_billink/showforcompany + + + Magento\Config\Model\Config\Source\Yesno + + 1 + + payment/paynl_payment_billink/turn_off_invoices_b2b + Paynl\Payment\Model\Paymentmethod\Billink paynl_payment after_payment + No 0 From 7c6f925bcb8534892505e39d9036d59bba9823b8 Mon Sep 17 00:00:00 2001 From: "k.verschoor@pay.nl" Date: Mon, 1 Mar 2021 09:57:02 +0100 Subject: [PATCH 02/10] Fix --- Controller/Checkout/Exchange.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php index 4b1e00a9..4348fba7 100644 --- a/Controller/Checkout/Exchange.php +++ b/Controller/Checkout/Exchange.php @@ -300,7 +300,7 @@ private function processPaidOrder(Transaction $transaction, Order $order) //Skip creation of invoice for B2B $skipB2BInvoice = $this->config->ignoreB2BInvoice($order->getPayment()->getMethod()); $orderCompany = $order->getBillingAddress()->getCompany(); - if($skipB2BInvoice == 1 && strlen($orderCompany) > 0){ + if($skipB2BInvoice == 1 && !empty($orderCompany)){ $this->orderSender->send($order); $order->addStatusHistoryComment( __('Order paid, but transaction is B2B so invoice has not been created.') From 9fcb52fb4fbc1dd1935e81cd6701c77cfaa7adc5 Mon Sep 17 00:00:00 2001 From: "k.verschoor@pay.nl" Date: Mon, 1 Mar 2021 13:22:21 +0100 Subject: [PATCH 03/10] fix 2 --- Controller/Checkout/Exchange.php | 46 +++++++++++++++----------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php index 4348fba7..b6ffa1bc 100644 --- a/Controller/Checkout/Exchange.php +++ b/Controller/Checkout/Exchange.php @@ -288,30 +288,37 @@ private function processPaidOrder(Transaction $transaction, Order $order) } } - if ($transaction->isAuthorized()) { - $paidAmount = $transaction->getCurrencyAmount(); - $payment->registerAuthorizationNotification($paidAmount); - } else { - $payment->registerCaptureNotification( - $paidAmount, $this->config->isSkipFraudDetection() - ); + // Force order state/status to processing + $order->setState(Order::STATE_PROCESSING)->setStatus(Order::STATE_PROCESSING)->save(); + + // notify customer + if ($order && !$order->getEmailSent()) { + $this->orderSender->send($order); + $order->addStatusHistoryComment( + __('New order email sent') + )->setIsCustomerNotified( + true + )->save(); } //Skip creation of invoice for B2B $skipB2BInvoice = $this->config->ignoreB2BInvoice($order->getPayment()->getMethod()); - $orderCompany = $order->getBillingAddress()->getCompany(); - if($skipB2BInvoice == 1 && !empty($orderCompany)){ - $this->orderSender->send($order); + $orderCompany = $order->getBillingAddress()->getCompany(); + if ($skipB2BInvoice == 1 && !empty($orderCompany)) { $order->addStatusHistoryComment( __('Order paid, but transaction is B2B so invoice has not been created.') - )->setIsCustomerNotified( - true )->save(); return $this->result->setContents("TRUE| B2B - No invoice created"); } - // Force order state/status to processing - $order->setState(Order::STATE_PROCESSING); + if ($transaction->isAuthorized()) { + $paidAmount = $transaction->getCurrencyAmount(); + $payment->registerAuthorizationNotification($paidAmount); + } else { + $payment->registerCaptureNotification( + $paidAmount, $this->config->isSkipFraudDetection() + ); + } $statusPaid = $this->config->getPaidStatus($order->getPayment()->getMethod()); $statusAuthorized= $this->config->getAuthorizedStatus($order->getPayment()->getMethod()); @@ -323,19 +330,8 @@ private function processPaidOrder(Transaction $transaction, Order $order) } else { $order->setStatus($statusPaid); } - $this->orderRepository->save($order); - // notify customer - if ($order && !$order->getEmailSent()) { - $this->orderSender->send($order); - $order->addStatusHistoryComment( - __('New order email sent') - )->setIsCustomerNotified( - true - )->save(); - } - $invoice = $payment->getCreatedInvoice(); if ($invoice && !$invoice->getEmailSent()) { $this->invoiceSender->send($invoice); From 5b08086f119f42ac760065a6abc47419e1009345 Mon Sep 17 00:00:00 2001 From: "k.verschoor@pay.nl" Date: Tue, 9 Mar 2021 10:45:51 +0100 Subject: [PATCH 04/10] Fixed status not being read from config --- Controller/Checkout/Exchange.php | 33 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php index b6ffa1bc..cc568e48 100644 --- a/Controller/Checkout/Exchange.php +++ b/Controller/Checkout/Exchange.php @@ -287,9 +287,21 @@ private function processPaidOrder(Transaction $transaction, Order $order) $paidAmount = $order->getBaseGrandTotal(); } } - + // Force order state/status to processing - $order->setState(Order::STATE_PROCESSING)->setStatus(Order::STATE_PROCESSING)->save(); + $order->setState(Order::STATE_PROCESSING)->save(); + + $statusPaid = $this->config->getPaidStatus($order->getPayment()->getMethod()); + $statusAuthorized= $this->config->getAuthorizedStatus($order->getPayment()->getMethod()); + $statusPaid = !empty($statusPaid) ? $statusPaid : Order::STATE_PROCESSING; + $statusAuthorized = !empty($statusAuthorized) ? $statusAuthorized : Order::STATE_PROCESSING; + + if($transaction->isAuthorized()){ + $order->setStatus($statusAuthorized); + } else { + $order->setStatus($statusPaid); + } + $this->orderRepository->save($order); // notify customer if ($order && !$order->getEmailSent()) { @@ -311,6 +323,7 @@ private function processPaidOrder(Transaction $transaction, Order $order) return $this->result->setContents("TRUE| B2B - No invoice created"); } + //Make the invoice and send it to the customer if ($transaction->isAuthorized()) { $paidAmount = $transaction->getCurrencyAmount(); $payment->registerAuthorizationNotification($paidAmount); @@ -318,20 +331,8 @@ private function processPaidOrder(Transaction $transaction, Order $order) $payment->registerCaptureNotification( $paidAmount, $this->config->isSkipFraudDetection() ); - } - - $statusPaid = $this->config->getPaidStatus($order->getPayment()->getMethod()); - $statusAuthorized= $this->config->getAuthorizedStatus($order->getPayment()->getMethod()); - $statusPaid = !empty($statusPaid) ? $statusPaid : Order::STATE_PROCESSING; - $statusAuthorized = !empty($statusAuthorized) ? $statusAuthorized : Order::STATE_PROCESSING; - - if($transaction->isAuthorized()){ - $order->setStatus($statusAuthorized); - } else { - $order->setStatus($statusPaid); - } - $this->orderRepository->save($order); - + } + $invoice = $payment->getCreatedInvoice(); if ($invoice && !$invoice->getEmailSent()) { $this->invoiceSender->send($invoice); From eab2e571f47804c115d8d69a9ea768954a3f3690 Mon Sep 17 00:00:00 2001 From: woutse Date: Wed, 10 Mar 2021 12:34:45 +0100 Subject: [PATCH 05/10] Updated texts, composer and performed auto-format --- Controller/Checkout/Exchange.php | 56 +++++++++--------------- composer.json | 2 +- etc/adminhtml/paymentmethods/billink.xml | 6 +-- 3 files changed, 24 insertions(+), 40 deletions(-) diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php index cc568e48..7f2e8c5f 100644 --- a/Controller/Checkout/Exchange.php +++ b/Controller/Checkout/Exchange.php @@ -275,55 +275,44 @@ private function processPaidOrder(Transaction $transaction, Order $order) ); $payment->setPreparedMessage('PAY. - '); - $payment->setIsTransactionClosed( - 0 - ); + $payment->setIsTransactionClosed(0); $paidAmount = $transaction->getPaidCurrencyAmount(); if (!$this->paynlConfig->isAlwaysBaseCurrency()) { if ($order->getBaseCurrencyCode() != $order->getOrderCurrencyCode()) { - // we can only register the payment in the base currency + # We can only register the payment in the base currency $paidAmount = $order->getBaseGrandTotal(); } } - - // Force order state/status to processing - $order->setState(Order::STATE_PROCESSING)->save(); - $statusPaid = $this->config->getPaidStatus($order->getPayment()->getMethod()); - $statusAuthorized= $this->config->getAuthorizedStatus($order->getPayment()->getMethod()); - $statusPaid = !empty($statusPaid) ? $statusPaid : Order::STATE_PROCESSING; - $statusAuthorized = !empty($statusAuthorized) ? $statusAuthorized : Order::STATE_PROCESSING; + # Force order state to processing + $order->setState(Order::STATE_PROCESSING); - if($transaction->isAuthorized()){ - $order->setStatus($statusAuthorized); + if ($transaction->isAuthorized()) { + $statusAuthorized = $this->config->getAuthorizedStatus($order->getPayment()->getMethod()); + $order->setStatus(!empty($statusAuthorized) ? $statusAuthorized : Order::STATE_PROCESSING); } else { - $order->setStatus($statusPaid); + $statusPaid = $this->config->getPaidStatus($order->getPayment()->getMethod()); + $order->setStatus(!empty($statusPaid) ? $statusPaid : Order::STATE_PROCESSING); } $this->orderRepository->save($order); - // notify customer + # Notify customer if ($order && !$order->getEmailSent()) { $this->orderSender->send($order); - $order->addStatusHistoryComment( - __('New order email sent') - )->setIsCustomerNotified( - true - )->save(); + $order->addStatusHistoryComment(__('New order email sent'))->setIsCustomerNotified(true)->save(); } - //Skip creation of invoice for B2B + # Skip creation of invoice for B2B $skipB2BInvoice = $this->config->ignoreB2BInvoice($order->getPayment()->getMethod()); $orderCompany = $order->getBillingAddress()->getCompany(); if ($skipB2BInvoice == 1 && !empty($orderCompany)) { - $order->addStatusHistoryComment( - __('Order paid, but transaction is B2B so invoice has not been created.') - )->save(); - return $this->result->setContents("TRUE| B2B - No invoice created"); + $order->addStatusHistoryComment(__('B2B Setting: Skipped creating invoice'))->save(); + return $this->result->setContents("TRUE| " . $message . " (B2B: No invoice created)"); } - //Make the invoice and send it to the customer + # Make the invoice and send it to the customer if ($transaction->isAuthorized()) { $paidAmount = $transaction->getCurrencyAmount(); $payment->registerAuthorizationNotification($paidAmount); @@ -331,19 +320,14 @@ private function processPaidOrder(Transaction $transaction, Order $order) $payment->registerCaptureNotification( $paidAmount, $this->config->isSkipFraudDetection() ); - } - + } + $invoice = $payment->getCreatedInvoice(); if ($invoice && !$invoice->getEmailSent()) { $this->invoiceSender->send($invoice); - - $order->addStatusHistoryComment( - __('You notified customer about invoice #%1.', - $invoice->getIncrementId()) - )->setIsCustomerNotified( - true - )->save(); - + $order->addStatusHistoryComment(__('You notified customer about invoice #%1.', $invoice->getIncrementId())) + ->setIsCustomerNotified(true) + ->save(); } return $this->result->setContents("TRUE| " . $message); diff --git a/composer.json b/composer.json index a69cbcbe..ccb6c2c7 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "paynl/magento2-plugin", "description": "PAY. Magento2 Payment methods", "type": "magento2-module", - "version": "1.7.2", + "version": "1.7.3", "require": { "magento/module-sales": "100 - 103", "magento/module-payment": "100 - 103", diff --git a/etc/adminhtml/paymentmethods/billink.xml b/etc/adminhtml/paymentmethods/billink.xml index 651a81f4..6e2caf7c 100644 --- a/etc/adminhtml/paymentmethods/billink.xml +++ b/etc/adminhtml/paymentmethods/billink.xml @@ -145,12 +145,13 @@ - + Magento\Config\Model\Config\Source\Yesno 1 - payment/paynl_payment_billink/turn_off_invoices_b2b + payment/paynl_payment_billink/turn_off_invoices_b2b + @@ -164,4 +165,3 @@ - \ No newline at end of file From feaa0ac061cedc2f40745edc82f7657f09323181 Mon Sep 17 00:00:00 2001 From: "k.verschoor@pay.nl" Date: Wed, 10 Mar 2021 14:06:23 +0100 Subject: [PATCH 06/10] Fix invoice not being made for regular methods --- Controller/Checkout/Exchange.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php index 7f2e8c5f..38b3c449 100644 --- a/Controller/Checkout/Exchange.php +++ b/Controller/Checkout/Exchange.php @@ -322,6 +322,8 @@ private function processPaidOrder(Transaction $transaction, Order $order) ); } + $this->orderRepository->save($order); + $invoice = $payment->getCreatedInvoice(); if ($invoice && !$invoice->getEmailSent()) { $this->invoiceSender->send($invoice); From f80572f6eba983059f8bec8d6da2755e2f495417 Mon Sep 17 00:00:00 2001 From: "k.verschoor@pay.nl" Date: Wed, 10 Mar 2021 16:58:33 +0100 Subject: [PATCH 07/10] Move save function to prevent it from being used twice --- Controller/Checkout/Exchange.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php index 38b3c449..d75a0e8e 100644 --- a/Controller/Checkout/Exchange.php +++ b/Controller/Checkout/Exchange.php @@ -295,8 +295,7 @@ private function processPaidOrder(Transaction $transaction, Order $order) } else { $statusPaid = $this->config->getPaidStatus($order->getPayment()->getMethod()); $order->setStatus(!empty($statusPaid) ? $statusPaid : Order::STATE_PROCESSING); - } - $this->orderRepository->save($order); + } # Notify customer if ($order && !$order->getEmailSent()) { @@ -309,6 +308,7 @@ private function processPaidOrder(Transaction $transaction, Order $order) $orderCompany = $order->getBillingAddress()->getCompany(); if ($skipB2BInvoice == 1 && !empty($orderCompany)) { $order->addStatusHistoryComment(__('B2B Setting: Skipped creating invoice'))->save(); + $this->orderRepository->save($order); return $this->result->setContents("TRUE| " . $message . " (B2B: No invoice created)"); } From 699a3f63269769de5f04734874409619e5d8029c Mon Sep 17 00:00:00 2001 From: "k.verschoor@pay.nl" Date: Thu, 11 Mar 2021 17:30:18 +0100 Subject: [PATCH 08/10] Make transaction when skipping the invoice --- Controller/Checkout/Exchange.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php index d75a0e8e..bbc5eed8 100644 --- a/Controller/Checkout/Exchange.php +++ b/Controller/Checkout/Exchange.php @@ -307,7 +307,19 @@ private function processPaidOrder(Transaction $transaction, Order $order) $skipB2BInvoice = $this->config->ignoreB2BInvoice($order->getPayment()->getMethod()); $orderCompany = $order->getBillingAddress()->getCompany(); if ($skipB2BInvoice == 1 && !empty($orderCompany)) { - $order->addStatusHistoryComment(__('B2B Setting: Skipped creating invoice'))->save(); + # Create transaction + $formatedPrice = $order->getBaseCurrency()->formatTxt($order->getGrandTotal()); + $transactionMessage = __('PAY. - Captured amount of %1.', $formatedPrice); + $transactionBuilder = $this->builderInterface->setPayment($payment) + ->setOrder($order) + ->setTransactionId($transaction->getId()) + ->setFailSafe(true) + ->build('capture'); + $payment->addTransactionCommentsToOrder($transactionBuilder, $transactionMessage); + $payment->setParentTransactionId(null); + $payment->save(); + $transactionBuilder->save(); + $order->addStatusHistoryComment(__('B2B Setting: Skipped creating invoice')); $this->orderRepository->save($order); return $this->result->setContents("TRUE| " . $message . " (B2B: No invoice created)"); } From fa8c92c42534e80051c4b4fd09a72076429d4efb Mon Sep 17 00:00:00 2001 From: "k.verschoor@pay.nl" Date: Fri, 12 Mar 2021 12:10:41 +0100 Subject: [PATCH 09/10] Add missing lines --- Controller/Checkout/Exchange.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php index bbc5eed8..312f0300 100644 --- a/Controller/Checkout/Exchange.php +++ b/Controller/Checkout/Exchange.php @@ -63,6 +63,12 @@ class Exchange extends PayAction implements CsrfAwareActionInterface */ private $orderRepository; + /** + * + * @var Magento\Sales\Model\Order\Payment\Transaction\BuilderInterface + */ + private $builderInterface; + private $paynlConfig; public function createCsrfValidationException(RequestInterface $request): ?InvalidRequestException @@ -95,7 +101,8 @@ public function __construct( \Psr\Log\LoggerInterface $logger, \Magento\Framework\Controller\Result\Raw $result, OrderRepository $orderRepository, - \Paynl\Payment\Model\Config $paynlConfig + \Paynl\Payment\Model\Config $paynlConfig, + \Magento\Sales\Model\Order\Payment\Transaction\BuilderInterface $builderInterface ) { $this->result = $result; @@ -106,6 +113,7 @@ public function __construct( $this->logger = $logger; $this->orderRepository = $orderRepository; $this->paynlConfig = $paynlConfig; + $this->builderInterface = $builderInterface; parent::__construct($context); } From 086052bf235ba6a105fcfdbd1c43368d2a13a710 Mon Sep 17 00:00:00 2001 From: woutse Date: Mon, 15 Mar 2021 10:57:30 +0100 Subject: [PATCH 10/10] Updated ignoreB2BInvoice check --- Controller/Checkout/Exchange.php | 44 +++++++++++++++----------------- Model/Config.php | 2 +- 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php index 312f0300..f3759cde 100644 --- a/Controller/Checkout/Exchange.php +++ b/Controller/Checkout/Exchange.php @@ -176,7 +176,7 @@ public function execute() $this->logger->debug('Already captured.'); return $this->result->setContents('TRUE| Already captured.'); - } + } } if ($transaction->isPaid() || $transaction->isAuthorized()) { @@ -296,14 +296,15 @@ private function processPaidOrder(Transaction $transaction, Order $order) # Force order state to processing $order->setState(Order::STATE_PROCESSING); + $paymentMethod = $order->getPayment()->getMethod(); if ($transaction->isAuthorized()) { - $statusAuthorized = $this->config->getAuthorizedStatus($order->getPayment()->getMethod()); + $statusAuthorized = $this->config->getAuthorizedStatus($paymentMethod); $order->setStatus(!empty($statusAuthorized) ? $statusAuthorized : Order::STATE_PROCESSING); } else { - $statusPaid = $this->config->getPaidStatus($order->getPayment()->getMethod()); + $statusPaid = $this->config->getPaidStatus($paymentMethod); $order->setStatus(!empty($statusPaid) ? $statusPaid : Order::STATE_PROCESSING); - } + } # Notify customer if ($order && !$order->getEmailSent()) { @@ -311,25 +312,22 @@ private function processPaidOrder(Transaction $transaction, Order $order) $order->addStatusHistoryComment(__('New order email sent'))->setIsCustomerNotified(true)->save(); } - # Skip creation of invoice for B2B - $skipB2BInvoice = $this->config->ignoreB2BInvoice($order->getPayment()->getMethod()); - $orderCompany = $order->getBillingAddress()->getCompany(); - if ($skipB2BInvoice == 1 && !empty($orderCompany)) { - # Create transaction - $formatedPrice = $order->getBaseCurrency()->formatTxt($order->getGrandTotal()); - $transactionMessage = __('PAY. - Captured amount of %1.', $formatedPrice); - $transactionBuilder = $this->builderInterface->setPayment($payment) - ->setOrder($order) - ->setTransactionId($transaction->getId()) - ->setFailSafe(true) - ->build('capture'); - $payment->addTransactionCommentsToOrder($transactionBuilder, $transactionMessage); - $payment->setParentTransactionId(null); - $payment->save(); - $transactionBuilder->save(); - $order->addStatusHistoryComment(__('B2B Setting: Skipped creating invoice')); - $this->orderRepository->save($order); - return $this->result->setContents("TRUE| " . $message . " (B2B: No invoice created)"); + # Skip creation of invoice for B2B if enabled + if ($this->config->ignoreB2BInvoice($paymentMethod)) { + $orderCompany = $order->getBillingAddress()->getCompany(); + if(!empty($orderCompany)) { + # Create transaction + $formatedPrice = $order->getBaseCurrency()->formatTxt($order->getGrandTotal()); + $transactionMessage = __('PAY. - Captured amount of %1.', $formatedPrice); + $transactionBuilder = $this->builderInterface->setPayment($payment)->setOrder($order)->setTransactionId($transaction->getId())->setFailSafe(true)->build('capture'); + $payment->addTransactionCommentsToOrder($transactionBuilder, $transactionMessage); + $payment->setParentTransactionId(null); + $payment->save(); + $transactionBuilder->save(); + $order->addStatusHistoryComment(__('B2B Setting: Skipped creating invoice')); + $this->orderRepository->save($order); + return $this->result->setContents("TRUE| " . $message . " (B2B: No invoice created)"); + } } # Make the invoice and send it to the customer diff --git a/Model/Config.php b/Model/Config.php index 3b65d212..7db4b401 100644 --- a/Model/Config.php +++ b/Model/Config.php @@ -127,7 +127,7 @@ public function getPaidStatus($methodCode){ public function ignoreB2BInvoice($methodCode) { - return $this->store->getConfig('payment/' . $methodCode . '/turn_off_invoices_b2b'); + return $this->store->getConfig('payment/' . $methodCode . '/turn_off_invoices_b2b') == 1; }