diff --git a/.gitignore b/.gitignore index ecb3ecca0..b081dc077 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ composer.lock var tools dev/node_modules +dev/package-lock.json .idea diff --git a/api/paymentmethods/paymentrequestfactory.php b/api/paymentmethods/paymentrequestfactory.php index 1a57cb9c0..cb12cda2b 100644 --- a/api/paymentmethods/paymentrequestfactory.php +++ b/api/paymentmethods/paymentrequestfactory.php @@ -44,7 +44,6 @@ class PaymentRequestFactory public const REQUEST_TYPE_PAYCONIQ = 'payconiq'; public const REQUEST_TYPE_PAYPEREMAIL = 'payperemail'; public const REQUEST_TYPE_PRZELEWY24 = 'przelewy24'; - public const REQUEST_TYPE_TINKA = 'tinka'; public const REQUEST_TYPE_TRUSTLY = 'trustly'; public const REQUEST_TYPE_WECHATPAY = 'wechatpay'; public const REQUEST_TYPE_ALIPAY = 'alipay'; @@ -77,7 +76,6 @@ class PaymentRequestFactory PaymentRequestFactory::REQUEST_TYPE_PAYCONIQ => 'Payconiq', PaymentRequestFactory::REQUEST_TYPE_PAYPEREMAIL => 'PayPerEmail', PaymentRequestFactory::REQUEST_TYPE_PRZELEWY24 => 'Przelewy24', - PaymentRequestFactory::REQUEST_TYPE_TINKA => 'Tinka', PaymentRequestFactory::REQUEST_TYPE_TRUSTLY => 'Trustly', PaymentRequestFactory::REQUEST_TYPE_WECHATPAY => 'Wechatpay', PaymentRequestFactory::REQUEST_TYPE_ALIPAY => 'Alipay', diff --git a/api/paymentmethods/response.php b/api/paymentmethods/response.php index fc8b69e59..aaf696dea 100644 --- a/api/paymentmethods/response.php +++ b/api/paymentmethods/response.php @@ -17,6 +17,7 @@ require_once dirname(__FILE__) . '/../../library/logger.php'; require_once dirname(__FILE__) . '/../abstract.php'; require_once _PS_ROOT_DIR_ . '/modules/buckaroo3/vendor/autoload.php'; + use Buckaroo\BuckarooClient; use Buckaroo\Handlers\Reply\ReplyHandler; use Buckaroo\Transaction\Response\TransactionResponse; @@ -27,15 +28,11 @@ abstract class Response extends BuckarooAbstract { - // false if not received response private $received = false; - // true if validated and securety checked private $validated = false; - // request is test? private $test = true; private $signature; private $isPush; - // payment key public $payment; public $payment_method; public $statuscode; @@ -53,43 +50,36 @@ abstract class Response extends BuckarooAbstract public $brq_transaction_type; public $brq_relatedtransaction_partialpayment; public $brq_relatedtransaction_refund; - // transaction key public $transactions; - // if is errors, othervise = null public $parameterError; - protected ?TransactionResponse $response = null; + protected $logger; public function __construct(TransactionResponse $response = null) { + $this->logger = new Logger(Logger::INFO, 'response'); + $this->logger->logInfo("\n\n\n\n***************** Response start ***********************"); + if ($response) { $this->response = $response; + $this->logger->logInfo('Response object provided directly'); } else { $this->isPush = $this->isPushRequest(); $this->received = true; + $this->logger->logInfo('Response determined to be a push request'); $this->parsePushRequest(); } } - /** - * Get code required for payment - * - * @param string $configCode - * - * @return string - */ protected function getPaymentCode(string $configCode): string { - if ($configCode === 'Capayable') { - return 'in3'; - } - - return $configCode; + return $configCode === 'Capayable' ? 'in3' : $configCode; } private function parsePushRequest() { if (!$this->isPushRequest()) { + $this->logger->logInfo('Not a push request'); return false; } @@ -99,7 +89,6 @@ private function parsePushRequest() } elseif (Tools::getValue('brq_transaction_method')) { $this->payment_method = $this->getPaymentCode(Tools::getValue('brq_transaction_method')); } - $this->statuscode = $this->setPostVariable('brq_statuscode'); $this->statusmessage = $this->setPostVariable('brq_statusmessage'); $this->statuscode_detail = $this->setPostVariable('brq_statuscode_detail'); @@ -109,87 +98,66 @@ private function parsePushRequest() $this->invoice = $this->setPostVariable('brq_invoicenumber'); $this->invoicenumber = $this->setPostVariable('brq_invoicenumber'); $this->amount = $this->setPostVariable('brq_amount'); - if (Tools::getValue('brq_amount_credit')) { - $this->amount_credit = Tools::getValue('brq_amount_credit'); - } - + $this->amount_credit = $this->setPostVariable('brq_amount_credit'); $this->currency = $this->setPostVariable('brq_currency'); $this->test = $this->setPostVariable('brq_test'); $this->timestamp = $this->setPostVariable('brq_timestamp'); $this->transactions = $this->setPostVariable('brq_transactions'); $this->signature = $this->setPostVariable('brq_signature'); + $this->logger->logInfo('Parsed push request', [ + 'statuscode' => $this->statuscode, + 'statusmessage' => $this->statusmessage, + 'amount' => $this->amount, + 'currency' => $this->currency, + 'timestamp' => $this->timestamp + ]); + if (!empty($this->statuscode)) { - $responseArray = $this->responseCodes[(int) $this->statuscode]; + $responseArray = $this->responseCodes[(int)$this->statuscode]; $this->status = $responseArray['status']; $this->message = $responseArray['message']; } } - /** - * @return bool - */ public function isSuccess(): bool { return $this->response->isSuccess(); } - /** - * @return bool - */ public function isFailed(): bool { return $this->response->isFailed(); } - /** - * @return bool - */ public function isCanceled(): bool { return $this->response->isCanceled(); } - /** - * @return bool - */ public function isAwaitingConsumer(): bool { return $this->response->isAwaitingConsumer(); } - /** - * @return bool - */ public function isPendingProcessing(): bool { return $this->response->isPendingProcessing(); } - /** - * @return bool - */ public function isWaitingOnUserInput(): bool { return $this->response->isWaitingOnUserInput(); } - /** - * @return bool - */ public function isRejected(): bool { return $this->response->isRejected(); } - // Determine if is buckaroo response or push - private function isPushRequest() + private function isPushRequest(): bool { - if (Tools::getValue('brq_statuscode')) { - return true; - } - - return false; + return (bool)Tools::getValue('brq_statuscode'); } public function getServiceParameters() @@ -197,7 +165,27 @@ public function getServiceParameters() return $this->response->getServiceParameters(); } - public function hasSomeError() + public function getStatuscode() + { + return $this->response->statuscode; + } + + public function getStatusmessage() + { + return $this->response->statusmessage; + } + + public function getAmount() + { + return $this->response->amount; + } + + public function getBrqRelatedtransactionPartialpayment() + { + return $this->brq_relatedtransaction_partialpayment; + } + + public function hasSomeError(): bool { return $this->response->hasSomeError(); } @@ -207,12 +195,12 @@ public function getSomeError() return $this->response->getSomeError(); } - public function isTest() + public function isTest(): bool { return $this->response->get('IsTest') === true; } - public function isValid() + public function isValid(): bool { if (!$this->validated) { if ($this->isPush) { @@ -220,58 +208,60 @@ public function isValid() try { $reply_handler = new ReplyHandler($buckaroo->client()->config(), $_POST); $reply_handler->validate(); - - return $this->validated = $reply_handler->isValid(); + $this->validated = $reply_handler->isValid(); + $this->logger->logInfo('Push request validated successfully'); } catch (Exception $e) { + $this->logger->logError('Push request validation failed', ['exception' => $e->getMessage()]); } } elseif ($this->response) { - $this->validated = (!$this->response->isValidationFailure()); + $this->validated = !$this->response->isValidationFailure(); + $this->logger->logInfo('Response validation status', ['validated' => $this->validated]); } } return $this->validated; } - public function hasSucceeded() + public function hasSucceeded(): bool { if (isset($this->response)) { try { if ($this->isValid()) { if ($this->isPendingProcessing() || $this->isAwaitingConsumer() || $this->isWaitingOnUserInput() || $this->isSuccess()) { + $this->logger->logInfo('Response has succeeded'); return true; } } } catch (Exception $e) { + $this->logger->logError('Exception while checking success', ['exception' => $e->getMessage()]); } } elseif (in_array($this->status, [self::BUCKAROO_PENDING_PAYMENT, self::BUCKAROO_SUCCESS])) { + $this->logger->logInfo('Response status indicates success'); return true; } + $this->logger->logInfo('Response has not succeeded'); return false; } - public function isRedirectRequired() + public function isRedirectRequired(): bool { return $this->response->hasRedirect(); } - public function getRedirectUrl() + public function getRedirectUrl(): string { return $this->response->getRedirectUrl(); } - public function getResponse() + public function getResponse(): ?TransactionResponse { return $this->response; } private function setPostVariable($key) { - if (Tools::getValue($key)) { - return Tools::getValue($key); - } else { - return null; - } + return Tools::getValue($key) ?? null; } public function getCartIdAndReferenceId($show = false) @@ -283,14 +273,10 @@ public function getCartIdAndReferenceId($show = false) $cartId = 0; $reference = $this->invoicenumber; } - if ($show == 'cartId') { - return (int) $cartId; - } - - return $reference; + return $show == 'cartId' ? (int)$cartId : $reference; } - public function getCartId() + public function getCartId(): int { return $this->getCartIdAndReferenceId('cartId'); } @@ -299,4 +285,35 @@ public function getReferenceId() { return $this->getCartIdAndReferenceId('reference'); } + + public function isPartialPayment(): bool + { + return !empty($this->getGroupTransaction()); + } + + public function getRemainingAmount(): float + { + return $this->response->remaining_amount ?? 0; + } + + public function getGroupTransaction() + { + $data = $this->response->data(); + if (isset($data['RequiredAction']['PayRemainderDetails']['GroupTransaction'])) { + return $data['RequiredAction']['PayRemainderDetails']['GroupTransaction']; + } + return null; + } + + public function getRemainderAmount() + { + $data = $this->response->data(); + if (!isset($data['RequiredAction']['PayRemainderDetails']['RemainderAmount']) || + !is_scalar($data['RequiredAction']['PayRemainderDetails']['RemainderAmount']) + ) { + return 0; + } + return (float) $data['RequiredAction']['PayRemainderDetails']['RemainderAmount']; + } + } diff --git a/api/paymentmethods/tinka/index.php b/api/paymentmethods/tinka/index.php deleted file mode 100644 index 97ec565fb..000000000 --- a/api/paymentmethods/tinka/index.php +++ /dev/null @@ -1,25 +0,0 @@ - - * @copyright Copyright (c) Buckaroo B.V. - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../'); -exit; diff --git a/api/paymentmethods/tinka/tinka.php b/api/paymentmethods/tinka/tinka.php deleted file mode 100644 index c099c61ba..000000000 --- a/api/paymentmethods/tinka/tinka.php +++ /dev/null @@ -1,41 +0,0 @@ - - * @copyright Copyright (c) Buckaroo B.V. - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -if (!defined('_PS_VERSION_')) { - exit; -} - -require_once dirname(__FILE__) . '/../paymentmethod.php'; - -class Tinka extends PaymentMethod -{ - public function __construct() - { - $this->type = 'tinka'; - } - - public function getPayload($data) - { - return array_merge_recursive($this->payload, $data); - } - - public function pay($customVars = []) - { - $this->payload = $this->getPayload($customVars); - - return parent::pay(); - } -} diff --git a/buckaroo3.php b/buckaroo3.php index 8c3ad9d0d..a0ec7be54 100644 --- a/buckaroo3.php +++ b/buckaroo3.php @@ -17,6 +17,7 @@ if (!defined('_PS_VERSION_')) { exit; } + require_once _PS_MODULE_DIR_ . 'buckaroo3/vendor/autoload.php'; require_once _PS_MODULE_DIR_ . 'buckaroo3/api/paymentmethods/responsefactory.php'; require_once _PS_MODULE_DIR_ . 'buckaroo3/controllers/front/common.php'; @@ -33,6 +34,7 @@ use Buckaroo\PrestaShop\Src\Install\Installer; use Buckaroo\PrestaShop\Src\Install\Uninstaller; use Buckaroo\PrestaShop\Src\Refund\Settings as RefundSettings; +use Buckaroo\PrestaShop\Src\Repository\RawBuckarooFeeRepository; use Buckaroo\PrestaShop\Src\Repository\RawPaymentMethodRepository; use Buckaroo\PrestaShop\Src\Service\BuckarooIdinService; use PrestaShop\PrestaShop\Core\Localization\Exception\LocalizationException; @@ -40,28 +42,39 @@ class Buckaroo3 extends PaymentModule { public $logger; - private $locale; public function __construct() + { + $this->initializeModuleInfo(); + parent::__construct(); + $this->initializeLogger(); + $this->initializeDisplayName(); + $this->checkConfiguration(); + } + + private function initializeModuleInfo() { $this->name = 'buckaroo3'; $this->tab = 'payments_gateways'; - $this->version = '4.2.0'; + $this->version = '4.2.1'; $this->author = 'Buckaroo'; $this->need_instance = 1; $this->bootstrap = true; $this->module_key = '8d2a2f65a77a8021da5d5ffccc9bbd2b'; $this->ps_versions_compliancy = ['min' => '1', 'max' => _PS_VERSION_]; - - parent::__construct(); - $this->displayName = $this->l('Buckaroo Payments') . ' (v ' . $this->version . ')'; $this->description = $this->l('Buckaroo Payment module. Compatible with PrestaShop version 1.7.x + 8.1.4'); - $this->confirmUninstall = $this->l('Are you sure you want to delete Buckaroo Payments module?'); $this->tpl_folder = 'buckaroo3'; + } + + private function initializeLogger() + { $this->logger = new \Logger(CoreLogger::INFO, ''); + } + private function initializeDisplayName() + { $response = ResponseFactory::getResponse(); if ($response && $response->isValid()) { if ($response->brq_transaction_type == 'I150') { @@ -69,39 +82,22 @@ public function __construct() } elseif ($response->hasSucceeded()) { $this->displayName = $response->payment_method; } elseif (isset($response->status) && $response->status > 0) { - $this->displayName = - (new RawPaymentMethodRepository())->getPaymentMethodsLabel($response->payment_method); + $this->displayName = (new RawPaymentMethodRepository())->getPaymentMethodsLabel($response->payment_method); } else { - $this->displayName = $this->l('Buckaroo Payments (v 4.2.0)'); + $this->displayName = $this->l('Buckaroo Payments (v 4.2.1)'); } } + } + private function checkConfiguration() + { if (!Configuration::get('BUCKAROO_MERCHANT_KEY') || !Configuration::get('BUCKAROO_SECRET_KEY') || !Configuration::get('BUCKAROO_ORDER_STATE_DEFAULT') || !Configuration::get('BUCKAROO_ORDER_STATE_SUCCESS') - || !Configuration::get('BUCKAROO_ORDER_STATE_FAILED') - ) { + || !Configuration::get('BUCKAROO_ORDER_STATE_FAILED')) { return ''; } - - $translations = []; - $translations[] = $this->l('Your payment was unsuccessful. Please try again or choose another payment method.'); - $translations[] = $this->l('Order confirmation'); - $translations[] = $this->l('current_step'); - $translations[] = $this->l('Your order is complete.'); - $translations[] = $this->l('You have chosen the'); - $translations[] = $this->l('payment method.'); - $translations[] = $this->l('Your order will be sent very soon.'); - $translations[] = $this->l( - 'For any questions or for further information, please contact our customer support.' - ); - $translations[] = $this->l('Total of the transaction (taxes incl.) :'); - $translations[] = $this->l('Your order reference ID is :'); - $translations[] = $this->l('Back to orders'); - $translations[] = $this->l('Follow my order'); - $translations[] = $this->l('Payment in progress'); - $translations[] = $this->l('Buckaroo supports the following gift cards:'); } /** @@ -110,15 +106,37 @@ public function __construct() */ public function hookDisplayAdminOrderMainBottom($params) { + $order = new Order($params['id_order']); + + if ($order->module !== 'buckaroo3') { + return; + } + $refundProvider = $this->get('buckaroo.refund.admin.provider'); + $refunds = $refundProvider->get($order); + $this->context->smarty->assign($refunds); - $this->smarty->assign( - $refundProvider->get( - new Order($params['id_order']) - ) - ); + $buckarooFeeData = (new RawBuckarooFeeRepository())->getFeeByOrderId($order->id); + + // Ensure that $buckarooFeeData is an array + if (!is_array($buckarooFeeData)) { + $buckarooFeeData = [ + 'buckaroo_fee_tax_excl' => 0, + 'buckaroo_fee_tax_incl' => 0, + 'buckaroo_fee_tax' => 0 + ]; + } else { + $buckarooFeeData['buckaroo_fee_tax'] = $buckarooFeeData['buckaroo_fee_tax_incl'] - $buckarooFeeData['buckaroo_fee_tax_excl']; + } + + $this->context->smarty->assign([ + 'buckaroo_fee' => $buckarooFeeData, + 'currency' => new Currency($order->id_currency) + ]); - return $this->display(__FILE__, 'views/templates/hook/refund-hook.tpl'); + // Display both templates + return $this->display(__FILE__, 'views/templates/hook/payment-fee-table.tpl'). + $this->display(__FILE__, 'views/templates/hook/refund-hook.tpl'); } /** @@ -132,23 +150,43 @@ public function hookDisplayOrderConfirmation(array $params) if (!$order || !($cart = new Cart($order->id_cart))) { return ''; } - $buckarooFee = $this->getBuckarooFeeByCartId($cart->id); - if (!$buckarooFee) { + + $buckarooFeeData = (new RawBuckarooFeeRepository())->getFeeByOrderId($order->id); + + if (!$buckarooFeeData) { return ''; } - $sql = 'UPDATE `' . _DB_PREFIX_ . "orders` SET total_paid_tax_incl = '" . $order->total_paid . - "' WHERE id_cart = '" . $cart->id . "'"; - Db::getInstance()->execute($sql); + + $buckarooFee = (float) $buckarooFeeData['buckaroo_fee_tax_excl']; + $taxData = $this->calculateTax($cart, $buckarooFee); + $paymentFeeLabel = Configuration::get('PAYMENT_FEE_FRONTEND_LABEL'); // Assign data to Smarty $this->context->smarty->assign([ - 'orderBuckarooFee' => $this->formatPrice($buckarooFee), + 'orderBuckarooFee' => $this->formatPrice($taxData['feeInclTax']), + 'paymentFeeLabel' => $paymentFeeLabel, ]); // Fetch and return the template content return $this->display(__FILE__, 'views/templates/hook/order-confirmation-fee.tpl'); } + private function calculateTax($cart, $fee) + { + $address = new Address($cart->id_address_invoice); + $taxManager = TaxManagerFactory::getManager($address, (int) Configuration::get('PS_TAX')); + $taxCalculator = $taxManager->getTaxCalculator(); + $taxRate = $taxCalculator->getTotalRate(); + $taxAmount = $fee * ($taxRate / 100); + $feeInclTax = $fee + $taxAmount; + + return [ + 'taxRate' => $taxRate, + 'taxAmount' => $taxAmount, + 'feeInclTax' => $feeInclTax, + ]; + } + /** * @throws PrestaShopException * @throws PrestaShopDatabaseException @@ -161,76 +199,91 @@ public function install() if (!parent::install()) { $this->_errors[] = $this->l('Unable to install module'); + return false; + } + if (!$this->runInstallers()) { return false; } - $databaseTableInstaller = new DatabaseTableInstaller(); + (new RefundSettings())->install(); + $this->configureOrderStates(); + Configuration::updateValue('PS_COOKIE_SAMESITE', 'None'); + return true; + } + + private function runInstallers() + { + $databaseTableInstaller = new DatabaseTableInstaller(); $coreInstaller = new Installer($this, $databaseTableInstaller); if (!$coreInstaller->install()) { $this->_errors = array_merge($this->_errors, $coreInstaller->getErrors()); - return false; } - (new RefundSettings())->install(); - - $states = OrderState::getOrderStates((int) Configuration::get('PS_LANG_DEFAULT')); + return true; + } + private function configureOrderStates() + { + $states = OrderState::getOrderStates((int)Configuration::get('PS_LANG_DEFAULT')); $currentStates = []; + foreach ($states as $state) { - $state = (object) $state; + $state = (object)$state; $currentStates[$state->id_order_state] = $state->name; } + $defaultOrderState = $this->getOrCreateDefaultOrderState($currentStates); + Configuration::updateValue('BUCKAROO_ORDER_STATE_DEFAULT', $defaultOrderState->id); + Configuration::updateValue('BUCKAROO_ORDER_STATE_SUCCESS', Configuration::get('PS_OS_PAYMENT')); + Configuration::updateValue('BUCKAROO_ORDER_STATE_FAILED', Configuration::get('PS_OS_CANCELED')); + } + + private function getOrCreateDefaultOrderState($currentStates) + { if (($state_id = array_search($this->l('Awaiting for Remote payment'), $currentStates)) === false) { - // Add the custom order state - $defaultOrderState = new OrderState(); - $defaultOrderState->name = [ - Configuration::get('PS_LANG_DEFAULT') => $this->l( - 'Awaiting for Remote payment' - ), - ]; - $defaultOrderState->module_name = $this->name; - $defaultOrderState->send_email = 0; - $defaultOrderState->template = ''; - $defaultOrderState->invoice = 0; - $defaultOrderState->color = '#FFF000'; - $defaultOrderState->unremovable = false; - $defaultOrderState->logable = 0; - if ($defaultOrderState->add()) { - $source = dirname(__FILE__) . '/logo.gif'; - $destination = dirname(__FILE__) . '/../../img/os/' . (int) $defaultOrderState->id . '.gif'; - if (!file_exists($destination)) { - copy($source, $destination); - } - } + return $this->createDefaultOrderState(); } else { $defaultOrderState = new stdClass(); $defaultOrderState->id = $state_id; + return $defaultOrderState; } + } - Configuration::updateValue('BUCKAROO_ORDER_STATE_DEFAULT', $defaultOrderState->id); - Configuration::updateValue('BUCKAROO_ORDER_STATE_SUCCESS', Configuration::get('PS_OS_PAYMENT')); - Configuration::updateValue('BUCKAROO_ORDER_STATE_FAILED', Configuration::get('PS_OS_CANCELED')); + private function createDefaultOrderState() + { + $defaultOrderState = new OrderState(); + $defaultOrderState->name = [Configuration::get('PS_LANG_DEFAULT') => $this->l('Awaiting for Remote payment')]; + $defaultOrderState->module_name = $this->name; + $defaultOrderState->send_email = 0; + $defaultOrderState->template = ''; + $defaultOrderState->invoice = 0; + $defaultOrderState->color = '#FFF000'; + $defaultOrderState->unremovable = false; + $defaultOrderState->logable = 0; - // Cookie SameSite fix - Configuration::updateValue('PS_COOKIE_SAMESITE', 'None'); + if ($defaultOrderState->add()) { + $this->copyLogo($defaultOrderState->id); + } - return true; + return $defaultOrderState; } - public function uninstall() + private function copyLogo($stateId) { - $databaseTableUninstaller = new DatabaseTableUninstaller(); - $databaseIdinColumnsRemover = new IdinColumnsRemover(); - $uninstall = new Uninstaller($this, $databaseTableUninstaller, $databaseIdinColumnsRemover); - - if (!$uninstall->uninstall()) { - $this->_errors[] = $uninstall->getErrors(); + $source = dirname(__FILE__) . '/logo.gif'; + $destination = dirname(__FILE__) . '/../../img/os/' . (int)$stateId . '.gif'; + if (!file_exists($destination)) { + copy($source, $destination); + } + } + public function uninstall() + { + if (!$this->runUninstallers()) { return false; } @@ -240,12 +293,26 @@ public function uninstall() $refundSettingsService->uninstall(); } } catch (\Exception $e) { - $this->_errors[] = 'Failed to uninstall buckaroo.refund.settings: ' . $e->getMessage(); + $this->_errors[] = 'Failed to uninstall buckaroo.refund.settings: ' . $e->getMessage(); } return parent::uninstall(); } + private function runUninstallers() + { + $databaseTableUninstaller = new DatabaseTableUninstaller(); + $databaseIdinColumnsRemover = new IdinColumnsRemover(); + $uninstall = new Uninstaller($this, $databaseTableUninstaller, $databaseIdinColumnsRemover); + + if (!$uninstall->uninstall()) { + $this->_errors[] = $uninstall->getErrors(); + return false; + } + + return true; + } + public function hookDisplayBackOfficeHeader() { if (Tools::getValue('controller') == 'AdminModules' && Tools::getValue('configure') == 'buckaroo3') { @@ -258,10 +325,8 @@ public function getContent() { $tokenManager = $this->get('security.csrf.token_manager'); $userProvider = $this->get('prestashop.user_provider'); + $token = $tokenManager->getToken($userProvider->getUsername())->getValue(); - $token = $tokenManager->getToken( - $userProvider->getUsername() - )->getValue(); $this->context->smarty->assign([ 'pathApp' => $this->_path . 'views/js/buckaroo.vue.js', 'baseUrl' => $this->context->shop->getBaseURL(true), @@ -299,8 +364,8 @@ public function hookPaymentOptions($params) $cookie = new Cookie('ps'); $cart = new Cart($params['cookie']->__get('id_cart')); $customer = new Customer($cart->id_customer); - $cookie_id_lang = (int) $cookie->id_lang; - $id_lang = $cookie_id_lang ? $cookie_id_lang : (int) (Configuration::get('PS_LANG_DEFAULT')); + $cookie_id_lang = (int)$cookie->id_lang; + $id_lang = $cookie_id_lang ? $cookie_id_lang : (int)(Configuration::get('PS_LANG_DEFAULT')); $addresses = $customer->getAddresses($id_lang); $company = ''; $vat = ''; @@ -384,6 +449,7 @@ public function hookPaymentOptions($params) 'methodsWithFinancialWarning' => $buckarooPaymentService->paymentMethodsWithFinancialWarning(), 'creditcardIssuers' => $buckarooConfigService->getActiveCreditCards(), 'creditCardDisplayMode' => $buckarooConfigService->getConfigValue('creditcard', 'display_type'), + 'giftCardDisplayMode' => $buckarooConfigService->getConfigValue('giftcard', 'display_in_checkout'), 'in3Method' => $this->get('buckaroo.classes.issuers.capayableIn3')->getMethod(), 'showIdealIssuers' => $buckarooConfigService->getConfigValue('ideal', 'show_issuers') ?? true, 'buckaroo_idin_test' => $buckarooConfigService->getConfigValue('idin', 'mode'), @@ -407,31 +473,26 @@ public function hookPaymentReturn($params) if (!$this->active) { return; } - if (Tools::getValue('response_received') - || (Tools::getValue('id_order') && Tools::getValue('success'))) { + if (Tools::getValue('response_received') || (Tools::getValue('id_order') && Tools::getValue('success'))) { $order = new Order(Tools::getValue('id_order')); $price = $this->formatPrice($order->getOrdersTotalPaid()); $isGuest = $this->context->customer->is_guest || !$this->context->customer->id; if (Tools::getValue('response_received') == 'transfer') { - $this->context->smarty->assign( - [ - 'is_guest' => $isGuest, - 'order' => $order, - 'price' => $price, - 'message' => $this->context->cookie->HtmlText, - ] - ); - - return $this->display(__FILE__, 'payment_return_redirectsuccess.tpl'); - } - $this->context->smarty->assign( - [ + $this->context->smarty->assign([ 'is_guest' => $isGuest, 'order' => $order, 'price' => $price, - ] - ); + 'message' => $this->context->cookie->HtmlText, + ]); + + return $this->display(__FILE__, 'payment_return_redirectsuccess.tpl'); + } + $this->context->smarty->assign([ + 'is_guest' => $isGuest, + 'order' => $order, + 'price' => $price, + ]); return $this->display(__FILE__, 'payment_return_success.tpl'); } @@ -444,6 +505,7 @@ public function hookDisplayHeader() Media::addJsDef([ 'buckarooAjaxUrl' => $this->context->link->getModuleLink('buckaroo3', 'ajax'), 'buckarooFees' => $this->getBuckarooFeeService()->getBuckarooFees(), + 'paymentFeeLabel' => Configuration::get('PAYMENT_FEE_FRONTEND_LABEL'), 'buckarooMessages' => [ 'validation' => [ 'date' => $this->l('Please enter correct birthdate date'), @@ -482,38 +544,55 @@ public static function resolveStatusCode($status_code, $id_order = null) private static function isOrderBackOrder($orderId) { + if (!Configuration::get('PS_STOCK_MANAGEMENT')) { + return false; // If stock management is disabled, no order is a backorder + } + $order = new Order($orderId); $orderDetails = $order->getOrderDetailList(); - /** @var OrderDetail $detail */ + foreach ($orderDetails as $detail) { $orderDetail = new OrderDetail($detail['id_order_detail']); - if ( - Configuration::get('PS_STOCK_MANAGEMENT') && - ($orderDetail->getStockState() || $orderDetail->product_quantity_in_stock < 0) - ) { + + // If any product is in stock, the order is not a backorder + if ($orderDetail->product_quantity_in_stock < 0) { return true; } } + // If all products are out of stock, the order is a backorder return false; } - public function getBuckarooFeeByCartId($id_cart) + public function getBuckarooFee($payment_method) { - $id_cart = (int) $id_cart; + $buckarooFee = $this->getBuckarooFeeService()->getBuckarooFeeValue($payment_method); - $sql = new DbQuery(); + if (!$buckarooFee) { + return null; + } - $sql->select('buckaroo_fee'); - $sql->from('buckaroo_fee'); - $sql->where('id_cart = ' . pSQL($id_cart)); + // Remove any whitespace from the fee. + $buckarooFee = trim($buckarooFee); - return Db::getInstance()->getValue($sql); + if (strpos($buckarooFee, '%') !== false) { + $buckarooFee = str_replace('%', '', $buckarooFee); + $buckarooFee = (float)$this->payment_request->amountDebit * ((float)$buckarooFee / 100); + } else { + $buckarooFee = (float)$buckarooFee; + } + + $taxRate = $this->context->cart->getAverageProductsTaxRate(); + $buckarooFeeTax = $buckarooFee * $taxRate; + $buckarooFeeTaxIncl = $buckarooFee + $buckarooFeeTax; + + return [ + 'buckaroo_fee_tax_excl' => $buckarooFee, + 'buckaroo_fee_tax' => $buckarooFeeTax, + 'buckaroo_fee_tax_incl' => $buckarooFeeTaxIncl, + ]; } - /** - * @throws LocalizationException - */ public function hookActionEmailSendBefore($params) { if (!isset($params['cart']->id)) { @@ -521,73 +600,83 @@ public function hookActionEmailSendBefore($params) } $cart = new Cart($params['cart']->id); - $order = Order::getByCartId($cart->id); - if (!$order || $order->module !== $this->name) { + $orderId = Order::getOrderByCartId($cart->id); + $order = new Order($orderId); + + if (!Validate::isLoadedObject($order) || $order->module !== $this->name) { return true; } - if ($params['template'] === 'order_conf' - || $params['template'] === 'account' - || $params['template'] === 'backoffice_order' - || $params['template'] === 'contact_form' - || $params['template'] === 'credit_slip' - || $params['template'] === 'in_transit' - || $params['template'] === 'order_changed' - || $params['template'] === 'order_merchant_comment' - || $params['template'] === 'order_return_state' - || $params['template'] === 'cheque' - || $params['template'] === 'payment' - || $params['template'] === 'preparation' - || $params['template'] === 'shipped' - || $params['template'] === 'order_canceled' - || $params['template'] === 'payment_error' - || $params['template'] === 'outofstock' - || $params['template'] === 'bankwire' - || $params['template'] === 'refund') { - $order = Order::getByCartId($cart->id); - if (!$order) { - return true; + if ($params['template'] == 'order_conf') { + $params['templatePath'] = _PS_MODULE_DIR_ . 'buckaroo3/mails/'; + } + + $templatesToModify = ['order_conf']; + if (in_array($params['template'], $templatesToModify)) { + $paymentMethodLabel = $order->payment; + $buckarooFeeService = $this->getBuckarooFeeService(); + $paymentMethodName = $buckarooFeeService->getPaymentMethodByLabel($paymentMethodLabel); + + $buckarooFee = $this->getBuckarooFee($paymentMethodName); + + // Ensure buckarooFee is an array + if (!is_array($buckarooFee)) { + $buckarooFee = [ + 'buckaroo_fee_tax_excl' => 0, + 'buckaroo_fee_tax' => 0, + 'buckaroo_fee_tax_incl' => 0, + ]; } - $buckarooFee = $this->getBuckarooFeeByCartId($cart->id); - if ($buckarooFee) { - $params['templateVars']['{buckaroo_fee}'] = $this->formatPrice($buckarooFee); + $buckarooFeeTaxExcl = $buckarooFee['buckaroo_fee_tax_excl']; + $buckarooFeeTaxIncl = $buckarooFee['buckaroo_fee_tax_incl']; + + $paymentFeeLabel = Configuration::get('PAYMENT_FEE_FRONTEND_LABEL'); + + $params['templateVars']['{payment_fee_label}'] = $paymentFeeLabel; + + if ($buckarooFeeTaxIncl > 0) { + $params['templateVars']['{payment_fee}'] = Tools::displayPrice($buckarooFeeTaxExcl); + $params['templateVars']['{payment_fee_tax}'] = Tools::displayPrice($buckarooFee['buckaroo_fee_tax']); + $params['templateVars']['{total_paid}'] = Tools::displayPrice($order->total_paid + $buckarooFeeTaxIncl); + // Include the total tax paid, which includes the payment fee tax + $totalTaxPaid = $order->total_paid_tax_incl - $order->total_paid_tax_excl + $buckarooFee['buckaroo_fee_tax']; + $params['templateVars']['{total_tax_paid}'] = Tools::displayPrice($totalTaxPaid); } else { - $params['templateVars']['{buckaroo_fee}'] = $this->formatPrice(0); + $params['templateVars']['{payment_fee}'] = Tools::displayPrice(0); } } + + return true; } - /** - * @throws SmartyException - * @throws LocalizationException - */ + public function hookDisplayPDFInvoice($params) { if ($params['object'] instanceof OrderInvoice) { $order = $params['object']->getOrder(); + $buckarooFeeData = (new RawBuckarooFeeRepository())->getFeeByOrderId($order->id); - $buckarooFee = $this->getBuckarooFeeByCartId(Cart::getCartIdByOrderId($order->id)); - - if (!$buckarooFee) { + if (!$buckarooFeeData) { return; } - $this->context->smarty->assign( - [ - 'order_buckaroo_fee' => $this->formatPrice($buckarooFee), - ] - ); + $buckarooFee = (float) $buckarooFeeData['buckaroo_fee_tax_excl']; + $taxData = $this->calculateTax($order, $buckarooFee); - return $this->context->smarty->fetch( - $this->getLocalPath() . 'views/templates/admin/invoice_fee.tpl' - ); + $this->context->smarty->assign([ + 'payment_fee_label' => Configuration::get('PAYMENT_FEE_FRONTEND_LABEL'), + 'order_buckaroo_fee' => $this->formatPrice($taxData['feeInclTax']), + 'order_buckaroo_fee_tax' => $this->formatPrice($taxData['taxAmount']), + ]); + + return $this->context->smarty->fetch($this->getLocalPath() . 'views/templates/admin/invoice_fee.tpl'); } } public function isPaymentModeActive($method) { - $isLive = (int) \Configuration::get(Config::BUCKAROO_TEST); + $isLive = (int)\Configuration::get(Config::BUCKAROO_TEST); $configArray = $this->getBuckarooConfigService()->getConfigArrayForMethod($method); if (!empty($configArray) && isset($configArray['mode'])) { @@ -688,7 +777,7 @@ public function hookActionProductFormBuilderModifier(array $params): void { /** @var ProductFormModifier $productFormModifier */ $productFormModifier = $this->get(ProductFormModifier::class); - $productId = (int) $params['id']; + $productId = (int)$params['id']; $productFormModifier->modify($productId, $params['form_builder']); } diff --git a/classes/CapayableIn3.php b/classes/CapayableIn3.php index f502adfe9..c6fedb9e9 100644 --- a/classes/CapayableIn3.php +++ b/classes/CapayableIn3.php @@ -24,7 +24,6 @@ class CapayableIn3 { protected $apiVersion; - protected $paymentLogo; public const VERSION_V2 = 'V2'; public const LOGO_IN3_IDEAL = 'in3_ideal'; public const LOGO_IN3_IDEAL_FILENAME = 'In3_ideal.svg?v1'; @@ -33,7 +32,6 @@ class CapayableIn3 public function __construct($buckarooConfigService) { $this->apiVersion = $buckarooConfigService->getConfigValue('in3', 'version'); - $this->paymentLogo = $buckarooConfigService->getConfigValue('in3', 'payment_logo'); } public function isV3(): bool @@ -46,12 +44,7 @@ public function getLogo(): string if (!$this->isV3()) { return self::LOGO_DEFAULT; } - - if ($this->paymentLogo === self::LOGO_IN3_IDEAL) { - return self::LOGO_IN3_IDEAL_FILENAME; - } - - return self::LOGO_DEFAULT; + return self::LOGO_IN3_IDEAL_FILENAME; } public function getMethod(): string diff --git a/config.xml b/config.xml index 47aafb5e6..d7560f49b 100644 --- a/config.xml +++ b/config.xml @@ -1,9 +1,9 @@ buckaroo3 - - - + + + diff --git a/config/routes.yml b/config/routes.yml index 6c7c89d56..09a255ef8 100644 --- a/config/routes.yml +++ b/config/routes.yml @@ -28,6 +28,30 @@ buckaroo_config_creditcards: options: expose: true +buckaroo_config_giftcards: + path: buckaroo3/config/giftcards + methods: [POST, GET] + defaults: + _controller: 'Buckaroo\PrestaShop\Controllers\admin\Giftcards::initContent' + options: + expose: true + +buckaroo_edit_giftcard: + path: buckaroo3/config/giftcards/edit + methods: [POST] + defaults: + _controller: 'Buckaroo\PrestaShop\Controllers\admin\Giftcards::editGiftCard' + options: + expose: true + +buckaroo_remove_giftcard: + path: buckaroo3/config/giftcards/remove + methods: [POST] + defaults: + _controller: 'Buckaroo\PrestaShop\Controllers\admin\Giftcards::removeGiftCard' + options: + expose: true + buckaroo_config_orderings: path: buckaroo3/config/orderings methods: [POST, GET] diff --git a/config/services.yml b/config/services.yml index a153098f1..4f69346a0 100644 --- a/config/services.yml +++ b/config/services.yml @@ -136,6 +136,12 @@ services: class: Buckaroo\PrestaShop\Controllers\admin\Creditcards public: true + Buckaroo\PrestaShop\Controllers\admin\Giftcards: + class: Buckaroo\PrestaShop\Controllers\admin\Giftcards + arguments: + - "@doctrine.orm.entity_manager" + public: true + Buckaroo\PrestaShop\Controllers\admin\Orderings: class: Buckaroo\PrestaShop\Controllers\admin\Orderings arguments: diff --git a/controllers/admin/Creditcards.php b/controllers/admin/Creditcards.php index e0b3fdb89..a73636232 100644 --- a/controllers/admin/Creditcards.php +++ b/controllers/admin/Creditcards.php @@ -38,11 +38,11 @@ public function __construct() */ public function initContent() { - $countries = $this->creditCardsRepository->getCreditCardsFromDB(); + $creditcards = $this->creditCardsRepository->getCreditCardsFromDB(); $data = [ 'status' => true, - 'creditcards' => $countries, + 'creditcards' => $creditcards, ]; return $this->sendResponse($data); diff --git a/controllers/admin/Giftcards.php b/controllers/admin/Giftcards.php new file mode 100644 index 000000000..d270a0765 --- /dev/null +++ b/controllers/admin/Giftcards.php @@ -0,0 +1,146 @@ + + * @copyright Copyright (c) Buckaroo B.V. + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +namespace Buckaroo\PrestaShop\Controllers\admin; + +use Buckaroo\PrestaShop\Src\Entity\BkGiftcards; +use Doctrine\ORM\EntityManager; + +if (!defined('_PS_VERSION_')) { + exit; +} + +class Giftcards extends BaseApiController +{ + private $bkGiftCardsRepository; + + public function __construct(EntityManager $entityManager) + { + parent::__construct(); + $this->bkGiftCardsRepository = $entityManager->getRepository(BkGiftcards::class); + } + + /** + * @throws \Exception + */ + public function initContent() + { + switch ($_SERVER['REQUEST_METHOD']) { + case 'GET': + return $this->handleGet(); + case 'POST': + return $this->handlePost(); + } + + } + + private function handleGet() + { + $giftcards = $this->bkGiftCardsRepository->getGiftCards(false); + $customGiftcards = $this->bkGiftCardsRepository->getGiftCards(true); + + $data = [ + 'status' => true, + 'giftcards' => $giftcards, + 'custom_giftcards' => $customGiftcards, + ]; + + return $this->sendResponse($data); + } + + private function handlePost() + { + $data = $this->getJsonInput(); + + $name = $this->getValueOrNull($data, 'name'); + $code = $this->getValueOrNull($data, 'service_code'); + $logo = $this->getValueOrNull($data, 'logo_url'); + + if (!($name || $code || $logo)) { + return $this->sendResponse([ + 'status' => false, + 'message' => 'Missing or invalid data', + ]); + } + + $result = $this->bkGiftCardsRepository->createGiftCard($name, $code, $logo); + $data = [ + 'status' => true, + 'custom_giftcard' => $result, + ]; + + return $this->sendResponse($data); + } + + public function editGiftCard() + { + $data = $this->getJsonInput(); + + $id = $this->getValueOrNull($data, 'id'); + $name = $this->getValueOrNull($data, 'name'); + $code = $this->getValueOrNull($data, 'service_code'); + $logo = $this->getValueOrNull($data, 'logo_url'); + + if (!($name || $code || $logo)) { + return $this->sendResponse([ + 'status' => false, + 'message' => 'Missing or invalid data', + ]); + } + + $result = $this->bkGiftCardsRepository->editGiftCard($id, $name, $code, $logo); + $data = [ + 'status' => true, + 'custom_giftcard' => $result, + ]; + + return $this->sendResponse($data); + } + + public function removeGiftCard() + { + $data = $this->getJsonInput(); + + $id = $this->getValueOrNull($data, 'id'); + + if (!$id) { + return $this->sendResponse([ + 'status' => false, + 'message' => 'Missing or invalid ID', + ]); + } + + $result = $this->bkGiftCardsRepository->removeGiftCard($id); + + if ($result === false) { + return $this->sendResponse([ + 'status' => false, + 'message' => "Failed to delete gift card with ID: $id", + ]); + } + + return $this->sendResponse([ + 'status' => true, + 'message' => "Gift card with ID: $id has been successfully deleted.", + ]); + } + + private function getValueOrNull(array $data, $key) + { + return isset($data[$key]) && !empty($data[$key]) ? $data[$key] : null; + } +} diff --git a/controllers/front/ajax.php b/controllers/front/ajax.php index 485f38e3f..36378784f 100644 --- a/controllers/front/ajax.php +++ b/controllers/front/ajax.php @@ -15,6 +15,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ +use Buckaroo\PrestaShop\Src\Config\Config; use PrestaShop\Decimal\DecimalNumber; use PrestaShop\PrestaShop\Core\Localization\Exception\LocalizationException; @@ -42,9 +43,7 @@ public function postProcess() */ private function renderCartSummary(Cart $cart, array $presentedCart = null) { - if (!$presentedCart) { - $presentedCart = $this->cart_presenter->present($cart); - } + $presentedCart = $presentedCart ?: $this->cart_presenter->present($cart); $this->context->smarty->assign([ 'configuration' => $this->getTemplateVarConfiguration(), @@ -54,36 +53,33 @@ private function renderCartSummary(Cart $cart, array $presentedCart = null) $responseArray = [ 'cart_summary_totals' => $this->render('checkout/_partials/cart-summary-totals'), + 'paymentFee' => $presentedCart['totals']['paymentFee'] ?? null, + 'paymentFeeTax' => $presentedCart['totals']['paymentFeeTax'] ?? null, + 'includedTaxes' => $presentedCart['totals']['includedTaxes'] ?? null, ]; - $paymentFee = $presentedCart['totals']['paymentFee'] ?? null; - if (isset($paymentFee)) { - $responseArray['paymentFee'] = $paymentFee; - } - $this->ajaxRender(json_encode($responseArray)); } /** * @throws PrestaShopException * @throws LocalizationException + * @throws Exception */ private function calculateTotalWithPaymentFee() { $cart = $this->context->cart; - $paymentFeeValue = Tools::getValue('paymentFee'); - $paymentFeeValue = trim($paymentFeeValue); + $paymentFeeValue = trim(Tools::getValue('paymentFee')); if (!$paymentFeeValue) { $this->renderCartSummary($cart); - return; } $paymentFee = $this->calculatePaymentFee($paymentFeeValue, $cart); $orderTotals = $this->calculateOrderTotals($cart, $paymentFee); - $this->updatePresentedCart($cart, $orderTotals, $paymentFee); + $this->updatePresentedCart($cart, $orderTotals); } private function calculatePaymentFee($paymentFeeValue, $cart): DecimalNumber @@ -92,26 +88,43 @@ private function calculatePaymentFee($paymentFeeValue, $cart): DecimalNumber if (strpos($paymentFeeValue, '%') !== false) { $paymentFeeValue = str_replace('%', '', $paymentFeeValue); - $paymentFeeValue = new DecimalNumber((string) $paymentFeeValue); - $percentage = $paymentFeeValue->dividedBy(new DecimalNumber('100')); - + $percentage = (new DecimalNumber((string) $paymentFeeValue))->dividedBy(new DecimalNumber('100')); return $orderTotal->times($percentage); - } elseif ($paymentFeeValue > 0) { - return new DecimalNumber((string) $paymentFeeValue); } - return new DecimalNumber('0'); + return new DecimalNumber($paymentFeeValue > 0 ? (string) $paymentFeeValue : '0'); } private function calculateOrderTotals($cart, $paymentFee): array { - $orderTotalWithFee = (new DecimalNumber((string) $cart->getOrderTotal()))->plus($paymentFee); - $orderTotalNoTaxWithFee = (new DecimalNumber((string) $cart->getOrderTotal(false)))->plus($paymentFee); + $paymentFeeValue = (float) $paymentFee->toPrecision(2); + $address = new Address($cart->id_address_invoice); + $taxManager = TaxManagerFactory::getManager($address, (int) Configuration::get('PS_TAX')); + $taxCalculator = $taxManager->getTaxCalculator(); + $taxRate = $taxCalculator->getTotalRate(); + $taxRateDecimal = $taxRate / 100; + + if (Configuration::get(Config::PAYMENT_FEE_MODE) === 'subtotal_incl_tax') { + $baseFee = $paymentFeeValue / (1 + $taxRateDecimal); + $taxFee = $paymentFeeValue - $baseFee; + $orderTotalWithFee = (new DecimalNumber((string) $cart->getOrderTotal(true, Cart::BOTH)))->plus(new DecimalNumber((string) $paymentFee)); + $orderTotalNoTaxWithFee = (new DecimalNumber((string) $cart->getOrderTotal(false, Cart::BOTH)))->plus(new DecimalNumber((string) $paymentFee)); + $paymentFeeTax = new DecimalNumber((string) $taxFee); + $paymentFee = new DecimalNumber((string) $baseFee); + } else { + $paymentFeeTaxAmount = $paymentFeeValue * $taxRateDecimal; + $totalFeePriceTaxIncl = $paymentFeeValue + $paymentFeeTaxAmount; + $paymentFeeTax = new DecimalNumber((string) $paymentFeeTaxAmount); + $orderTotalWithFee = (new DecimalNumber((string) $cart->getOrderTotal(true, Cart::BOTH)))->plus(new DecimalNumber((string) $totalFeePriceTaxIncl)); + $orderTotalNoTaxWithFee = (new DecimalNumber((string) $cart->getOrderTotal(false, Cart::BOTH)))->plus($paymentFee); + } - return [ - 'total_including_tax' => $orderTotalWithFee->toPrecision(2), - 'total_excluding_tax' => $orderTotalNoTaxWithFee->toPrecision(2), - ]; + return [ + 'total_including_tax' => $orderTotalWithFee->toPrecision(2), + 'total_excluding_tax' => $orderTotalNoTaxWithFee->toPrecision(2), + 'payment_fee' => $paymentFee->toPrecision(2), + 'payment_fee_tax' => $paymentFeeTax->toPrecision(2), + ]; } /** @@ -119,18 +132,30 @@ private function calculateOrderTotals($cart, $paymentFee): array * @throws LocalizationException * @throws Exception */ - private function updatePresentedCart($cart, $orderTotals, $paymentFee) + private function updatePresentedCart($cart, $orderTotals) { $taxConfiguration = new TaxConfiguration(); $presentedCart = $this->cart_presenter->present($cart); - $buckarooFee = $this->formatPrice($paymentFee->toPrecision(2)); - $presentedCart['totals'] = [ + $buckarooFee = $this->formatPrice($orderTotals['payment_fee']); + $paymentFeeTax = $this->formatPrice($orderTotals['payment_fee_tax']); + $totalWithoutTax = new DecimalNumber((string) $cart->getOrderTotal(false, Cart::BOTH)); + $totalWithTax = new DecimalNumber((string) $cart->getOrderTotal(true, Cart::BOTH)); + $includedTaxes = $totalWithTax->minus($totalWithoutTax)->plus(new DecimalNumber($orderTotals['payment_fee_tax']))->toPrecision(2); + + $presentedCart['totals'] = $this->getTotalsArray($orderTotals, $buckarooFee, $paymentFeeTax, $includedTaxes); + + $this->renderCartSummary($cart, $presentedCart); + } + + private function getTotalsArray($orderTotals, $buckarooFee, $paymentFeeTax, $includedTaxes): array + { + $totalsArray = [ 'total' => [ 'type' => 'total', 'label' => $this->translator->trans('Total', [], 'Shop.Theme.Checkout'), - 'amount' => $taxConfiguration->includeTaxes() ? $orderTotals['total_including_tax'] : $orderTotals['total_excluding_tax'], - 'value' => $this->formatPrice($taxConfiguration->includeTaxes() ? $orderTotals['total_including_tax'] : $orderTotals['total_excluding_tax']), + 'amount' => $orderTotals['total_including_tax'], + 'value' => $this->formatPrice($orderTotals['total_including_tax']), ], 'total_including_tax' => [ 'type' => 'total', @@ -145,9 +170,19 @@ private function updatePresentedCart($cart, $orderTotals, $paymentFee) 'value' => $this->formatPrice($orderTotals['total_excluding_tax']), ], 'paymentFee' => $buckarooFee, + 'paymentFeeTax' => $paymentFeeTax, ]; - $this->renderCartSummary($cart, $presentedCart); + if (Configuration::get(Config::PAYMENT_FEE_MODE) === 'subtotal') { + $totalsArray['includedTaxes'] = [ + 'type' => 'tax', + 'label' => $this->translator->trans('Included taxes', [], 'Shop.Theme.Checkout'), + 'amount' => $includedTaxes, + 'value' => $this->formatPrice($includedTaxes), + ]; + } + + return $totalsArray; } /** @@ -157,4 +192,4 @@ private function formatPrice($amount): string { return $this->context->getCurrentLocale()->formatPrice($amount, $this->context->currency->iso_code); } -} +} \ No newline at end of file diff --git a/controllers/front/common.php b/controllers/front/common.php index 94ca17ebc..8b3d2fd08 100644 --- a/controllers/front/common.php +++ b/controllers/front/common.php @@ -23,6 +23,10 @@ class BuckarooCommonController extends ModuleFrontController { + public function __construct() + { + parent::__construct(); + } private $id_order; protected function displayConfirmationTransfer($response) @@ -86,4 +90,12 @@ protected function displayError($invoicenumber = null, $error_message = null) $this->setTemplate('module:buckaroo3/views/templates/front/error.tpl'); } + + /** + * Method to initialize content, should be overridden in child classes + */ + public function initContent() + { + parent::initContent(); + } } diff --git a/controllers/front/request.php b/controllers/front/request.php index 1df3b9d79..2252fb5df 100644 --- a/controllers/front/request.php +++ b/controllers/front/request.php @@ -28,250 +28,347 @@ class Buckaroo3RequestModuleFrontController extends BuckarooCommonController { - /* @var $checkout Checkout */ public $checkout; public $display_column_left = false; - /** @var bool */ public $display_column_right = false; + protected $logger; + + public function __construct() + { + parent::__construct(); + $this->logger = new Logger(Logger::INFO, 'request'); + } - /** - * @throws Exception - * - * @see FrontController::postProcess() - */ public function postProcess() { - $logger = new \Logger(CoreLogger::INFO, ''); - $logger->logInfo("\n\n\n\n***************** Request start ***********************"); + $this->logger->logInfo("\n\n\n\n***************** Request start ***********************"); + + if (!$this->context || !$this->context->cart) { + $this->logger->logError('Context or cart is not properly initialized.'); + Tools::redirect('index.php?controller=order&step=1'); + return; + } $cart = $this->context->cart; - $logger->logDebug('Get cart', $cart->id); - if ($cart->id_customer == 0 - || $cart->id_address_delivery == 0 - || $cart->id_address_invoice == 0 - || !$this->module->active) { - $debug = 'Customer Id: ' . $cart->id_customer . "\nDelivery Address ID: " . - $cart->id_address_delivery . 'Invoice Address ID: ' . - $cart->id_address_invoice . "\nModule Active: " . $this->module->active; + if (!$this->isValidCart($cart)) { + $this->handleInvalidCart($cart); + return; + } + + if (!$this->isValidConfiguration()) { + return; + } + + if (!$this->isAuthorized()) { + return; + } + + $customer = new Customer($cart->id_customer); + if (!$this->isValidCustomer($customer)) { + return; + } - $logger->logError('Validation Error', $debug); + $currency = $this->context->currency; + if (!$currency) { + $this->logger->logError('Currency is not set in context.'); Tools::redirect('index.php?controller=order&step=1'); + return; + } + + $total = (float)$cart->getOrderTotal(true, Cart::BOTH); + $payment_method = Tools::getValue('method'); + + if (empty($payment_method)) { + $this->logger->logError('Load a method', 'Failed to load the method'); + Tools::redirect('index.php?controller=order&step=1'); + return; } + $total = $this->applyBuckarooFee($payment_method, $total); + + if (!$this->isValidService()) { + return; + } + + $debug = 'Currency: ' . $currency->name . "\nTotal Amount: " . $total . "\nPayment Method: " . $payment_method; + $this->logger->logInfo('Checkout info', $debug); + + $this->initializeCheckout($cart, $payment_method, $currency, $total, $customer); + + if ($this->checkout->isRequestSucceeded()) { + $this->handleSuccessfulRequest($cart->id, $customer); + } else { + $this->handleFailedRequest($cart->id); + } + } + + private function isValidCart($cart) + { + if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) { + return false; + } + + if (Order::getOrderByCartId($cart->id)) { + $oldCart = new Cart($cart->id); + $duplication = $oldCart->duplicate(); + if ($duplication && Validate::isLoadedObject($duplication['cart']) && $duplication['success']) { + $this->context->cookie->id_cart = $duplication['cart']->id; + $this->context->cart = $duplication['cart']; + $this->context->cookie->write(); + return true; + } else { + return false; + } + } + + return true; + } + + private function handleInvalidCart($cart) + { + $debug = 'Customer Id: ' . $cart->id_customer . "\nDelivery Address ID: " . $cart->id_address_delivery . 'Invoice Address ID: ' . $cart->id_address_invoice . "\nModule Active: " . $this->module->active; + $this->logger->logError('Validation Error', $debug); + Tools::redirect('index.php?controller=order&step=1'); + } + + private function isValidConfiguration() + { $merchantKey = Configuration::get('BUCKAROO_MERCHANT_KEY'); $secretKey = Configuration::get('BUCKAROO_SECRET_KEY'); if (empty($merchantKey) || empty($secretKey)) { - $error = $this->module->l( - 'Please contact merchant:

Buckaroo Plug-in is not properly configured.' - ); + $error = $this->module->l('Please contact merchant:

Buckaroo Plug-in is not properly configured.'); Tools::redirect('index.php?fc=module&module=buckaroo3&controller=error&error=' . $error); + return false; } + return true; + } - $authorized = false; - + private function isAuthorized() + { foreach (PaymentModule::getInstalledPaymentModules() as $module) { if ($module['name'] == 'buckaroo3') { - $authorized = true; - break; + return true; } } + $this->logger->logError('Authorization Error', 'This payment method is not available.'); + exit($this->module->l('This payment method is not available.', 'validation')); + } - if (!$authorized) { - $logger->logError('Authorization Error', 'This payment method is not available.'); - exit($this->module->l('This payment method is not available.', 'validation')); - } - - $customer = new Customer($cart->id_customer); + private function isValidCustomer($customer) + { if (!Validate::isLoadedObject($customer)) { - $logger->logError('Load a customer', 'Failed to load the customer with ID: ' . $cart->id_customer); + $this->logger->logError('Load a customer', 'Failed to load the customer with ID: ' . $customer->id); Tools::redirect('index.php?controller=order&step=1'); - exit; + return false; } + return true; + } - $currency = $this->context->currency; - $total = (float) $cart->getOrderTotal(true, Cart::BOTH); - $payment_method = Tools::getValue('method'); + private function applyBuckarooFee($payment_method, $total) + { + $buckarooFee = $this->module->getBuckarooFee($payment_method); - if (empty($payment_method)) { - $logger->logError('Load a method', 'Failed to load the method'); - Tools::redirect('index.php?controller=order&step=1'); - exit; + if (is_array($buckarooFee)) { + $buckarooFeeTaxIncl = $buckarooFee['buckaroo_fee_tax_incl']; + $total += $buckarooFeeTaxIncl; } - $buckarooFee = $this->module->getBuckarooFeeService()->getBuckarooFeeValue($payment_method); - if ($buckarooFee) { - $buckarooFee = trim($buckarooFee); - - if (strpos($buckarooFee, '%') !== false) { - // The fee includes a percentage sign, so treat it as a percentage. - // Remove the percentage sign and convert the remaining value to a float. - $buckarooFee = str_replace('%', '', $buckarooFee); - $total += ($total * ((float) $buckarooFee / 100)); - } elseif ($buckarooFee > 0) { - // The fee is a flat amount. - $total += (float) $buckarooFee; - } - } - if (Tools::getValue('service') - && Tools::getValue('service') != 'digi' - && Tools::getValue('service') != 'sepa') { - $logger->logError('Load a method', 'Failed to load the method'); + + return $total; + } + + private function isValidService() + { + if (Tools::getValue('service') && Tools::getValue('service') != 'digi' && Tools::getValue('service') != 'sepa') { + $this->logger->logError('Load a method', 'Failed to load the method'); Tools::redirect('index.php?controller=order&step=1'); - exit; + return false; } - $debug = 'Currency: ' . $currency->name . "\nTotal Amount: " . $total . "\nPayment Method: " . $payment_method; - $logger->logInfo('Checkout info', $debug); + return true; + } - try{ + private function initializeCheckout($cart, $payment_method, $currency, $total, $customer) + { + try { $this->checkout = Checkout::getInstance($payment_method, $cart, $this->context); - $this->checkout->platformName = 'PrestaShop'; - $this->checkout->platformVersion = _PS_VERSION_; - $this->checkout->moduleSupplier = $this->module->author; - $this->checkout->moduleName = $this->module->name; - $this->checkout->moduleVersion = $this->module->version; - $this->checkout->returnUrl = 'http' . ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '') . '://' . $_SERVER['SERVER_NAME'] . __PS_BASE_URI__ . 'index.php?fc=module&module=buckaroo3&controller=userreturn'; // phpcs:ignore - $this->checkout->pushUrl = 'http' . ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '') . '://' . $_SERVER['SERVER_NAME'] . __PS_BASE_URI__ . 'index.php?fc=module&module=buckaroo3&controller=return'; + $this->setCheckoutProperties(); + $this->setCheckoutUrls(); } catch (Exception $e) { - $logger->logError('Set checkout info: ', $e->getMessage()); + $this->logger->logError('Set checkout info: ', $e->getMessage()); $this->displayError(null, $e->getMessage()); - return; } - $logger->logDebug('Get checkout class: '); - $pending = Configuration::get('BUCKAROO_ORDER_STATE_DEFAULT'); + $pending = Configuration::get('BUCKAROO_ORDER_STATE_DEFAULT'); $payment_method_tr = (new RawPaymentMethodRepository())->getPaymentMethodsLabel($payment_method); - if (!$this->checkout->isVerifyRequired()) { - $this->module->validateOrder( - (int) $cart->id, - $pending, - (float) $total, - $payment_method_tr, - null, - null, - (int) $currency->id, - false, - $customer->secure_key - ); - } $id_order_cart = Order::getIdByCartId($cart->id); - $order = new Order($id_order_cart); + if (!$id_order_cart) { + if (!$this->checkout->isVerifyRequired()) { + try { + $this->module->validateOrder( + (int) $cart->id, + $pending, + (float) $total, + $payment_method_tr, + null, + null, + (int) $currency->id, + false, + $customer->secure_key + ); + } catch (Exception $e) { + $this->logger->logError('Order validation failed: ', $e->getMessage()); + $this->displayError(null, $e->getMessage()); + return; + } + } + } else { + $this->module->currentOrder = $id_order_cart; + } + + $order = new Order($this->module->currentOrder); $this->checkout->setReference($order->reference); - try { $this->checkout->setCheckout(); - $logger->logDebug('Set checkout info: '); if ($this->checkout->isVerifyRequired()) { - $logger->logInfo('Start verify process'); + $this->logger->logInfo('Start verify process'); $this->checkout->startVerify(['cid' => $cart->id_customer]); } else { - $logger->logInfo('Start the payment process'); + $this->logger->logInfo('Start the payment process'); $this->checkout->startPayment(); } } catch (Exception $e) { - $logger->logError('Set checkout info: ', $e->getMessage()); + $this->logger->logError('Set checkout info: ', $e->getMessage()); $this->displayError(null, $e->getMessage()); - return; } + } - if ($this->checkout->isRequestSucceeded()) { - $this->handleSuccessfulRequest($logger, $cart->id, $customer); - } else { - $this->handleFailedRequest($logger, $cart->id); - } + private function setCheckoutProperties() + { + $this->checkout->platformName = 'PrestaShop'; + $this->checkout->platformVersion = _PS_VERSION_; + $this->checkout->moduleSupplier = $this->module->author; + $this->checkout->moduleName = $this->module->name; + $this->checkout->moduleVersion = $this->module->version; } - private function handleSuccessfulRequest($logger, $cartId, $customer) + private function setCheckoutUrls() + { + $this->checkout->returnUrl = 'http' . ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '') . '://' . $_SERVER['SERVER_NAME'] . __PS_BASE_URI__ . 'index.php?fc=module&module=buckaroo3&controller=userreturn'; + $this->checkout->pushUrl = 'http' . ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '') . '://' . $_SERVER['SERVER_NAME'] . __PS_BASE_URI__ . 'index.php?fc=module&module=buckaroo3&controller=return'; + } + + private function handleSuccessfulRequest($cartId, $customer) { - /* @var $response Response */ $response = $this->checkout->getResponse(); - $logger->loginfo('Request succeeded'); + $this->logger->logInfo('Request succeeded'); if ($this->checkout->isRedirectRequired()) { $this->setCartCookie($cartId); - $logger->logInfo('Redirecting ... '); + $this->logger->logInfo('Redirecting ... '); $this->checkout->doRedirect(); exit; } - $logger->logDebug('Checkout response', $response); - if ($response->hasSucceeded()) { - $logger->logInfo('Payment request succeeded. Wait push message!'); - $id_order = $this->module->currentOrder; - - /* @var $responseData TransactionResponse */ - $responseData = $response->getResponse(); - $this->createTransactionMessage($id_order, 'Transaction Key: ' . $responseData->getTransactionKey()); - if ($response->payment_method == 'SepaDirectDebit') { - $parameters = $responseData->getServiceParameters(); - if (!empty($parameters['mandateReference'])) { - $this->createTransactionMessage($id_order, 'MandateReference: ' . $parameters['mandateReference']); - } - if (!empty($parameters['mandateDate'])) { - $this->createTransactionMessage($id_order, 'MandateDate: ' . $parameters['mandateDate']); - } - } - if ($response->payment_method == 'transfer') { - $this->context->cookie->__set('HtmlText', $response->consumerMessage['HtmlText']); - } - Tools::redirect( - 'index.php?controller=order-confirmation&id_cart=' . $cartId . '&id_module=' . $this->module->id . '&id_order=' . $id_order . '&key=' . $customer->secure_key . '&success=true&response_received=' . $response->payment_method// phpcs:ignore - ); + $this->processSuccessfulPayment($cartId, $customer, $response); } else { - $logger->logInfo('Payment request failed/canceled'); + $this->processFailedPayment($cartId, $response); + } + } - $this->setCartCookie($cartId); + private function processSuccessfulPayment($cartId, $customer, $response) + { + $this->logger->logInfo('Payment request succeeded. Wait push message!'); + $id_order = $this->module->currentOrder; - if ($response->isValid()) { - $logger->logInfo('Payment request valid'); - $id_order = Order::getOrderByCartId($response->getCartId()); - if ($id_order) { - $logger->logInfo('Find order by cart ID', 'Order found. ID: ' . $id_order); - $logger->logInfo( - 'Update order history with status: ' . Buckaroo3::resolveStatusCode($response->status) - ); - $order = new Order($id_order); - $new_status_code = Buckaroo3::resolveStatusCode($response->status); - $pending = Configuration::get('BUCKAROO_ORDER_STATE_DEFAULT'); - $canceled = Configuration::get('BUCKAROO_ORDER_STATE_FAILED'); - $error = Configuration::get('PS_OS_ERROR'); - if ($new_status_code != $order->getCurrentState() - && ($pending == $order->getCurrentState() - || $error == $order->getCurrentState() - || $canceled == $order->getCurrentState()) - ) { - $order_history = new OrderHistory(); - $order_history->id_order = $id_order; - $order_history->changeIdOrderState( - Buckaroo3::resolveStatusCode($response->status), - $id_order - ); - $order_history->add(true); - } - } else { - $logger->logInfo('Find order by cart ID', 'Order not found.'); - } - } else { - $logger->logInfo('Payment request not valid'); - } - $error = null; - if (($response->payment_method == 'afterpayacceptgiro' - || $response->payment_method == 'afterpaydigiaccept') - && $response->statusmessage) { - $error = $response->statusmessage; - } - $this->displayError(null, $error); + $responseData = $response->getResponse(); + $this->createTransactionMessage($id_order, 'Transaction Key: ' . $responseData->getTransactionKey()); + + if ($response->payment_method == 'SepaDirectDebit') { + $this->processSepaDirectDebit($id_order, $responseData); + } + + if ($response->payment_method == 'transfer') { + $this->context->cookie->__set('HtmlText', $response->consumerMessage['HtmlText']); + } + + Tools::redirect($this->context->link->getPageLink('order-confirmation', true, null, [ + 'id_cart' => $cartId, + 'id_module' => $this->module->id, + 'id_order' => $id_order, + 'key' => $customer->secure_key, + 'success' => 'true', + 'response_received' => $response->payment_method + ])); + } + + private function processSepaDirectDebit($id_order, $responseData) + { + $parameters = $responseData->getServiceParameters(); + if (!empty($parameters['mandateReference'])) { + $this->createTransactionMessage($id_order, 'MandateReference: ' . $parameters['mandateReference']); + } + if (!empty($parameters['mandateDate'])) { + $this->createTransactionMessage($id_order, 'MandateDate: ' . $parameters['mandateDate']); + } + } + + private function processFailedPayment($cartId, $response) + { + $this->logger->logInfo('Payment request failed/canceled'); + $this->setCartCookie($cartId); + + if ($response->isValid()) { + $this->updateOrderHistory($response); + } else { + $this->logger->logInfo('Payment request not valid'); + } + + $error = null; + if (($response->payment_method == 'afterpayacceptgiro' || $response->payment_method == 'afterpaydigiaccept') && $response->statusmessage) { + $error = $response->statusmessage; + } + $this->displayError(null, $error); + } + + private function updateOrderHistory($response) + { + $this->logger->logInfo('Payment request valid'); + $id_order = Order::getOrderByCartId($response->getCartId()); + if ($id_order) { + $this->updateOrderStatus($response, $id_order); + } else { + $this->logger->logInfo('Find order by cart ID', 'Order not found.'); } } - private function handleFailedRequest($logger, $cartId) + private function updateOrderStatus($response, $id_order) + { + $this->logger->logInfo('Find order by cart ID', 'Order found. ID: ' . $id_order); + $this->logger->logInfo('Update order history with status: ' . Buckaroo3::resolveStatusCode($response->status)); + + $order = new Order($id_order); + $new_status_code = Buckaroo3::resolveStatusCode($response->status); + $pending = Configuration::get('BUCKAROO_ORDER_STATE_DEFAULT'); + $canceled = Configuration::get('BUCKAROO_ORDER_STATE_FAILED'); + $error = Configuration::get('PS_OS_ERROR'); + + if ($new_status_code != $order->getCurrentState() && ($pending == $order->getCurrentState() || $error == $order->getCurrentState() || $canceled == $order->getCurrentState())) { + $order_history = new OrderHistory(); + $order_history->id_order = $id_order; + $order_history->changeIdOrderState(Buckaroo3::resolveStatusCode($response->status), $id_order); + $order_history->add(true); + } + } + + private function handleFailedRequest($cartId) { $response = $this->checkout->getResponse(); - $logger->logInfo('Request not succeeded'); + $this->logger->logInfo('Request not succeeded'); $this->setCartCookie($cartId); @@ -302,6 +399,8 @@ private function setCartCookie($cartId) if ($duplication && Validate::isLoadedObject($duplication['cart']) && $duplication['success']) { $this->context->cookie->id_cart = $duplication['cart']->id; $this->context->cookie->write(); + } else { + $this->logger->logError('Cart duplication failed'); } } -} +} \ No newline at end of file diff --git a/controllers/front/return.php b/controllers/front/return.php index 60a476624..516aff37d 100644 --- a/controllers/front/return.php +++ b/controllers/front/return.php @@ -14,6 +14,9 @@ * @copyright Copyright (c) Buckaroo B.V. * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ + +use Buckaroo\PrestaShop\Src\Repository\RawBuckarooFeeRepository; + include_once _PS_MODULE_DIR_ . 'buckaroo3/api/paymentmethods/responsefactory.php'; include_once _PS_MODULE_DIR_ . 'buckaroo3/library/logger.php'; include_once _PS_MODULE_DIR_ . 'buckaroo3/controllers/front/common.php'; @@ -25,13 +28,14 @@ class Buckaroo3ReturnModuleFrontController extends BuckarooCommonController { public $ssl = true; - private $symContainer; + protected $logger; public function __construct() { parent::__construct(); $this->setContainer(); + $this->logger = new Logger(Logger::INFO, 'return'); } /** @@ -41,8 +45,7 @@ public function initContent() { $this->display_column_left = false; $this->display_column_right = false; - $logger = new Logger(Logger::INFO, 'return'); - $logger->logInfo("\n\n\n\n***************** Return start ***********************"); + $this->logger->logInfo("\n\n\n\n***************** Return start ***********************"); parent::initContent(); @@ -51,11 +54,12 @@ public function initContent() foreach ($tmp as $stat) { $statuses[$stat['id_order_state']] = $stat['name']; } + $response = ResponseFactory::getResponse(); - $logger->logInfo('Parse response', $response); + $this->logger->logInfo('Parse response', $response); if ($response->isValid()) { - $logger->logInfo('Response valid'); + $this->logger->logInfo('Response valid'); if (!empty($response->payment_method) && ($response->payment_method == 'paypal') && !empty($response->statuscode) @@ -72,9 +76,11 @@ public function initContent() $row = get_object_vars($order); $references[] = $row['reference']; } - $logger->logInfo('Get order by cart id', 'Order ID: ' . $id_order); + + $this->logger->logInfo('Get order by cart id', 'Order ID: ' . $id_order); + if ($response->brq_relatedtransaction_partialpayment != null) { - $logger->logInfo('PUSH', 'Partial payment PUSH received ' . $response->status); + $this->logger->logInfo('PUSH', 'Partial payment PUSH received ' . $response->status); if ($id_order && $response->hasSucceeded()) { $order = new Order($id_order); $order->setInvoice(false); @@ -84,26 +90,19 @@ public function initContent() $payment->transaction_id = $response->transactions; $payment->amount = urldecode($response->amount); $payment->payment_method = $response->payment_method; - if ($payment->id_currency == $order->id_currency) { - $order->total_paid_real += $response->amount; - } else { - $order->total_paid_real += Tools::ps_round( - Tools::convertPrice($response->amount, $payment->id_currency, false), - 2 - ); - } + $order->total_paid_real += $response->amount; $order->save(); $payment->conversion_rate = 1; $payment->save(); Db::getInstance()->execute( ' - INSERT INTO `' . _DB_PREFIX_ . 'order_invoice_payment` - VALUES(' . (int) $order->invoice_number . ', ' . (int) $payment->id . ', ' . (int) $order->id . ')' + INSERT INTO `' . _DB_PREFIX_ . 'order_invoice_payment` + VALUES(' . (int)$order->invoice_number . ', ' . (int)$payment->id . ', ' . (int)$order->id . ')' ); $message = new Message(); $message->id_order = $id_order; - $message->message = 'Buckaroo partial payment message (' . $response->transactions . '): ' . $response->statusmessage; // phpcs:ignore + $message->message = 'Buckaroo partial payment message (' . $response->transactions . '): ' . $response->statusmessage; $message->add(); } exit; @@ -119,42 +118,43 @@ public function initContent() 'Buckaroo refund message (' . $response->transactions . '): ' . $response->statusmessage ); } catch (\Throwable $th) { - $logger->logInfo('PUSH', (string) $th); + $this->logger->logInfo('PUSH', (string)$th); } exit; } + if (!$id_order) { header('HTTP/1.1 503 Service Unavailable'); - echo 'Order do not exists'; - $logger->logInfo('PUSH', 'Order do not exists'); + echo 'Order does not exist'; + $this->logger->logError('PUSH', 'Order does not exist'); exit; } else { - $logger->logInfo('Update the order', 'Order ID: ' . $id_order); + $this->logger->logInfo('Update the order', 'Order ID: ' . $id_order); $new_status_code = Buckaroo3::resolveStatusCode($response->status, $id_order); - $order = new Order($id_order); if (!in_array($order->reference, $references)) { header('HTTP/1.1 503 Service Unavailable'); - $logger->logInfo('Order not in reference ' . $order->reference); + $this->logger->logError('Order not in reference ' . $order->reference); echo 'Order not in reference: ' . $order->reference; exit; } - $logger->logInfo( - 'Old order status code: ' . $order->getCurrentState( - ) . '; new order status code: ' . $new_status_code + $this->logger->logInfo( + 'Old order status code: ' . $order->getCurrentState() . '; new order status code: ' . $new_status_code ); + $pending = Configuration::get('BUCKAROO_ORDER_STATE_DEFAULT'); $canceled = Configuration::get('BUCKAROO_ORDER_STATE_FAILED'); $error = Configuration::get('PS_OS_ERROR'); $outofstock_unpaid = Configuration::get('PS_OS_OUTOFSTOCK_UNPAID'); + if ($new_status_code != $order->getCurrentState() - && ($pending == $order->getCurrentState() || $canceled == $order->getCurrentState( - ) || $error == $order->getCurrentState() || $outofstock_unpaid == $order->getCurrentState()) + && ($pending == $order->getCurrentState() || $canceled == $order->getCurrentState() + || $error == $order->getCurrentState() || $outofstock_unpaid == $order->getCurrentState()) ) { - $logger->logInfo('Update order status'); + $this->logger->logInfo('Update order status'); $history = new OrderHistory(); $history->id_order = $id_order; $history->date_add = date('Y-m-d H:i:s'); @@ -168,23 +168,25 @@ public function initContent() $payment->amount = 0; $payment->update(); } - /* @var $payment OrderPaymentCore */ if ($payment->amount == $response->amount && $payment->transaction_id == '') { $payment->transaction_id = $response->transactions; $payment->update(); } } } else { - $logger->logInfo('Order status not updated'); + $this->logger->logInfo('Order status not updated'); } + $statusCodeName = $new_status_code; if (!empty($statuses[$new_status_code])) { $statusCodeName = $statuses[$new_status_code]; } + $message = new Message(); $message->id_order = $id_order; - $message->message = 'Push message recieved. Buckaroo status: ' . $statusCodeName . '. Transaction key: ' . $response->transactions; // phpcs:ignore + $message->message = 'Push message received. Buckaroo status: ' . $statusCodeName . '. Transaction key: ' . $response->transactions; $message->add(); + if ($response->statusmessage) { $message = new Message(); $message->id_order = $id_order; @@ -194,17 +196,12 @@ public function initContent() } } else { header('HTTP/1.1 503 Service Unavailable'); - $logger->logError('Payment response not valid', $response); + $this->logger->logError('Payment response not valid', $response); echo 'Payment response not valid'; exit; } - $cartId = (int) $response->getCartId(); - $sql = new DbQuery(); - $sql->select('buckaroo_fee'); - $sql->from('buckaroo_fee'); - $sql->where('id_cart = ' . pSQL($cartId)); - $buckarooFee = Db::getInstance()->getValue($sql); + $buckarooFee = (new RawBuckarooFeeRepository())->getFeeByOrderId($order->id); if ($buckarooFee && (isset($payment) && $payment->payment_method != 'Group transaction')) { $jj = 0; @@ -235,4 +232,4 @@ private function setContainer() } $this->symContainer = $kernel->getContainer(); } -} +} \ No newline at end of file diff --git a/controllers/front/userreturn.php b/controllers/front/userreturn.php index 535d98506..e25ebd905 100644 --- a/controllers/front/userreturn.php +++ b/controllers/front/userreturn.php @@ -25,6 +25,13 @@ class Buckaroo3UserreturnModuleFrontController extends BuckarooCommonController { public $ssl = true; + protected $logger; + + public function __construct() + { + parent::__construct(); + $this->logger = new Logger(Logger::INFO, 'userreturn'); + } /** * @see FrontController::initContent() @@ -32,12 +39,12 @@ class Buckaroo3UserreturnModuleFrontController extends BuckarooCommonController public function initContent() { $cookie = new Cookie('ps'); - $logger = new Logger(Logger::INFO, 'return'); + $this->logger->logInfo("\n\n\n\n***************** User return start ***********************"); $response = ResponseFactory::getResponse(); - $logger->logDebug('Checkout response', $response); + if ($response->isValid()) { - $logger->logInfo('Payment request succeeded'); + $this->logger->logInfo('Payment request succeeded'); if (!empty($response->payment_method) && ($response->payment_method == 'paypal') @@ -49,12 +56,14 @@ public function initContent() } $id_order = Order::getOrderByCartId($response->getCartId()); - $logger->logInfo('Update the order', 'Order ID: ' . $id_order); + $this->logger->logInfo('Update the order', 'Order ID: ' . $id_order); + if ($response->hasSucceeded()) { $cart = new Cart($response->getCartId()); $customer = new Customer($cart->id_customer); + if (!Validate::isLoadedObject($customer)) { - $logger->logError('Load a customer', 'Failed to load the customer with ID: ' . $cart->id_customer); + $this->logger->logError('Load a customer', 'Failed to load the customer with ID: ' . $cart->id_customer); Tools::redirect('index.php?controller=order&step=1'); exit; } @@ -67,19 +76,22 @@ public function initContent() 'key' => $customer->secure_key, 'success' => 'true', ]); + $this->logger->logInfo('Redirecting to order confirmation', ['url' => $redirectUrl]); Tools::redirect($redirectUrl); } else { $cookie->statusMessage = ''; if (($response->payment_method == 'afterpayacceptgiro' - || $response->payment_method == 'afterpaydigiaccept') + || $response->payment_method == 'afterpaydigiaccept') && $response->statusmessage) { $cookie->statusMessage = $response->statusmessage; } + $this->logger->logError('Payment failed', ['statusMessage' => $cookie->statusMessage]); Tools::redirect('index.php?fc=module&module=buckaroo3&controller=error'); exit; } } else { $cookie->statusMessage = 'Not valid response'; + $this->logger->logError('Invalid payment response'); Tools::redirect('index.php?fc=module&module=buckaroo3&controller=error'); } exit; diff --git a/dev/lang/php_de.json b/dev/lang/php_de.json index fc241decb..3c609ab9a 100644 --- a/dev/lang/php_de.json +++ b/dev/lang/php_de.json @@ -1,235 +1,6 @@ { "buckaroo.response.an_error_occurred_while_processing_the_transaction_unable_to_pay_more_with_giftcards": "Bei der Verarbeitung der Transaktion ist ein Fehler aufgetreten: Es kann nicht mehr mit Geschenkkarten bezahlt werden", "buckaroo.response.invalid_parameter_originaltransaction": "Ungültiger Parameter Originaltransaktion.", - "countries.afghanistan": "Afghanistan", - "countries.albania": "Albanien", - "countries.algeria": "Algerien", - "countries.american_samoa": "Amerikanischen Samoa-Inseln", - "countries.andorra": "Andorra", - "countries.angola": "Angola", - "countries.anguilla": "Anguilla", - "countries.antigua_and_barbuda": "Antigua und Barbuda", - "countries.argentina": "Argentinien", - "countries.armenia": "Armenien", - "countries.aruba": "Aruba", - "countries.australia": "Australien", - "countries.austria": "Österreich", - "countries.azerbaijan": "Aserbaidschan", - "countries.bahamas": "Bahamas", - "countries.bahrain": "Bahrain", - "countries.bangladesh": "Bangladesch", - "countries.barbados": "Barbados", - "countries.belarus": "Weißrussland", - "countries.belgium": "Belgien", - "countries.belize": "Belize", - "countries.benin": "Benin", - "countries.bermuda": "Bermuda", - "countries.bhutan": "Bhutan", - "countries.bolivia": "Bolivien", - "countries.bosnia_and_herzegovina": "Bosnien und Herzegowina", - "countries.botswana": "Botswana", - "countries.brazil": "Brasilien", - "countries.british_virgin_islands": "Die Britischen Jungferninseln", - "countries.brunei_darussalam": "Brunei Darussalam", - "countries.bulgaria": "Bulgarien", - "countries.burkina_faso": "Burkina Faso", - "countries.burundi": "Burundi", - "countries.cambodia": "Kambodscha", - "countries.cameroon": "Kamerun", - "countries.canada": "Kanada", - "countries.cape_verde": "Kap Verde", - "countries.cayman_islands": "Cayman Inseln", - "countries.central_african_republic": "Zentralafrikanische Republik", - "countries.chad": "Tschad", - "countries.chile": "Chile", - "countries.china": "China", - "countries.colombia": "Kolumbien", - "countries.comoros": "Komoren", - "countries.cook_islands": "Insel", - "countries.costa_rica": "Costa Rica", - "countries.croatia": "Kroatien", - "countries.cuba": "Kuba", - "countries.curaçao": "Curacao", - "countries.cyprus": "Zypern", - "countries.czech_republic": "Tschechien", - "countries.côte_d'ivoire": "Côte Divoire", - "countries.democratic_republic_of_the_congo": "Demokratische Republik Kongo", - "countries.denmark": "Dänemark", - "countries.djibouti": "Dschibuti", - "countries.dominica": "Dominica", - "countries.dominican_republic": "Dominikanische Republik", - "countries.east timor": "Osttimor", - "countries.ecuador": "Ecuador", - "countries.egypt": "Ägypten", - "countries.el_salvador": "El Salvador", - "countries.equatorial_guinea": "Äquatorialguinea", - "countries.eritrea": "Eritrea", - "countries.estonia": "Estland", - "countries.ethiopia": "Äthiopien", - "countries.falkland_island": "Falklandinsel", - "countries.faroe_islands": "Färöer Inseln", - "countries.fiji": "Fidschi", - "countries.finland": "Finnland", - "countries.france": "Frankreich", - "countries.french_polynesia": "Französisch Polynesien", - "countries.gabon": "Gabun", - "countries.gambia": "Gambia", - "countries.georgia": "Georgia", - "countries.germany": "Deutschland", - "countries.ghana": "Ghana", - "countries.gibraltar": "Gibraltar", - "countries.greece": "Griechenland", - "countries.greenland": "Grönland", - "countries.grenada": "Grenada", - "countries.guam": "Guam", - "countries.guatemala": "Guatemala", - "countries.guernsey": "Guernsey", - "countries.guinea": "Guinea", - "countries.guinea-bissau": "Guinea-Bissau", - "countries.guyana": "Guyana", - "countries.haiti": "Haiti", - "countries.honduras": "Honduras", - "countries.hong_kong": "Hongkong", - "countries.hungary": "Ungarn", - "countries.iceland": "Island", - "countries.india": "Indien", - "countries.indonesia": "Indonesien", - "countries.iran": "Iran", - "countries.iraq": "Irak", - "countries.ireland": "Irland", - "countries.isle_of_man": "Isle of Man", - "countries.israel": "Israel", - "countries.italy": "Italien", - "countries.jamaica": "Jamaika", - "countries.japan": "Japan", - "countries.jersey": "Jersey", - "countries.jordan": "Jordanien", - "countries.kazakhstan": "Kasachstan", - "countries.kenya": "Kenia", - "countries.kiribati": "Kiribati", - "countries.kosovo": "Kosovo", - "countries.kuwait": "Kuwait", - "countries.kyrgyzstan": "Kirgisistan", - "countries.laos": "Laos", - "countries.latvia": "Lettland", - "countries.lebanon": "Libanon", - "countries.lesotho": "Lesotho", - "countries.liberia": "Liberia", - "countries.libya": "Libyen", - "countries.liechtenstein": "Liechtenstein", - "countries.lithuania": "Litauen", - "countries.luxembourg": "Luxemburg", - "countries.macau": "Macau", - "countries.macedonia": "Mazedonien", - "countries.madagascar": "Madagaskar", - "countries.malawi": "Malawi", - "countries.malaysia": "Malaysia", - "countries.maldives": "Malediven", - "countries.mali": "Mali", - "countries.malta": "Malta", - "countries.marshall_islands": "Marshallinseln", - "countries.mauritania": "Mauretanien", - "countries.mauritius": "Mauritius", - "countries.mayotte": "Mayotte", - "countries.mexico": "Mexiko", - "countries.micronesia": "Mikronesien", - "countries.moldova": "Moldawien", - "countries.monaco": "Monaco", - "countries.mongolia": "Mongolei", - "countries.montenegro": "Montenegro", - "countries.montserrat": "Montserrat", - "countries.morocco": "Marokko", - "countries.mozambique": "Mosambik", - "countries.myanmar": "Myanmar", - "countries.namibia": "Namibia", - "countries.nauru": "Nauru", - "countries.nepal": "Nepal", - "countries.netherlands": "Niederlande", - "countries.new_caledonia": "Neu-Kaledonien", - "countries.new_zealand": "Neuseeland", - "countries.nicaragua": "Nicaragua", - "countries.niger": "Niger", - "countries.nigeria": "Nigeria", - "countries.niue": "Niue", - "countries.norfolk_island": "Norfolkinsel", - "countries.north_korea": "Nord Korea", - "countries.northern_mariana_islands": "Nördliche Marianneninseln", - "countries.norway": "Norwegen", - "countries.oman": "Oman", - "countries.pakistan": "Pakistan", - "countries.palau": "Palau", - "countries.palestine": "Palästina", - "countries.panama": "Panama", - "countries.papua_new_guinea": "Papua Neu-Guinea", - "countries.paraguay": "Paraguay", - "countries.peru": "Peru", - "countries.philippines": "Philippinen", - "countries.pitcairn": "Pitekaien", - "countries.poland": "Polen", - "countries.portugal": "Portugal", - "countries.puerto_rico": "Puerto Rico", - "countries.qatar": "Katar", - "countries.republic_of_the_congo": "Demokratische Republik Kongo", - "countries.romania": "Rumänien", - "countries.russia": "Russland", - "countries.rwanda": "Ruanda", - "countries.saint_helena": "St. Helena", - "countries.saint_kitts_and_nevis": "St. Kitts und Nevis", - "countries.saint_lucia": "St. Lucia", - "countries.saint_vincent_and_the_grenadines": "St. Vincent und die Grenadinen", - "countries.samoa": "Samoa", - "countries.san_marino": "San Marino", - "countries.sao_tome_and_principe": "São Tomé und Príncipe", - "countries.saudi_arabia": "Saudi-Arabien", - "countries.senegal": "Senegal", - "countries.serbia": "Serbien", - "countries.seychelles": "Seychellen", - "countries.sierra_leone": "Sierra Leone", - "countries.singapore": "Singapur", - "countries.slovakia": "Slowakei", - "countries.slovenia": "Slowenien", - "countries.solomon_islands": "Salomon-Inseln", - "countries.somalia": "Somalia", - "countries.south_africa": "Südafrika", - "countries.south_korea": "Südkorea", - "countries.south_sudan": "Südsudan", - "countries.spain": "Spanien", - "countries.sri_lanka": "Sri Lanka", - "countries.sudan": "Sudan", - "countries.suriname": "Surinam", - "countries.swaziland": "Swasiland", - "countries.sweden": "Schweden", - "countries.switzerland": "Schweiz", - "countries.syrian_arab_republic": "Syrische Arabische Republik", - "countries.taiwan": "Taiwan", - "countries.tajikistan": "Tadschikistan", - "countries.tanzania": "Tansania", - "countries.thailand": "Thailand", - "countries.togo": "Gehen", - "countries.tokelau": "Tokelau", - "countries.tonga": "Tonga", - "countries.trinidad_and_tobago": "Trinidad und Tobago", - "countries.tunisia": "Tunesien", - "countries.turkey": "Truthahn", - "countries.turkmenistan": "Turkmenistan", - "countries.turks_and_caicos_islands": "Turks- und Caicosinseln", - "countries.tuvalu": "Tuvalu", - "countries.uganda": "Uganda", - "countries.ukraine": "Ukraine", - "countries.united kingdom": "Großbritannien", - "countries.united states": "Vereinigte Staaten", - "countries.united_arab_emirates": "Vereinigte Arabische Emirate", - "countries.uruguay": "Uruguay", - "countries.us_virgin_islands": "US Jungferninseln", - "countries.uzbekistan": "Usbekistan", - "countries.vanuatu": "Vanuatu", - "countries.venezuela": "Venezuela", - "countries.vietnam": "Vietnam", - "countries.wallis_and_futuna": "Wallis und Futuna", - "countries.western_sahara": "Westsahara", - "countries.yemen": "Jemen", - "countries.zambia": "Sambia", - "countries.zimbabwe": "Zimbabwe", "dashboard.channel_selector.select_channel": "Wählen Sie Kanal", "dashboard.channel_selector.select_channel_label": "Jeder Kanal hat seine Konfigurationseinstellungen.", "dashboard.config.financial_warning": "Finanzwarnung für Kunden", @@ -302,7 +73,6 @@ "dashboard.pages.payments.in3.version.label": "In3-Version", "dashboard.pages.payments.in3.version.v2": "V2 (Capayable/In3)", "dashboard.pages.payments.in3.version.v3": "V3 (iDEAL In3)", - "dashboard.pages.payments.logo": "Zahlungslogo", "dashboard.pages.payments.max_order_amount_b2c": "Maximaler B2B-Bestellbetrag", "dashboard.pages.payments.maximum_order_amount": "Maximaler Bestellwert", "dashboard.pages.payments.min_order_amount_b2b": "Mindestbestellwert für B2B", @@ -372,7 +142,14 @@ "dashboard.pages.settings.refunds_label": "Rückerstattungsbeschreibung", "dashboard.pages.settings.refunds_label_explanation": "Diese Beschreibung wird für die Rückerstattungen verwendet und ist in Buckaroo und auf dem Kontoauszug des Verbrauchers sichtbar. ", "dashboard.pages.settings.refunds_label_label": "Wenn diese Option aktiviert ist, können Sie (teilweise) Rückerstattungen direkt in Ihrem PrestaShop-Administrationsbereich vornehmen Mehr lesen", - "dashboard.pages.settings.remove": "Entfernen", + "dashboard.pages.settings.payment_fee": "Zahlungsgebühren", + "dashboard.pages.settings.payment_fee_description": "Hier können Sie verschiedene Optionen für Zahlungskosten konfigurieren, einschließlich der Einstellung des Prozentsatzes und der Anpassung des Namens der Kosten.", + "dashboard.pages.settings.payment_fee_percentage_mode": "Gebührenprozentsatzmodus", + "dashboard.pages.settings.payment_fee_percentage_mode_description": "Diese Einstellung gilt nur für prozentbasierte Buckaroo-Gebühren.
Bitte wählen Sie, über welchen Betrag der Gebührenprozentsatz berechnet wird.", + "dashboard.pages.settings.subtotal": "Zwischensumme", + "dashboard.pages.settings.subtotal_incl_tax": "Zwischensumme inkl. MwSt.", + "dashboard.pages.settings.payment_fee_frontend_label": "Frontend-Label für Zahlungsgebühr", + "dashboard.pages.settings.payment_fee_frontend_label_description": "Dieses Label wird neben der Gebühr auf den Checkout-, Bestell-, Rechnungs- und Gutschriftenseiten sowie in PDFs angezeigt.","dashboard.pages.settings.remove": "Entfernen", "dashboard.pages.settings.return_url": "Rückgabe-URL", "dashboard.pages.settings.return_url_explanation": "Wenn dieses Feld leer bleibt, kehrt der Kunde zur Standard-Bestätigungsseite von PrestaShop zurück.", "dashboard.pages.settings.return_url_label": "Legen Sie eine benutzerdefinierte Rückgabe-URL fest, nachdem der Kunde die Zahlung abgeschlossen hat.", @@ -423,7 +200,6 @@ "payment_methods.przelewy24": "Przelewy24", "payment_methods.sepadirectdebit": "SEPA-Lastschrift", "payment_methods.sofortueberweisung": "Sofort", - "payment_methods.tinka": "Tinka", "payment_methods.transfer": "Überweisen", "payment_methods.trustly": "Vertrauenswürdig", "payment_methods.wechatpay": "WeChatPay", diff --git a/dev/lang/php_en.json b/dev/lang/php_en.json index 9d015476c..01bc73ea1 100644 --- a/dev/lang/php_en.json +++ b/dev/lang/php_en.json @@ -1,235 +1,6 @@ { "buckaroo.response.an_error_occurred_while_processing_the_transaction_unable_to_pay_more_with_giftcards": "An error occurred while processing the transaction: Unable to pay more with giftcards", "buckaroo.response.invalid_parameter_originaltransaction": "Invalid parameter originaltransaction.", - "countries.afghanistan": "Afghanistan", - "countries.albania": "Albania", - "countries.algeria": "Algeria", - "countries.american_samoa": "American Samoa", - "countries.andorra": "Andorra", - "countries.angola": "Angola", - "countries.anguilla": "Anguilla", - "countries.antigua_and_barbuda": "Antigua and Barbuda", - "countries.argentina": "Argentina", - "countries.armenia": "Armenia", - "countries.aruba": "Aruba", - "countries.australia": "Australia", - "countries.austria": "Austria", - "countries.azerbaijan": "Azerbaijan", - "countries.bahamas": "Bahamas", - "countries.bahrain": "Bahrain", - "countries.bangladesh": "Bangladesh", - "countries.barbados": "Barbados", - "countries.belarus": "Belarus", - "countries.belgium": "Belgium", - "countries.belize": "Belize", - "countries.benin": "Benin", - "countries.bermuda": "Bermuda", - "countries.bhutan": "Bhutan", - "countries.bolivia": "Bolivia", - "countries.bosnia_and_herzegovina": "Bosnia and Herzegovina", - "countries.botswana": "Botswana", - "countries.brazil": "Brazil", - "countries.british_virgin_islands": "The British Virgin Islands", - "countries.brunei_darussalam": "Brunei Darussalam", - "countries.bulgaria": "Bulgaria", - "countries.burkina_faso": "Burkina Faso", - "countries.burundi": "Burundi", - "countries.cambodia": "Cambodia", - "countries.cameroon": "Cameroon", - "countries.canada": "Canada", - "countries.cape_verde": "Cape Verde", - "countries.cayman_islands": "Cayman Islands", - "countries.central_african_republic": "Central African Republic", - "countries.chad": "Chad", - "countries.chile": "Chile", - "countries.china": "China", - "countries.colombia": "Colombia", - "countries.comoros": "Comoros", - "countries.cook_islands": "Island", - "countries.costa_rica": "Costa Rica", - "countries.croatia": "Croatia", - "countries.cuba": "Cuba", - "countries.curaçao": "Curacao", - "countries.cyprus": "Cyprus", - "countries.czech_republic": "Czech Republic", - "countries.côte_d'ivoire": "Cote Divoire", - "countries.democratic_republic_of_the_congo": "Democratic Republic of the Congo", - "countries.denmark": "Denmark", - "countries.djibouti": "Djibouti", - "countries.dominica": "Dominica", - "countries.dominican_republic": "Dominican Republic", - "countries.east timor": "East Timor", - "countries.ecuador": "Ecuador", - "countries.egypt": "Egypt", - "countries.el_salvador": "El Salvador", - "countries.equatorial_guinea": "Equatorial Guinea", - "countries.eritrea": "Eritrea", - "countries.estonia": "Estonia", - "countries.ethiopia": "Ethiopia", - "countries.falkland_island": "Falkland Island", - "countries.faroe_islands": "Faroe Islands", - "countries.fiji": "Fiji", - "countries.finland": "Finland", - "countries.france": "France", - "countries.french_polynesia": "French Polynesia", - "countries.gabon": "Gabon", - "countries.gambia": "Gambia", - "countries.georgia": "Georgia", - "countries.germany": "Germany", - "countries.ghana": "Ghana", - "countries.gibraltar": "Gibraltar", - "countries.greece": "Greece", - "countries.greenland": "Greenland", - "countries.grenada": "Grenada", - "countries.guam": "Guam", - "countries.guatemala": "Guatemala", - "countries.guernsey": "Guernsey", - "countries.guinea": "Guinea", - "countries.guinea-bissau": "Guinea-Bissau", - "countries.guyana": "Guyana", - "countries.haiti": "Haiti", - "countries.honduras": "Honduras", - "countries.hong_kong": "Hong Kong", - "countries.hungary": "Hungary", - "countries.iceland": "Iceland", - "countries.india": "India", - "countries.indonesia": "Indonesia", - "countries.iran": "Iran", - "countries.iraq": "Iraq", - "countries.ireland": "Ireland", - "countries.isle_of_man": "Isle of Man", - "countries.israel": "Israel", - "countries.italy": "Italy", - "countries.jamaica": "Jamaica", - "countries.japan": "Japan", - "countries.jersey": "Jersey", - "countries.jordan": "Jordan", - "countries.kazakhstan": "Kazakhstan", - "countries.kenya": "Kenya", - "countries.kiribati": "Kiribati", - "countries.kosovo": "Kosovo", - "countries.kuwait": "Kuwait", - "countries.kyrgyzstan": "Kyrgyzstan", - "countries.laos": "Laos", - "countries.latvia": "Latvia", - "countries.lebanon": "Lebanon", - "countries.lesotho": "Lesotho", - "countries.liberia": "Liberia", - "countries.libya": "Libya", - "countries.liechtenstein": "Liechtenstein", - "countries.lithuania": "Lithuania", - "countries.luxembourg": "Luxembourg", - "countries.macau": "Macao", - "countries.macedonia": "Macedonia", - "countries.madagascar": "Madagascar", - "countries.malawi": "Malawi", - "countries.malaysia": "Malaysia", - "countries.maldives": "Maldives", - "countries.mali": "Mali", - "countries.malta": "Malta", - "countries.marshall_islands": "Marshall Islands", - "countries.mauritania": "Mauritania", - "countries.mauritius": "Mauritius", - "countries.mayotte": "Mayotte", - "countries.mexico": "Mexico", - "countries.micronesia": "Micronesia", - "countries.moldova": "Moldova", - "countries.monaco": "Monaco", - "countries.mongolia": "Mongolia", - "countries.montenegro": "Montenegro", - "countries.montserrat": "Montserrat", - "countries.morocco": "Morocco", - "countries.mozambique": "Mozambique", - "countries.myanmar": "Myanmar", - "countries.namibia": "Namibia", - "countries.nauru": "Nauru", - "countries.nepal": "Nepal", - "countries.netherlands": "Netherlands", - "countries.new_caledonia": "New Caledonia", - "countries.new_zealand": "New Zealand", - "countries.nicaragua": "Nicaragua", - "countries.niger": "Niger", - "countries.nigeria": "Nigeria", - "countries.niue": "Niue", - "countries.norfolk_island": "Norfolk Island", - "countries.north_korea": "North Korea", - "countries.northern_mariana_islands": "Northern Mariana Islands", - "countries.norway": "Norway", - "countries.oman": "Oman", - "countries.pakistan": "Pakistan", - "countries.palau": "Palau", - "countries.palestine": "Palestine", - "countries.panama": "Panama", - "countries.papua_new_guinea": "Papua New Guinea", - "countries.paraguay": "Paraguay", - "countries.peru": "Peru", - "countries.philippines": "Philippines", - "countries.pitcairn": "Pitekaien", - "countries.poland": "Poland", - "countries.portugal": "Portugal", - "countries.puerto_rico": "Puerto Rico", - "countries.qatar": "Qatar", - "countries.republic_of_the_congo": "Democratic Republic of the Congo", - "countries.romania": "Romania", - "countries.russia": "Russia", - "countries.rwanda": "Rwanda", - "countries.saint_helena": "St. Helena", - "countries.saint_kitts_and_nevis": "Saint Kitts and Nevis", - "countries.saint_lucia": "Saint Lucia", - "countries.saint_vincent_and_the_grenadines": "Saint Vincent and the Grenadines", - "countries.samoa": "Samoa", - "countries.san_marino": "San Marino", - "countries.sao_tome_and_principe": "Sao Tome and Principe", - "countries.saudi_arabia": "Saudi Arabia", - "countries.senegal": "Senegal", - "countries.serbia": "Serbia", - "countries.seychelles": "Seychelles", - "countries.sierra_leone": "Sierra Leone", - "countries.singapore": "Singapore", - "countries.slovakia": "Slovakia", - "countries.slovenia": "Slovenia", - "countries.solomon_islands": "Solomon Islands", - "countries.somalia": "Somalia", - "countries.south_africa": "South Africa", - "countries.south_korea": "South Korea", - "countries.south_sudan": "South Sudan", - "countries.spain": "Spain", - "countries.sri_lanka": "Sri Lanka", - "countries.sudan": "Sudan", - "countries.suriname": "Surinam", - "countries.swaziland": "Swaziland", - "countries.sweden": "Sweden", - "countries.switzerland": "Switzerland", - "countries.syrian_arab_republic": "Syrian Arab Republic", - "countries.taiwan": "Taiwan", - "countries.tajikistan": "Tajikistan", - "countries.tanzania": "Tanzania", - "countries.thailand": "Thailand", - "countries.togo": "Togo", - "countries.tokelau": "Tokelau", - "countries.tonga": "Tonga", - "countries.trinidad_and_tobago": "Trinidad and Tobago", - "countries.tunisia": "Tunisia", - "countries.turkey": "Turkey", - "countries.turkmenistan": "Turkmenistan", - "countries.turks_and_caicos_islands": "Turks and Caicos Islands", - "countries.tuvalu": "Tuvalu", - "countries.uganda": "Uganda", - "countries.ukraine": "Ukraine", - "countries.united kingdom": "United Kingdom", - "countries.united states": "United States", - "countries.united_arab_emirates": "United Arab Emirates", - "countries.uruguay": "Uruguay", - "countries.us_virgin_islands": "US Virgin Islands", - "countries.uzbekistan": "Uzbekistan", - "countries.vanuatu": "Vanuatu", - "countries.venezuela": "Venezuela", - "countries.vietnam": "Vietnam", - "countries.wallis_and_futuna": "Wallis and Futuna", - "countries.western_sahara": "Western Sahara", - "countries.yemen": "Yemen", - "countries.zambia": "Zambia", - "countries.zimbabwe": "Zimbabwe", "dashboard.channel_selector.select_channel": "Select Channel", "dashboard.channel_selector.select_channel_label": "Each channel has its configuration settings.", "dashboard.config.financial_warning": "Customer Financial Warning", @@ -302,7 +73,6 @@ "dashboard.pages.payments.in3.version.label": "In3 version", "dashboard.pages.payments.in3.version.v2": "V2 (Capayable/In3)", "dashboard.pages.payments.in3.version.v3": "V3 (iDEAL In3)", - "dashboard.pages.payments.logo": "Payment logo", "dashboard.pages.payments.max_order_amount_b2c": "Maximum B2B order amount", "dashboard.pages.payments.maximum_order_amount": "Maximum order amount", "dashboard.pages.payments.min_order_amount_b2b": "Minimum B2B order amount", @@ -372,6 +142,14 @@ "dashboard.pages.settings.refunds_label": "Refund Description", "dashboard.pages.settings.refunds_label_explanation": "This description is used for the refunds and will be visible in Buckaroo and on the bank statement of the consumer. We recommend using the webshop name so customers can easily recognize the payment.", "dashboard.pages.settings.refunds_label_label": "When enabled you can do (partial) refunds directly from your PrestaShop admin area Read more", + "dashboard.pages.settings.payment_fee": "Payment Fees", + "dashboard.pages.settings.payment_fee_description": "Here, you can configure various payment fee options, including setting the fee percentage and customizing the fee name for example.", + "dashboard.pages.settings.payment_fee_percentage_mode": "Fee percentage mode", + "dashboard.pages.settings.payment_fee_percentage_mode_description": "This setting only applies to percentage-based Buckaroo fees.
Please choose over which amount the fee percentage is calculated.", + "dashboard.pages.settings.subtotal": "Subtotal", + "dashboard.pages.settings.subtotal_incl_tax": "Subtotal incl. tax", + "dashboard.pages.settings.payment_fee_frontend_label": "Payment fee frontend label", + "dashboard.pages.settings.payment_fee_frontend_label_description": "This label will be displayed next to the fee on the checkout, order, invoice and creditmemo pages and pdfs.", "dashboard.pages.settings.remove": "Remove", "dashboard.pages.settings.return_url": "Return URL", "dashboard.pages.settings.return_url_explanation": "When this field is left empty, the customer will return to the default PrestaShop confirmation page.", @@ -423,7 +201,6 @@ "payment_methods.przelewy24": "Przelewy24", "payment_methods.sepadirectdebit": "SEPA Direct Debit", "payment_methods.sofortueberweisung": "Sofort", - "payment_methods.tinka": "Tinka", "payment_methods.transfer": "Transfer", "payment_methods.trustly": "Trustly", "payment_methods.wechatpay": "WeChatPay", diff --git a/dev/lang/php_fr.json b/dev/lang/php_fr.json index c9e0fd418..b0c6bb546 100644 --- a/dev/lang/php_fr.json +++ b/dev/lang/php_fr.json @@ -1,235 +1,6 @@ { "buckaroo.response.an_error_occurred_while_processing_the_transaction_unable_to_pay_more_with_giftcards": "Une erreur s'est produite lors du traitement de la transaction : impossible de payer davantage avec des cartes cadeaux", "buckaroo.response.invalid_parameter_originaltransaction": "Paramètre originaltransaction non valide.", - "countries.afghanistan": "Afghanistan", - "countries.albania": "Albanie", - "countries.algeria": "Algérie", - "countries.american_samoa": "Samoa américaines", - "countries.andorra": "Andorre", - "countries.angola": "Angola", - "countries.anguilla": "Anguilla", - "countries.antigua_and_barbuda": "Antigua-et-Barbuda", - "countries.argentina": "Argentine", - "countries.armenia": "Arménie", - "countries.aruba": "Aruba", - "countries.australia": "Australie", - "countries.austria": "L'Autriche", - "countries.azerbaijan": "Azerbaïdjan", - "countries.bahamas": "Bahamas", - "countries.bahrain": "Bahreïn", - "countries.bangladesh": "Bangladesh", - "countries.barbados": "Barbade", - "countries.belarus": "Biélorussie", - "countries.belgium": "Belgique", - "countries.belize": "Bélize", - "countries.benin": "Bénin", - "countries.bermuda": "Bermudes", - "countries.bhutan": "Bhoutan", - "countries.bolivia": "Bolivie", - "countries.bosnia_and_herzegovina": "Bosnie Herzégovine", - "countries.botswana": "Botswana", - "countries.brazil": "Brésil", - "countries.british_virgin_islands": "Les îles Vierges britanniques", - "countries.brunei_darussalam": "Brunei Darussalam", - "countries.bulgaria": "Bulgarie", - "countries.burkina_faso": "Burkina Faso", - "countries.burundi": "Burundi", - "countries.cambodia": "Cambodge", - "countries.cameroon": "Cameroun", - "countries.canada": "Canada", - "countries.cape_verde": "Cap-Vert", - "countries.cayman_islands": "Îles Caïmans", - "countries.central_african_republic": "République centrafricaine", - "countries.chad": "Tchad", - "countries.chile": "Chili", - "countries.china": "Chine", - "countries.colombia": "Colombie", - "countries.comoros": "Comores", - "countries.cook_islands": "Île", - "countries.costa_rica": "Costa Rica", - "countries.croatia": "Croatie", - "countries.cuba": "Cuba", - "countries.curaçao": "Curacao", - "countries.cyprus": "Chypre", - "countries.czech_republic": "République tchèque", - "countries.côte_d'ivoire": "Côte D'Ivoire", - "countries.democratic_republic_of_the_congo": "République Démocratique du Congo", - "countries.denmark": "Danemark", - "countries.djibouti": "Djibouti", - "countries.dominica": "Dominique", - "countries.dominican_republic": "République dominicaine", - "countries.east timor": "Timor oriental", - "countries.ecuador": "Équateur", - "countries.egypt": "Egypte", - "countries.el_salvador": "Le Salvador", - "countries.equatorial_guinea": "Guinée Équatoriale", - "countries.eritrea": "Érythrée", - "countries.estonia": "Estonie", - "countries.ethiopia": "Ethiopie", - "countries.falkland_island": "Île Falkland", - "countries.faroe_islands": "Îles Féroé", - "countries.fiji": "Fidji", - "countries.finland": "Finlande", - "countries.france": "France", - "countries.french_polynesia": "Polynésie française", - "countries.gabon": "Gabon", - "countries.gambia": "Gambie", - "countries.georgia": "Géorgie", - "countries.germany": "Allemagne", - "countries.ghana": "Ghana", - "countries.gibraltar": "Gibraltar", - "countries.greece": "Grèce", - "countries.greenland": "Groenland", - "countries.grenada": "Grenade", - "countries.guam": "Guam", - "countries.guatemala": "Guatemala", - "countries.guernsey": "Guernesey", - "countries.guinea": "Guinée", - "countries.guinea-bissau": "Guinée-Bissau", - "countries.guyana": "Guyane", - "countries.haiti": "Haïti", - "countries.honduras": "Honduras", - "countries.hong_kong": "Hong Kong", - "countries.hungary": "Hongrie", - "countries.iceland": "Islande", - "countries.india": "Inde", - "countries.indonesia": "Indonésie", - "countries.iran": "L'Iran", - "countries.iraq": "Irak", - "countries.ireland": "Irlande", - "countries.isle_of_man": "île de Man", - "countries.israel": "Israël", - "countries.italy": "Italie", - "countries.jamaica": "Jamaïque", - "countries.japan": "Japon", - "countries.jersey": "Jersey", - "countries.jordan": "Jordan", - "countries.kazakhstan": "Kazakhstan", - "countries.kenya": "Kenya", - "countries.kiribati": "Kiribati", - "countries.kosovo": "Kosovo", - "countries.kuwait": "Koweit", - "countries.kyrgyzstan": "Kirghizistan", - "countries.laos": "Laos", - "countries.latvia": "Lettonie", - "countries.lebanon": "Liban", - "countries.lesotho": "Lesotho", - "countries.liberia": "Libéria", - "countries.libya": "Libye", - "countries.liechtenstein": "Liechtenstein", - "countries.lithuania": "Lituanie", - "countries.luxembourg": "Luxembourg", - "countries.macau": "Macao", - "countries.macedonia": "Macédoine", - "countries.madagascar": "Madagascar", - "countries.malawi": "Malawi", - "countries.malaysia": "Malaisie", - "countries.maldives": "Maldives", - "countries.mali": "Mali", - "countries.malta": "Malte", - "countries.marshall_islands": "Iles Marshall", - "countries.mauritania": "Mauritanie", - "countries.mauritius": "Maurice", - "countries.mayotte": "Mayotte", - "countries.mexico": "Mexique", - "countries.micronesia": "Micronésie", - "countries.moldova": "Moldavie", - "countries.monaco": "Monaco", - "countries.mongolia": "Mongolie", - "countries.montenegro": "Monténégro", - "countries.montserrat": "Montserrat", - "countries.morocco": "Maroc", - "countries.mozambique": "Mozambique", - "countries.myanmar": "Birmanie", - "countries.namibia": "Namibie", - "countries.nauru": "Nauru", - "countries.nepal": "Népal", - "countries.netherlands": "Pays-Bas", - "countries.new_caledonia": "Nouvelle Calédonie", - "countries.new_zealand": "Nouvelle-Zélande", - "countries.nicaragua": "Nicaragua", - "countries.niger": "Niger", - "countries.nigeria": "Nigeria", - "countries.niue": "Nioué", - "countries.norfolk_island": "l'ile de Norfolk", - "countries.north_korea": "Corée du Nord", - "countries.northern_mariana_islands": "Îles Mariannes du Nord", - "countries.norway": "Norvège", - "countries.oman": "Oman", - "countries.pakistan": "Pakistan", - "countries.palau": "Palaos", - "countries.palestine": "Palestine", - "countries.panama": "Panama", - "countries.papua_new_guinea": "Papouasie Nouvelle Guinée", - "countries.paraguay": "Paraguay", - "countries.peru": "Pérou", - "countries.philippines": "Philippines", - "countries.pitcairn": "Pitekaien", - "countries.poland": "Pologne", - "countries.portugal": "le Portugal", - "countries.puerto_rico": "Porto Rico", - "countries.qatar": "Qatar", - "countries.republic_of_the_congo": "République Démocratique du Congo", - "countries.romania": "Roumanie", - "countries.russia": "Russie", - "countries.rwanda": "Rwanda", - "countries.saint_helena": "Sainte-Hélène", - "countries.saint_kitts_and_nevis": "Saint-Christophe-et-Niévès", - "countries.saint_lucia": "Sainte-Lucie", - "countries.saint_vincent_and_the_grenadines": "Saint-Vincent-et-les-Grenadines", - "countries.samoa": "Samoa", - "countries.san_marino": "Saint Marin", - "countries.sao_tome_and_principe": "Sao Tomé et Principe", - "countries.saudi_arabia": "Arabie Saoudite", - "countries.senegal": "Sénégal", - "countries.serbia": "Serbie", - "countries.seychelles": "les Seychelles", - "countries.sierra_leone": "Sierra Leone", - "countries.singapore": "Singapour", - "countries.slovakia": "Slovaquie", - "countries.slovenia": "Slovénie", - "countries.solomon_islands": "Les îles Salomon", - "countries.somalia": "Somalie", - "countries.south_africa": "Afrique du Sud", - "countries.south_korea": "Corée du Sud", - "countries.south_sudan": "Soudan du sud", - "countries.spain": "Espagne", - "countries.sri_lanka": "Sri Lanka", - "countries.sudan": "Soudan", - "countries.suriname": "Suriname", - "countries.swaziland": "Swaziland", - "countries.sweden": "Suède", - "countries.switzerland": "Suisse", - "countries.syrian_arab_republic": "République arabe syrienne", - "countries.taiwan": "Taïwan", - "countries.tajikistan": "Tadjikistan", - "countries.tanzania": "Tanzanie", - "countries.thailand": "Thaïlande", - "countries.togo": "Aller", - "countries.tokelau": "Tokélaou", - "countries.tonga": "Tonga", - "countries.trinidad_and_tobago": "Trinité-et-Tobago", - "countries.tunisia": "Tunisie", - "countries.turkey": "Turquie", - "countries.turkmenistan": "Turkménistan", - "countries.turks_and_caicos_islands": "îles Turques-et-Caïques", - "countries.tuvalu": "Tuvalu", - "countries.uganda": "Ouganda", - "countries.ukraine": "Ukraine", - "countries.united kingdom": "Royaume-Uni", - "countries.united states": "États-Unis", - "countries.united_arab_emirates": "Emirats Arabes Unis", - "countries.uruguay": "Uruguay", - "countries.us_virgin_islands": "Îles Vierges américaines", - "countries.uzbekistan": "Ouzbékistan", - "countries.vanuatu": "Vanuatu", - "countries.venezuela": "Venezuela", - "countries.vietnam": "Viêt Nam", - "countries.wallis_and_futuna": "Wallis et Futuna", - "countries.western_sahara": "Sahara occidental", - "countries.yemen": "Yémen", - "countries.zambia": "Zambie", - "countries.zimbabwe": "Zimbabwe", "dashboard.channel_selector.select_channel": "Sélectionnez la chaîne", "dashboard.channel_selector.select_channel_label": "Chaque canal a ses paramètres de configuration.", "dashboard.config.financial_warning": "Avertissement financier client", @@ -302,7 +73,6 @@ "dashboard.pages.payments.in3.version.label": "Version In3", "dashboard.pages.payments.in3.version.v2": "V2 (capacité/In3)", "dashboard.pages.payments.in3.version.v3": "V3 (iDEAL In3)", - "dashboard.pages.payments.logo": "Logo de paiement", "dashboard.pages.payments.max_order_amount_b2c": "Montant maximum de la commande B2B", "dashboard.pages.payments.maximum_order_amount": "Montant maximum de la commande", "dashboard.pages.payments.min_order_amount_b2b": "Montant minimum de la commande B2B", @@ -372,7 +142,14 @@ "dashboard.pages.settings.refunds_label": "Description du remboursement", "dashboard.pages.settings.refunds_label_explanation": "Cette description sert aux remboursements et sera visible dans Buckaroo et sur le relevé bancaire du consommateur. ", "dashboard.pages.settings.refunds_label_label": "Lorsqu'il est activé, vous pouvez effectuer des remboursements (partiels) directement depuis votre zone d'administration PrestaShop En savoir plus", - "dashboard.pages.settings.remove": "Retirer", + "dashboard.pages.settings.payment_fee": "Frais de paiement", + "dashboard.pages.settings.payment_fee_description": "Ici, vous pouvez configurer diverses options de frais de paiement, y compris définir le pourcentage des frais et personnaliser le nom des frais.", + "dashboard.pages.settings.payment_fee_percentage_mode": "Mode de pourcentage des frais", + "dashboard.pages.settings.payment_fee_percentage_mode_description": "Ce paramètre s'applique uniquement aux frais Buckaroo basés sur un pourcentage.
Veuillez choisir sur quel montant le pourcentage des frais est calculé.", + "dashboard.pages.settings.subtotal": "Sous-total", + "dashboard.pages.settings.subtotal_incl_tax": "Sous-total incl. taxes", + "dashboard.pages.settings.payment_fee_frontend_label": "Libellé des frais de paiement en frontend", + "dashboard.pages.settings.payment_fee_frontend_label_description": "Ce libellé sera affiché à côté des frais sur les pages de paiement, de commande, de facture et d'avoir ainsi que sur les PDF.","dashboard.pages.settings.remove": "Retirer", "dashboard.pages.settings.return_url": "URL de retour", "dashboard.pages.settings.return_url_explanation": "Lorsque ce champ est laissé vide, le client reviendra à la page de confirmation par défaut de PrestaShop.", "dashboard.pages.settings.return_url_label": "Définissez une URL de retour personnalisée une fois que le client a terminé le paiement.", @@ -423,7 +200,6 @@ "payment_methods.przelewy24": "Przelewy24", "payment_methods.sepadirectdebit": "Prélèvement SEPA", "payment_methods.sofortueberweisung": "Sofort", - "payment_methods.tinka": "Tinka", "payment_methods.transfer": "Transfert", "payment_methods.trustly": "En toute confiance", "payment_methods.wechatpay": "WeChatPay", diff --git a/dev/lang/php_nl.json b/dev/lang/php_nl.json index 3e37e8f16..88fd4ef48 100644 --- a/dev/lang/php_nl.json +++ b/dev/lang/php_nl.json @@ -1,237 +1,6 @@ { "buckaroo.response.an_error_occurred_while_processing_the_transaction_unable_to_pay_more_with_giftcards": "Er is een fout opgetreden tijdens het verwerken van de transactie: Je kunt niet meer cadeaukaarten gebruiken", "buckaroo.response.invalid_parameter_originaltransaction": "Ongeldige parameter originaltransaction.", - "countries.afghanistan": "Afghanistan", - "countries.albania": "Albanië", - "countries.algeria": "Algerije", - "countries.american_samoa": "Amerikaans Samoa", - "countries.andorra": "Andorra", - "countries.angola": "Angola", - "countries.anguilla": "Anguilla", - "countries.antigua_and_barbuda": "Antigua en Barbuda", - "countries.argentina": "Argentinië", - "countries.armenia": "Armenië", - "countries.aruba": "Aruba", - "countries.australia": "Australië", - "countries.austria": "Oostenrijk", - "countries.azerbaijan": "Azerbeidzjan", - "countries.bahamas": "Bahamas", - "countries.bahrain": "Bahrein", - "countries.bangladesh": "Bangladesh", - "countries.barbados": "Barbados", - "countries.belarus": "Wit-Rusland", - "countries.belgium": "België", - "countries.belize": "Belize", - "countries.benin": "Benin", - "countries.bermuda": "Bermuda", - "countries.bhutan": "Bhutan", - "countries.bolivia": "Bolivia", - "countries.bosnia_and_herzegovina": "Bosnië en Herzegovina", - "countries.botswana": "Botswana", - "countries.brazil": "Brazilië", - "countries.british_virgin_islands": "Britse Maagdeneilanden", - "countries.brunei_darussalam": "Brunei Darussalam", - "countries.bulgaria": "Bulgarije", - "countries.burkina_faso": "Burkina Faso", - "countries.burundi": "Burundi", - "countries.cambodia": "Cambodja", - "countries.cameroon": "Kameroen", - "countries.canada": "Canada", - "countries.cape_verde": "Kaapverdië", - "countries.cayman_islands": "Kaaimaneilanden", - "countries.central_african_republic": "Centraal-Afrikaanse Republiek", - "countries.chad": "Tsjaad", - "countries.chile": "Chili", - "countries.china": "China", - "countries.colombia": "Colombia", - "countries.comoros": "Comoren", - "countries.cook_islands": "Cookeilanden", - "countries.costa_rica": "Costa Rica", - "countries.croatia": "Kroatië", - "countries.cuba": "Cuba", - "countries.curaçao": "Curaçao", - "countries.cyprus": "Cyprus", - "countries.czech_republic": "Tsjechische Republiek", - "countries.côte_d'ivoire": "Ivoorkust", - "countries.democratic_republic_of_the_congo": "Democratische Republiek Congo", - "countries.denmark": "Denemarken", - "countries.djibouti": "Djibouti", - "countries.dominica": "Dominica", - "countries.dominican_republic": "Dominicaanse Republiek", - "countries.east timor": "East Timor", - "countries.ecuador": "Ecuador", - "countries.egypt": "Egypte", - "countries.el_salvador": "El Salvador", - "countries.equatorial_guinea": "Equatoriaal-Guinea", - "countries.eritrea": "Eritrea", - "countries.estonia": "Estland", - "countries.ethiopia": "Ethiopië", - "countries.falkland_island": "Falklandeiland", - "countries.faroe_islands": "Faeröer Eilanden", - "countries.fiji": "Fiji", - "countries.finland": "Finland", - "countries.france": "Frankrijk", - "countries.french_polynesia": "Frans-Polynesië", - "countries.gabon": "Gabon", - "countries.gambia": "Gambia", - "countries.georgia": "Georgië", - "countries.germany": "Duitsland", - "countries.ghana": "Ghana", - "countries.gibraltar": "Gibraltar", - "countries.greece": "Griekenland", - "countries.greenland": "Groenland", - "countries.grenada": "Grenada", - "countries.guam": "Guam", - "countries.guatemala": "Guatemala", - "countries.guernsey": "Guernsey", - "countries.guinea": "Guinee", - "countries.guinea-bissau": "Guinee-Bissau", - "countries.guyana": "Guyana", - "countries.haiti": "Haïti", - "countries.honduras": "Honduras", - "countries.hong_kong": "Hongkong", - "countries.hungary": "Hongarije", - "countries.iceland": "IJsland", - "countries.india": "India", - "countries.indonesia": "Indonesië", - "countries.iran": "Iran", - "countries.iraq": "Irak", - "countries.ireland": "Ierland", - "countries.isle_of_man": "Man", - "countries.israel": "Israël", - "countries.italy": "Italië", - "countries.jamaica": "Jamaica", - "countries.japan": "Japan", - "countries.jersey": "Jersey", - "countries.jordan": "Jordanië", - "countries.kazakhstan": "Kazachstan", - "countries.kenya": "Kenia", - "countries.kiribati": "Kiribati", - "countries.kosovo": "Kosovo", - "countries.kuwait": "Koeweit", - "countries.kyrgyzstan": "Kirgizië", - "countries.laos": "Laos", - "countries.latvia": "Letland", - "countries.lebanon": "Libanon", - "countries.lesotho": "Lesotho", - "countries.liberia": "Liberia", - "countries.libya": "Libië", - "countries.liechtenstein": "Liechtenstein", - "countries.lithuania": "Litouwen", - "countries.luxembourg": "Luxemburg", - "countries.macau": "Macau", - "countries.macedonia": "Macedonië", - "countries.madagascar": "Madagaskar", - "countries.malawi": "Malawi", - "countries.malaysia": "Maleisië", - "countries.maldives": "Maldiven", - "countries.mali": "Mali", - "countries.malta": "Malta", - "countries.marshall_islands": "Marshalleilanden", - "countries.mauritania": "Mauritanië", - "countries.mauritius": "Mauritius", - "countries.mayotte": "Mayotte", - "countries.mexico": "Mexico", - "countries.micronesia": "Micronesië", - "countries.moldova": "Moldavië", - "countries.monaco": "Monaco", - "countries.mongolia": "Mongolië", - "countries.montenegro": "Montenegro", - "countries.montserrat": "Montserrat", - "countries.morocco": "Marokko", - "countries.mozambique": "Mozambique", - "countries.myanmar": "Myanmar", - "countries.namibia": "Namibië", - "countries.nauru": "Nauru", - "countries.nepal": "Nepal", - "countries.netherlands": "Nederland", - "countries.new_caledonia": "Nieuw-Caledonië", - "countries.new_zealand": "Nieuw-Zeeland", - "countries.nicaragua": "Nicaragua", - "countries.niger": "Niger", - "countries.nigeria": "Nigeria", - "countries.niue": "Niue", - "countries.norfolk_island": "Norfolkeiland", - "countries.north_korea": "Noord-Korea", - "countries.northern_mariana_islands": "Noordelijke Marianen", - "countries.norway": "Noorwegen", - "countries.oman": "Oman", - "countries.pakistan": "Pakistan", - "countries.palau": "Palau", - "countries.palestine": "Palestina", - "countries.panama": "Panama", - "countries.papua_new_guinea": "Papoea-Nieuw-Guinea", - "countries.paraguay": "Paraguay", - "countries.peru": "Peru", - "countries.philippines": "Filipijnen", - "countries.pitcairn": "Pitcairn", - "countries.poland": "Polen", - "countries.portugal": "Portugal", - "countries.puerto_rico": "Puerto Rico", - "countries.qatar": "Qatar", - "countries.republic_of_the_congo": "Republiek Congo", - "countries.romania": "Roemenië", - "countries.russia": "Rusland", - "countries.rwanda": "Rwanda", - "countries.saint_helena": "Sint-Helena", - "countries.saint_kitts_and_nevis": "Saint Kitts en Nevis", - "countries.saint_lucia": "Saint Lucia", - "countries.saint_vincent_and_the_grenadines": "Saint Vincent en de Grenadines", - "countries.samoa": "Samoa", - "countries.san_marino": "San Marino", - "countries.saudi_arabia": "Saoedi-Arabië", - "countries.senegal": "Senegal", - "countries.serbia": "Servië", - "countries.seychelles": "Seychellen", - "countries.sierra_leone": "Sierra Leone", - "countries.singapore": "Singapore", - "countries.sint_maarten": "Sint-Maarten", - "countries.slovakia": "Slowakije", - "countries.slovenia": "Slovenië", - "countries.solomon_islands": "Salomonseilanden", - "countries.somalia": "Somalië", - "countries.south_africa": "Zuid-Afrika", - "countries.south_korea": "Zuid-Korea", - "countries.south_sudan": "Zuid-Soedan", - "countries.spain": "Spanje", - "countries.sri_lanka": "Sri Lanka", - "countries.sudan": "Soedan", - "countries.suriname": "Suriname", - "countries.swaziland": "Swaziland", - "countries.sweden": "Zweden", - "countries.switzerland": "Zwitserland", - "countries.syria": "Syrië", - "countries.são_tomé_and_príncipe": "Sao Tomé en Principe", - "countries.taiwan": "Taiwan", - "countries.tajikistan": "Tadzjikistan", - "countries.tanzania": "Tanzania", - "countries.thailand": "Thailand", - "countries.timor-leste": "Oost-Timor", - "countries.togo": "Togo", - "countries.tonga": "Tonga", - "countries.trinidad_and_tobago": "Trinidad en Tobago", - "countries.tunisia": "Tunesië", - "countries.turkey": "Turkije", - "countries.turkmenistan": "Turkmenistan", - "countries.turks_and_caicos_islands": "Turks- en Caicoseilanden", - "countries.tuvalu": "Tuvalu", - "countries.uganda": "Oeganda", - "countries.ukraine": "Oekraïne", - "countries.united kingdom": "Verenigd Koninkrijk", - "countries.united states": "Verenigde Staten", - "countries.united_arab_emirates": "Verenigde Arabische Emiraten", - "countries.uruguay": "Uruguay", - "countries.us_virgin_islands": "Amerikaanse Maagdeneilanden", - "countries.uzbekistan": "Oezbekistan", - "countries.vanuatu": "Vanuatu", - "countries.vatican_city": "Vaticaanstad", - "countries.venezuela": "Venezuela", - "countries.vietnam": "Vietnam", - "countries.wallis_and_futuna": "Wallis en Futuna", - "countries.western_sahara": "Westelijke Sahara", - "countries.yemen": "Jemen", - "countries.zambia": "Zambia", - "countries.zimbabwe": "Zimbabwe", "dashboard.channel_selector.select_channel": "Selecteer Kanaal", "dashboard.channel_selector.select_channel_label": "Elk kanaal heeft zijn eigen configuratie-instellingen.", "dashboard.config.financial_warning": "Financiële Waarschuwing", @@ -304,7 +73,6 @@ "dashboard.pages.payments.in3.version.label": "In3 versie", "dashboard.pages.payments.in3.version.v2": "V2 (Capayable/In3)", "dashboard.pages.payments.in3.version.v3": "V3 (iDEAL In3)", - "dashboard.pages.payments.logo": "Betaalmethode logo", "dashboard.pages.payments.max_order_amount_b2c": "Maximale B2B bestelbedrag", "dashboard.pages.payments.maximum_order_amount": "Maximaal toegestane bestelbedrag", "dashboard.pages.payments.min_order_amount_b2b": "Minimale B2B bestelbedrag", @@ -372,7 +140,14 @@ "dashboard.pages.settings.refunds_label": "Terugbetaling omschrijving", "dashboard.pages.settings.refunds_label_explanation": "Deze omschrijving wordt gebruikt bij de terugbetaling en zal zichtbaar zijn in Buckaroo en op het bankafschrift van de consument. Wij adviseren om de webshopnaam te gebruiken, zodat klanten de betaling gemakkelijk kunnen herkennen.", "dashboard.pages.settings.refunds_label_label": "Indien ingeschakeld, kunt u (gedeeltelijke) terugbetalingen rechtstreeks vanuit uw PrestaShop-beheergebied uitvoeren Read more", - "dashboard.pages.settings.remove": "Verwijder", + "dashboard.pages.settings.payment_fee": "Transactiekosten", + "dashboard.pages.settings.payment_fee_description": "Hier kun je verschillende opties voor betalingskosten configureren, zoals het instellen van het kostenpercentage en het aanpassen van de naam van de kosten.", + "dashboard.pages.settings.payment_fee_percentage_mode": "Transactiekosten percentage modus", + "dashboard.pages.settings.payment_fee_percentage_mode_description": "Deze instelling is alleen van toepassing op percentage-gebaseerde Buckaroo-kosten.
Kies over welk bedrag het kostenpercentage wordt berekend.", + "dashboard.pages.settings.subtotal": "Subtotaal", + "dashboard.pages.settings.subtotal_incl_tax": "Subtotaal incl. btw", + "dashboard.pages.settings.payment_fee_frontend_label": "Naam voor transactiekosten in de checkout", + "dashboard.pages.settings.payment_fee_frontend_label_description": "Dit label wordt weergegeven naast de kosten op de afreken-, bestel-, factuur- en creditnota-pagina's en pdf's.","dashboard.pages.settings.remove": "Verwijder", "dashboard.pages.settings.return_url": "Return-URL", "dashboard.pages.settings.return_url_explanation": "Wanneer dit veld leeg wordt gelaten, keert de klant terug naar de standaard PrestaShop bevestigingspagina.", "dashboard.pages.settings.return_url_label": "Stel een aangepaste return-URL in nadat de klant de betaling heeft voltooid.", @@ -421,7 +196,6 @@ "payment_methods.przelewy24": "Przelewy24", "payment_methods.sepadirectdebit": "SEPA Direct Debit", "payment_methods.sofortueberweisung": "Sofort", - "payment_methods.tinka": "Tinka", "payment_methods.transfer": "Transfer", "payment_methods.trustly": "Trustly", "payment_methods.wechatpay": "WeChatPay", diff --git a/dev/src/components/CountrySelect.vue b/dev/src/components/CountrySelect.vue index 1184884b6..f09ea9dca 100644 --- a/dev/src/components/CountrySelect.vue +++ b/dev/src/components/CountrySelect.vue @@ -1,5 +1,5 @@ @@ -42,28 +29,10 @@ export default { components: { FinancialWarning }, - setup(props) { + setup() { const config = inject('config') - const baseUrl = inject('baseUrl'); - - const url = baseUrl + '/modules/buckaroo3/views/img/buckaroo/Payment methods/SVG/'; - - const paymentLogoOptions = [ - { - value: 'in3_ideal', - text: 'iDEAL In3', - image: url + 'In3_ideal.svg' - }, - { - value: 'in3', - text: 'IN3', - image: url + 'In3.svg' - } - ]; - return { - config, - paymentLogoOptions, + config } } } diff --git a/dev/src/components/payments/TinkaPaymentConfig.vue b/dev/src/components/payments/TinkaPaymentConfig.vue deleted file mode 100644 index 9e6ce9140..000000000 --- a/dev/src/components/payments/TinkaPaymentConfig.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - diff --git a/dev/src/fos_js_routes.json b/dev/src/fos_js_routes.json index 4ad6abda9..a19c78beb 100644 --- a/dev/src/fos_js_routes.json +++ b/dev/src/fos_js_routes.json @@ -1 +1 @@ -{"base_url":"","routes":{"admin_common_notifications":{"tokens":[["text","\/common\/notifications"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_product_form":{"tokens":[["variable","\/","\\d+","id"],["text","\/sell\/catalog\/products"]],"defaults":[],"requirements":{"id":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_feature_get_feature_values":{"tokens":[["variable","\/","\\d+","idFeature"],["text","\/sell\/catalog\/products\/features"]],"defaults":{"idFeature":0},"requirements":{"idFeature":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_combinations":{"tokens":[["text","\/combinations"],["variable","\/","[^\/]++","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_combinations_ids":{"tokens":[["text","\/combinations\/ids"],["variable","\/","[^\/]++","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_combinations_update_combination_from_listing":{"tokens":[["text","\/update-combination-from-listing"],["variable","\/","[^\/]++","productId"],["text","\/sell\/catalog\/products-v2\/combinations"]],"defaults":[],"requirements":{"combinationId":"\\d+"},"hosttokens":[],"methods":["PATCH"],"schemes":[]},"admin_products_combinations_edit_combination":{"tokens":[["text","\/edit"],["variable","\/","\\d+","combinationId"],["text","\/sell\/catalog\/products-v2\/combinations"]],"defaults":[],"requirements":{"combinationId":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_products_combinations_bulk_edit_combination":{"tokens":[["text","\/combinations\/bulk-edit"],["variable","\/","\\d+","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["PATCH"],"schemes":[]},"admin_products_combinations_delete_combination":{"tokens":[["text","\/delete"],["variable","\/","\\d+","combinationId"],["text","\/sell\/catalog\/products-v2\/combinations"]],"defaults":[],"requirements":{"combinationId":"\\d+"},"hosttokens":[],"methods":["DELETE"],"schemes":[]},"admin_products_combinations_bulk_delete":{"tokens":[["text","\/combinations\/bulk-delete"],["variable","\/","\\d+","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_attribute_groups":{"tokens":[["text","\/attribute-groups"],["variable","\/","[^\/]++","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_all_attribute_groups":{"tokens":[["text","\/sell\/catalog\/products-v2\/all-attribute-groups"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_combinations_generate":{"tokens":[["variable","\/","[^\/]++","productId"],["text","\/sell\/catalog\/products-v2\/generate-combinations"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_v2_get_images":{"tokens":[["text","\/images"],["variable","\/","\\d+","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_v2_add_image":{"tokens":[["text","\/sell\/catalog\/products-v2\/images\/add"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_v2_update_image":{"tokens":[["text","\/update"],["variable","\/","\\d+","productImageId"],["text","\/sell\/catalog\/products-v2\/images"]],"defaults":[],"requirements":{"productImageId":"\\d+"},"hosttokens":[],"methods":["PATCH"],"schemes":[]},"admin_products_v2_delete_image":{"tokens":[["text","\/delete"],["variable","\/","\\d+","productImageId"],["text","\/sell\/catalog\/products-v2\/images"]],"defaults":[],"requirements":{"productImageId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_specific_prices_list":{"tokens":[["text","\/specific-prices\/list"],["variable","\/","\\d+","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_specific_prices_create":{"tokens":[["text","\/specific-prices\/create"],["variable","\/","\\d+","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_products_specific_prices_edit":{"tokens":[["text","\/edit"],["variable","\/","\\d+","specificPriceId"],["text","\/sell\/catalog\/products-v2\/specific-prices"]],"defaults":[],"requirements":{"specificPriceId":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_products_specific_prices_delete":{"tokens":[["text","\/delete"],["variable","\/","\\d+","specificPriceId"],["text","\/sell\/catalog\/products-v2\/specific-prices"]],"defaults":[],"requirements":{"specificPriceId":"\\d+"},"hosttokens":[],"methods":["DELETE"],"schemes":[]},"admin_products_v2_edit":{"tokens":[["text","\/edit"],["variable","\/","\\d+","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["GET","POST","PATCH"],"schemes":[]},"admin_products_v2_bulk_enable":{"tokens":[["text","\/sell\/catalog\/products-v2\/bulk-enable"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_v2_bulk_disable":{"tokens":[["text","\/sell\/catalog\/products-v2\/bulk-disable"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_v2_bulk_duplicate":{"tokens":[["text","\/sell\/catalog\/products-v2\/bulk-duplicate"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_v2_bulk_delete":{"tokens":[["text","\/sell\/catalog\/products-v2\/bulk-delete"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["POST","DELETE"],"schemes":[]},"admin_categories_get_categories_tree":{"tokens":[["text","\/sell\/catalog\/categories\/tree"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_cart_rules_search":{"tokens":[["text","\/sell\/catalog\/cart-rules\/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_customers_view":{"tokens":[["text","\/view"],["variable","\/","\\d+","customerId"],["text","\/sell\/customers"]],"defaults":[],"requirements":{"customerId":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_customers_search":{"tokens":[["text","\/sell\/customers\/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_customers_carts":{"tokens":[["text","\/carts"],["variable","\/","\\d+","customerId"],["text","\/sell\/customers"]],"defaults":[],"requirements":{"customerId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_customers_orders":{"tokens":[["text","\/orders"],["variable","\/","\\d+","customerId"],["text","\/sell\/customers"]],"defaults":[],"requirements":{"customerId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_addresses_create":{"tokens":[["text","\/sell\/addresses\/new"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_addresses_edit":{"tokens":[["text","\/edit"],["variable","\/","\\d+","addressId"],["text","\/sell\/addresses"]],"defaults":[],"requirements":{"addressId":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_order_addresses_edit":{"tokens":[["text","\/edit"],["variable","\/","delivery|invoice","addressType"],["variable","\/","\\d+","orderId"],["text","\/sell\/addresses\/order"]],"defaults":[],"requirements":{"orderId":"\\d+","addressType":"delivery|invoice"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_cart_addresses_edit":{"tokens":[["text","\/edit"],["variable","\/","delivery|invoice","addressType"],["variable","\/","\\d+","cartId"],["text","\/sell\/addresses\/cart"]],"defaults":[],"requirements":{"cartId":"\\d+","addressType":"delivery|invoice"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_carts_view":{"tokens":[["text","\/view"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_carts_info":{"tokens":[["text","\/info"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_carts_create":{"tokens":[["text","\/sell\/orders\/carts\/new"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_addresses":{"tokens":[["text","\/addresses"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_carrier":{"tokens":[["text","\/carrier"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_currency":{"tokens":[["text","\/currency"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_language":{"tokens":[["text","\/language"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_set_delivery_settings":{"tokens":[["text","\/rules\/delivery-settings"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_add_cart_rule":{"tokens":[["text","\/cart-rules"],["variable","\/","[^\/]++","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_delete_cart_rule":{"tokens":[["text","\/delete"],["variable","\/","[^\/]++","cartRuleId"],["text","\/cart-rules"],["variable","\/","[^\/]++","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_add_product":{"tokens":[["text","\/products"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_product_price":{"tokens":[["text","\/price"],["variable","\/","\\d+","productId"],["text","\/products"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+","productId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_product_quantity":{"tokens":[["text","\/quantity"],["variable","\/","\\d+","productId"],["text","\/products"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+","productId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_delete_product":{"tokens":[["text","\/delete-product"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_place":{"tokens":[["text","\/sell\/orders\/place"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_view":{"tokens":[["text","\/view"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_orders_duplicate_cart":{"tokens":[["text","\/duplicate-cart"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_update_product":{"tokens":[["variable","\/","\\d+","orderDetailId"],["text","\/products"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+","orderDetailId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_partial_refund":{"tokens":[["text","\/partial-refund"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_standard_refund":{"tokens":[["text","\/standard-refund"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_return_product":{"tokens":[["text","\/return-product"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_send_process_order_email":{"tokens":[["text","\/sell\/orders\/process-order-email"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_add_product":{"tokens":[["text","\/products"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_delete_product":{"tokens":[["text","\/delete"],["variable","\/","\\d+","orderDetailId"],["text","\/products"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+","orderDetailId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_get_discounts":{"tokens":[["text","\/discounts"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_prices":{"tokens":[["text","\/prices"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_payments":{"tokens":[["text","\/payments"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_products":{"tokens":[["text","\/products"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_invoices":{"tokens":[["text","\/invoices"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_documents":{"tokens":[["text","\/documents"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_shipping":{"tokens":[["text","\/shipping"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_cancellation":{"tokens":[["text","\/cancellation"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_configure_product_pagination":{"tokens":[["text","\/sell\/orders\/configure-product-pagination"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_product_prices":{"tokens":[["text","\/products\/prices"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_products_search":{"tokens":[["text","\/sell\/orders\/products\/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_attachments_attachment_info":{"tokens":[["text","\/info"],["variable","\/","\\d+","attachmentId"],["text","\/sell\/attachments"]],"defaults":[],"requirements":{"attachmentId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_attachments_search":{"tokens":[["variable","\/","[^\/]++","searchPhrase"],["text","\/sell\/attachments\/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_shops_search":{"tokens":[["variable","\/","[^\/]++","searchTerm"],["text","\/configure\/advanced\/shops\/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"buckaroo_config_paymentMethod":{"tokens":[["text","\/modules\/buckaroo3\/config\/payment\/methods"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_countries":{"tokens":[["text","\/modules\/buckaroo3\/config\/countries"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_creditcards":{"tokens":[["text","\/modules\/buckaroo3\/config\/creditcards"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_orderings":{"tokens":[["text","\/modules\/buckaroo3\/config\/orderings"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_methodMode":{"tokens":[["text","\/modules\/buckaroo3\/config\/methodMode"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_methods":{"tokens":[["text","\/modules\/buckaroo3\/config\/methods"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_settings":{"tokens":[["text","\/modules\/buckaroo3\/config\/settings"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_testCredentials":{"tokens":[["text","\/modules\/buckaroo3\/config\/testCredentials"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_verificationMethods":{"tokens":[["text","\/modules\/buckaroo3\/config\/verificationMethods"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]}},"prefix":"","host":"localhost","port":"","scheme":"http","locale":""} \ No newline at end of file +{"base_url":"","routes":{"admin_common_notifications":{"tokens":[["text","\/common\/notifications"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_product_form":{"tokens":[["variable","\/","\\d+","id"],["text","\/sell\/catalog\/products"]],"defaults":[],"requirements":{"id":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_feature_get_feature_values":{"tokens":[["variable","\/","\\d+","idFeature"],["text","\/sell\/catalog\/products\/features"]],"defaults":{"idFeature":0},"requirements":{"idFeature":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_combinations":{"tokens":[["text","\/combinations"],["variable","\/","[^\/]++","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_combinations_ids":{"tokens":[["text","\/combinations\/ids"],["variable","\/","[^\/]++","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_combinations_update_combination_from_listing":{"tokens":[["text","\/update-combination-from-listing"],["variable","\/","[^\/]++","productId"],["text","\/sell\/catalog\/products-v2\/combinations"]],"defaults":[],"requirements":{"combinationId":"\\d+"},"hosttokens":[],"methods":["PATCH"],"schemes":[]},"admin_products_combinations_edit_combination":{"tokens":[["text","\/edit"],["variable","\/","\\d+","combinationId"],["text","\/sell\/catalog\/products-v2\/combinations"]],"defaults":[],"requirements":{"combinationId":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_products_combinations_bulk_edit_combination":{"tokens":[["text","\/combinations\/bulk-edit"],["variable","\/","\\d+","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["PATCH"],"schemes":[]},"admin_products_combinations_delete_combination":{"tokens":[["text","\/delete"],["variable","\/","\\d+","combinationId"],["text","\/sell\/catalog\/products-v2\/combinations"]],"defaults":[],"requirements":{"combinationId":"\\d+"},"hosttokens":[],"methods":["DELETE"],"schemes":[]},"admin_products_combinations_bulk_delete":{"tokens":[["text","\/combinations\/bulk-delete"],["variable","\/","\\d+","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_attribute_groups":{"tokens":[["text","\/attribute-groups"],["variable","\/","[^\/]++","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_all_attribute_groups":{"tokens":[["text","\/sell\/catalog\/products-v2\/all-attribute-groups"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_combinations_generate":{"tokens":[["variable","\/","[^\/]++","productId"],["text","\/sell\/catalog\/products-v2\/generate-combinations"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_v2_get_images":{"tokens":[["text","\/images"],["variable","\/","\\d+","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_v2_add_image":{"tokens":[["text","\/sell\/catalog\/products-v2\/images\/add"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_v2_update_image":{"tokens":[["text","\/update"],["variable","\/","\\d+","productImageId"],["text","\/sell\/catalog\/products-v2\/images"]],"defaults":[],"requirements":{"productImageId":"\\d+"},"hosttokens":[],"methods":["PATCH"],"schemes":[]},"admin_products_v2_delete_image":{"tokens":[["text","\/delete"],["variable","\/","\\d+","productImageId"],["text","\/sell\/catalog\/products-v2\/images"]],"defaults":[],"requirements":{"productImageId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_specific_prices_list":{"tokens":[["text","\/specific-prices\/list"],["variable","\/","\\d+","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_products_specific_prices_create":{"tokens":[["text","\/specific-prices\/create"],["variable","\/","\\d+","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_products_specific_prices_edit":{"tokens":[["text","\/edit"],["variable","\/","\\d+","specificPriceId"],["text","\/sell\/catalog\/products-v2\/specific-prices"]],"defaults":[],"requirements":{"specificPriceId":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_products_specific_prices_delete":{"tokens":[["text","\/delete"],["variable","\/","\\d+","specificPriceId"],["text","\/sell\/catalog\/products-v2\/specific-prices"]],"defaults":[],"requirements":{"specificPriceId":"\\d+"},"hosttokens":[],"methods":["DELETE"],"schemes":[]},"admin_products_v2_edit":{"tokens":[["text","\/edit"],["variable","\/","\\d+","productId"],["text","\/sell\/catalog\/products-v2"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["GET","POST","PATCH"],"schemes":[]},"admin_products_v2_bulk_enable":{"tokens":[["text","\/sell\/catalog\/products-v2\/bulk-enable"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_v2_bulk_disable":{"tokens":[["text","\/sell\/catalog\/products-v2\/bulk-disable"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_v2_bulk_duplicate":{"tokens":[["text","\/sell\/catalog\/products-v2\/bulk-duplicate"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_products_v2_bulk_delete":{"tokens":[["text","\/sell\/catalog\/products-v2\/bulk-delete"]],"defaults":[],"requirements":{"productId":"\\d+"},"hosttokens":[],"methods":["POST","DELETE"],"schemes":[]},"admin_categories_get_categories_tree":{"tokens":[["text","\/sell\/catalog\/categories\/tree"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_cart_rules_search":{"tokens":[["text","\/sell\/catalog\/cart-rules\/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_customers_view":{"tokens":[["text","\/view"],["variable","\/","\\d+","customerId"],["text","\/sell\/customers"]],"defaults":[],"requirements":{"customerId":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_customers_search":{"tokens":[["text","\/sell\/customers\/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_customers_carts":{"tokens":[["text","\/carts"],["variable","\/","\\d+","customerId"],["text","\/sell\/customers"]],"defaults":[],"requirements":{"customerId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_customers_orders":{"tokens":[["text","\/orders"],["variable","\/","\\d+","customerId"],["text","\/sell\/customers"]],"defaults":[],"requirements":{"customerId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_addresses_create":{"tokens":[["text","\/sell\/addresses\/new"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_addresses_edit":{"tokens":[["text","\/edit"],["variable","\/","\\d+","addressId"],["text","\/sell\/addresses"]],"defaults":[],"requirements":{"addressId":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_order_addresses_edit":{"tokens":[["text","\/edit"],["variable","\/","delivery|invoice","addressType"],["variable","\/","\\d+","orderId"],["text","\/sell\/addresses\/order"]],"defaults":[],"requirements":{"orderId":"\\d+","addressType":"delivery|invoice"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_cart_addresses_edit":{"tokens":[["text","\/edit"],["variable","\/","delivery|invoice","addressType"],["variable","\/","\\d+","cartId"],["text","\/sell\/addresses\/cart"]],"defaults":[],"requirements":{"cartId":"\\d+","addressType":"delivery|invoice"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_carts_view":{"tokens":[["text","\/view"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_carts_info":{"tokens":[["text","\/info"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_carts_create":{"tokens":[["text","\/sell\/orders\/carts\/new"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_addresses":{"tokens":[["text","\/addresses"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_carrier":{"tokens":[["text","\/carrier"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_currency":{"tokens":[["text","\/currency"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_language":{"tokens":[["text","\/language"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_set_delivery_settings":{"tokens":[["text","\/rules\/delivery-settings"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_add_cart_rule":{"tokens":[["text","\/cart-rules"],["variable","\/","[^\/]++","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_delete_cart_rule":{"tokens":[["text","\/delete"],["variable","\/","[^\/]++","cartRuleId"],["text","\/cart-rules"],["variable","\/","[^\/]++","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_add_product":{"tokens":[["text","\/products"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_product_price":{"tokens":[["text","\/price"],["variable","\/","\\d+","productId"],["text","\/products"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+","productId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_edit_product_quantity":{"tokens":[["text","\/quantity"],["variable","\/","\\d+","productId"],["text","\/products"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+","productId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_carts_delete_product":{"tokens":[["text","\/delete-product"],["variable","\/","\\d+","cartId"],["text","\/sell\/orders\/carts"]],"defaults":[],"requirements":{"cartId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_place":{"tokens":[["text","\/sell\/orders\/place"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_view":{"tokens":[["text","\/view"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET","POST"],"schemes":[]},"admin_orders_duplicate_cart":{"tokens":[["text","\/duplicate-cart"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_update_product":{"tokens":[["variable","\/","\\d+","orderDetailId"],["text","\/products"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+","orderDetailId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_partial_refund":{"tokens":[["text","\/partial-refund"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_standard_refund":{"tokens":[["text","\/standard-refund"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_return_product":{"tokens":[["text","\/return-product"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_send_process_order_email":{"tokens":[["text","\/sell\/orders\/process-order-email"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_add_product":{"tokens":[["text","\/products"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_delete_product":{"tokens":[["text","\/delete"],["variable","\/","\\d+","orderDetailId"],["text","\/products"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+","orderDetailId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_get_discounts":{"tokens":[["text","\/discounts"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_prices":{"tokens":[["text","\/prices"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_payments":{"tokens":[["text","\/payments"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_products":{"tokens":[["text","\/products"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_invoices":{"tokens":[["text","\/invoices"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_documents":{"tokens":[["text","\/documents"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_get_shipping":{"tokens":[["text","\/shipping"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_cancellation":{"tokens":[["text","\/cancellation"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_configure_product_pagination":{"tokens":[["text","\/sell\/orders\/configure-product-pagination"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"admin_orders_product_prices":{"tokens":[["text","\/products\/prices"],["variable","\/","\\d+","orderId"],["text","\/sell\/orders"]],"defaults":[],"requirements":{"orderId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_orders_products_search":{"tokens":[["text","\/sell\/orders\/products\/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_attachments_attachment_info":{"tokens":[["text","\/info"],["variable","\/","\\d+","attachmentId"],["text","\/sell\/attachments"]],"defaults":[],"requirements":{"attachmentId":"\\d+"},"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_attachments_search":{"tokens":[["variable","\/","[^\/]++","searchPhrase"],["text","\/sell\/attachments\/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"admin_shops_search":{"tokens":[["variable","\/","[^\/]++","searchTerm"],["text","\/configure\/advanced\/shops\/search"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["GET"],"schemes":[]},"buckaroo_config_paymentMethod":{"tokens":[["text","\/modules\/buckaroo3\/config\/payment\/methods"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_countries":{"tokens":[["text","\/modules\/buckaroo3\/config\/countries"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_creditcards":{"tokens":[["text","\/modules\/buckaroo3\/config\/creditcards"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_giftcards":{"tokens":[["text","\/modules\/buckaroo3\/config\/giftcards"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_edit_giftcard":{"tokens":[["text","\/modules\/buckaroo3\/config\/giftcards\/edit"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"buckaroo_remove_giftcard":{"tokens":[["text","\/modules\/buckaroo3\/config\/giftcards\/remove"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST"],"schemes":[]},"buckaroo_config_orderings":{"tokens":[["text","\/modules\/buckaroo3\/config\/orderings"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_methodMode":{"tokens":[["text","\/modules\/buckaroo3\/config\/methodMode"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_methods":{"tokens":[["text","\/modules\/buckaroo3\/config\/methods"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_settings":{"tokens":[["text","\/modules\/buckaroo3\/config\/settings"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_testCredentials":{"tokens":[["text","\/modules\/buckaroo3\/config\/testCredentials"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]},"buckaroo_config_verificationMethods":{"tokens":[["text","\/modules\/buckaroo3\/config\/verificationMethods"]],"defaults":[],"requirements":[],"hosttokens":[],"methods":["POST","GET"],"schemes":[]}},"prefix":"","host":"localhost","port":"","scheme":"http","locale":""} \ No newline at end of file diff --git a/dev/src/lib/countries.ts b/dev/src/lib/countries.ts index c18ed7009..d7cdda13b 100644 --- a/dev/src/lib/countries.ts +++ b/dev/src/lib/countries.ts @@ -17,15 +17,14 @@ export const useCountries = () => { }) const filteredCountries = computed(() => { - if (!query.value || query.value.trim().length === 0) { - return countries.value - } - - return countries.value.filter((country) => { - return country.name.toLowerCase().includes(query.value.toLowerCase()) || (`countries.${ country.name }`).toLowerCase().includes(query.value.toLowerCase()) - }) + if (!query.value || query.value.trim().length === 0) { + return countries.value; } - ) + + return countries.value.filter((country) => { + return country.name.toLowerCase().includes(query.value.toLowerCase()); + }); + }); return { query, diff --git a/dev/src/pages/OrderPaymentMethods.vue b/dev/src/pages/OrderPaymentMethods.vue index e80cdb504..63a6d329a 100644 --- a/dev/src/pages/OrderPaymentMethods.vue +++ b/dev/src/pages/OrderPaymentMethods.vue @@ -21,7 +21,7 @@
  • - {{ $t(`countries.${ country.name }`) }} + {{country.name}}
  • @@ -30,7 +30,7 @@
    -

    {{ $t(`countries.${ selectedCountry.name }`) }}

    +

    {{ selectedCountry.name }}

    All Countries

    diff --git a/dev/src/pages/PaymentMethods.vue b/dev/src/pages/PaymentMethods.vue index 5cb10950d..5d431e7d7 100644 --- a/dev/src/pages/PaymentMethods.vue +++ b/dev/src/pages/PaymentMethods.vue @@ -34,7 +34,7 @@ - +
    @@ -60,7 +60,7 @@ import IdealPaymentConfig from "../components/payments/IdealPaymentConfig.vue"; import PaymentMethodBlock from "../components/PaymentMethodBlock.vue"; import Loading from "../components/Loading.vue"; import PayPalPaymentConfig from "../components/payments/PayPalPaymentConfig.vue"; -import TinkaPaymentConfig from "../components/payments/TinkaPaymentConfig.vue"; +import GiftcardPaymentConfig from "../components/payments/GiftcardPaymentConfig.vue"; import KlarnaPaymentConfig from "../components/payments/KlarnaPaymentConfig.vue"; export default { @@ -80,7 +80,7 @@ export default { TransferPaymentConfig, PayPerEmailPaymentConfig, PaymentMethodBlock, - TinkaPaymentConfig, + GiftcardPaymentConfig, KlarnaPaymentConfig }, setup() { diff --git a/dev/src/pages/Settings.vue b/dev/src/pages/Settings.vue index 6d927fa37..be61feac1 100644 --- a/dev/src/pages/Settings.vue +++ b/dev/src/pages/Settings.vue @@ -15,20 +15,30 @@
    -
    - + {{ $t('dashboard.pages.settings.no_im_testing') }} {{ $t('dashboard.pages.settings.when_your_shop_is_not_live_yet') }}
    -
    - - {{ $t('dashboard.pages.settings.yes_im_ready_to_receive_payments') }} - {{ $t('dashboard.pages.settings.your_shop_is_live_and_ready_to_receive_real_payments') }} + + {{ + $t('dashboard.pages.settings.yes_im_ready_to_receive_payments') + }} + {{ + $t('dashboard.pages.settings.your_shop_is_live_and_ready_to_receive_real_payments') + }}
    @@ -42,42 +52,66 @@
    - -
    {{ $t('dashboard.pages.settings.successfully_verified_the_credentials') }}
    -
    {{ $t('dashboard.pages.settings.the_credentials_are_not_valid') }}
    + +
    + {{ $t('dashboard.pages.settings.successfully_verified_the_credentials') }} +
    +
    + {{ $t('dashboard.pages.settings.the_credentials_are_not_valid') }} +
    - +
    - -
    - -
    - - + +
    - -
    @@ -117,10 +154,16 @@
    • - +
    • - +
    @@ -135,51 +178,120 @@ - -
    - -
    {{ $t('dashboard.pages.settings.re_stock_products_label') }}
    -
    -
    - - -
    - -
    {{ $t('dashboard.pages.settings.generate_credit_slip_label') }}
    + +
    + +
    {{ $t('dashboard.pages.settings.re_stock_products_label') }}
    +
    +
    + + +
    + +
    {{ + $t('dashboard.pages.settings.generate_credit_slip_label') + }}
    - - - -
    - -
    {{ $t('dashboard.pages.settings.generate_voucher_label') }}
    +
    +
    + + +
    + +
    {{ $t('dashboard.pages.settings.generate_voucher_label') }}
    +
    +
    + + +
    + +
    {{ + $t('dashboard.pages.settings.generate_negative_payments_label') + }}
    - - - -
    - -
    {{ $t('dashboard.pages.settings.generate_negative_payments_label') }}
    +
    +
    +
    +
    +

    {{ $t('dashboard.pages.settings.payment_fee') }}

    +
    + {{ $t('dashboard.pages.settings.payment_fee_description') }}
    - +
    +
    + +
    +
    +

    {{ $t('dashboard.pages.settings.payment_fee_percentage_mode') }}

    +
    +
    +
    + + +
    +
    + + + + +
    +
    + +
    {{ $t('dashboard.pages.settings.payment_fee_frontend_label_description') }}
    +
    +
    + + +
    +
    +
    - +
    - +
    @@ -188,26 +300,36 @@

    - +
    1. -
      1
      +
      1
      +
    2. -
      2
      +
      2
      +
    3. -
      3
      +
      3
      +
    4. -
    5. 4
    6. -
    7. 5
    8. +
    9. +
      4
      +
    10. +
    11. +
      5
      +
    -

    - {{$t('dashboard.pages.settings.if_you_have_any_questions')}} +

    + {{ $t('dashboard.pages.settings.if_you_have_any_questions') }} support@buckaroo.nl - {{$t('dashboard.pages.settings.if_you_have_any_questions_link')}} + {{ $t('dashboard.pages.settings.if_you_have_any_questions_link') }} +31 (0) 30 711 50 20.

    @@ -215,10 +337,10 @@ \ No newline at end of file diff --git a/views/templates/hook/payment-fee-table.tpl b/views/templates/hook/payment-fee-table.tpl new file mode 100644 index 000000000..264413610 --- /dev/null +++ b/views/templates/hook/payment-fee-table.tpl @@ -0,0 +1,31 @@ +
    +
    +

    + {l s='Payment Fee Details' mod='buckaroo3'} +

    +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    {l s='Description' mod='buckaroo3'}{l s='Amount' mod='buckaroo3'}
    {l s='Fee (excl. tax)' mod='buckaroo3'}{$buckaroo_fee.buckaroo_fee_tax_excl|number_format:2:'.':','} {$currency->sign}
    {l s='Fee tax' mod='buckaroo3'}{$buckaroo_fee.buckaroo_fee_tax|number_format:2:'.':','} {$currency->sign}
    {l s='Fee (incl. tax)' mod='buckaroo3'}{$buckaroo_fee.buckaroo_fee_tax_incl|number_format:2:'.':','} {$currency->sign}
    +
    +
    diff --git a/views/templates/hook/payment_giftcards.tpl b/views/templates/hook/payment_giftcards.tpl new file mode 100644 index 000000000..74d8bb391 --- /dev/null +++ b/views/templates/hook/payment_giftcards.tpl @@ -0,0 +1,53 @@ +{* +* + * + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * It is available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * + * @author Buckaroo.nl + * @copyright Copyright (c) Buckaroo B.V. + * @license http://opensource.org/licenses/afl-3.0 Academic Free License (AFL 3.0) +*} +
    + +
    + {if $giftCardDisplayMode === 'separate'} +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + {l s='Please make sure all fields are filled in correctly before proceeding.' mod='buckaroo3'}

    + + {/if} +
    +
    diff --git a/views/templates/hook/payment_tinka.tpl b/views/templates/hook/payment_tinka.tpl deleted file mode 100644 index 4c0a780f1..000000000 --- a/views/templates/hook/payment_tinka.tpl +++ /dev/null @@ -1,42 +0,0 @@ -{* -* - * - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * It is available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * - * @author Buckaroo.nl - * @copyright Copyright (c) Buckaroo B.V. - * @license http://opensource.org/licenses/afl-3.0 Academic Free License (AFL 3.0) -*} -
    - -
    -
    -
    -
    - - {l s='DD' mod='buckaroo3'} - - {l s='MM' mod='buckaroo3'} - - {l s='YYYY' mod='buckaroo3'} -
    -
    - {if ($country == 'NL' && $methodsWithFinancialWarning['tinka']) } -

    - {l s=$methodsWithFinancialWarning['warningText'] sprintf=['tinka'] mod='buckaroo3'} -

    - {/if} -
    -