diff --git a/Model/ConfigProvider/Account.php b/Model/ConfigProvider/Account.php index 0c75bb5c7..bd3bdde8a 100644 --- a/Model/ConfigProvider/Account.php +++ b/Model/ConfigProvider/Account.php @@ -142,7 +142,7 @@ public function getConfig($store = null) 'order_status_failed' => $this->getOrderStatusFailed($store), 'create_order_before_transaction' => $this->getCreateOrderBeforeTransaction($store), 'ip_header' => $this->getIpHeader($store), - 'cart_keep_alive' => $this->getCartKeepAlive($store),//can be changed from cli/db only + 'cart_keep_alive' => true, 'selection_type' => $this->getSelectionType($store), 'customer_additional_info' => $this->getCustomerAdditionalInfo($store), 'buckaroo_fee_tax_class' => $this->getBuckarooFeeTaxClass($store), diff --git a/Model/Ideal/QuoteBuilder.php b/Model/Ideal/QuoteBuilder.php index e1975deb3..18464a5aa 100644 --- a/Model/Ideal/QuoteBuilder.php +++ b/Model/Ideal/QuoteBuilder.php @@ -17,6 +17,7 @@ * @copyright Copyright (c) Buckaroo B.V. * @license https://tldrlegal.com/license/mit-license */ + namespace Buckaroo\Magento2\Model\Ideal; use Magento\Customer\Model\Group; @@ -64,11 +65,12 @@ class QuoteBuilder implements QuoteBuilderInterface protected $quote; public function __construct( - QuoteFactory $quoteFactory, + QuoteFactory $quoteFactory, ProductRepositoryInterface $productRepository, - DataObjectFactory $dataObjectFactory, - CustomerSession $customer - ) { + DataObjectFactory $dataObjectFactory, + CustomerSession $customer + ) + { $this->quoteFactory = $quoteFactory; $this->productRepository = $productRepository; $this->dataObjectFactory = $dataObjectFactory; @@ -80,6 +82,7 @@ public function setFormData(string $formData) { $this->formData = $this->formatFormData($formData); } + /** * Build quote from form data and session without persisting it * @@ -88,6 +91,7 @@ public function setFormData(string $formData) public function build() { $this->quote = $this->quoteFactory->create(); + $this->quote->setIsCheckoutCart(true); $this->addProduct(); $this->setUser(); return $this->quote; @@ -111,6 +115,7 @@ protected function setUser() ->setCustomerGroupId(Group::NOT_LOGGED_IN_ID); } } + /** * Add product to quote * @@ -134,7 +139,8 @@ protected function addProduct() throw new IdealException($exceptionMessage, 1); } } -/** + + /** * Format form data * * @param string $form_data diff --git a/Service/Sales/Quote/Recreate.php b/Service/Sales/Quote/Recreate.php index 31685868f..333a21d9a 100644 --- a/Service/Sales/Quote/Recreate.php +++ b/Service/Sales/Quote/Recreate.php @@ -48,9 +48,9 @@ public function recreate($quote, $response = []) { // @codingStandardsIgnoreStart try { - $quote->setIsActive(true); -// $quote->setTriggerRecollect('1'); + $quote->setIsActive(1); $quote->setReservedOrderId(null); + $quote->setBuckarooFee(null); $quote->setBaseBuckarooFee(null); $quote->setBuckarooFeeTaxAmount(null); @@ -58,20 +58,19 @@ public function recreate($quote, $response = []) $quote->setBuckarooFeeInclTax(null); $quote->setBaseBuckarooFeeInclTax(null); - if (isset($response['add_service_action_from_magento']) && $response['add_service_action_from_magento'] === 'payfastcheckout') { + if (isset($response['add_service_action_from_magento']) + && $response['add_service_action_from_magento'] === 'payfastcheckout' + ) { $this->logger->addDebug(__METHOD__ . '|Handling payfastcheckout specific logic.'); $quote->setCustomerEmail(null); - // Remove existing addresses if they exist if ($billingAddress = $quote->getBillingAddress()) { $quote->removeAddress($billingAddress->getId()); - $billingAddress->addData([]); // Optionally clear address data } if ($shippingAddress = $quote->getShippingAddress()) { $quote->removeAddress($shippingAddress->getId()); - $shippingAddress->addData([]); // Optionally clear address data } } diff --git a/view/frontend/templates/catalog/product/view/ideal-fast-checkout.phtml b/view/frontend/templates/catalog/product/view/ideal-fast-checkout.phtml index a4081c320..62c87fa8d 100644 --- a/view/frontend/templates/catalog/product/view/ideal-fast-checkout.phtml +++ b/view/frontend/templates/catalog/product/view/ideal-fast-checkout.phtml @@ -34,6 +34,7 @@ if ($block->canShowButton('Product')): ?> "components": { "fastCheckoutIdeal": { "component":"buckaroo/ideal-fast-checkout/pay", + "template":"Buckaroo_Magento2/catalog/product/view/ideal-fast-checkout", "config": { "page": "product", "paymentData": { diff --git a/view/frontend/templates/checkout/cart/ideal-fast-checkout.phtml b/view/frontend/templates/checkout/cart/ideal-fast-checkout.phtml index 5238981a1..b5fc16b5b 100644 --- a/view/frontend/templates/checkout/cart/ideal-fast-checkout.phtml +++ b/view/frontend/templates/checkout/cart/ideal-fast-checkout.phtml @@ -26,6 +26,7 @@ if ($block->canShowButton('Cart')): ?> <?= __('Ideal Fast Checkout') ?> +