From 45a7de58ddd27005cfe1e04e48e49486b5a53af6 Mon Sep 17 00:00:00 2001 From: Hugo Posnic Date: Wed, 6 Sep 2023 14:27:47 +0200 Subject: [PATCH] 3.2.0 --- Block/System/Config/Button.php | 2 +- .../Adminhtml/Settings/ConnectionTest.php | 2 +- Gateway/Config/BnplConfig.php | 6 ++ Gateway/Config/Config.php | 8 ++- Helper/Stats.php | 8 +++ Model/{Banktype.php => BankType.php} | 0 Model/Config/File/PemFile.php | 6 +- .../CheckoutDesignSelectionOptions.php | 4 +- Model/Ui/BnplConfigProvider.php | 1 + Model/Ui/ConfigProvider.php | 1 + README.md | 2 +- composer.json | 5 +- etc/adminhtml/events.xml | 9 +++ etc/adminhtml/system.xml | 68 ++++++++++++------- etc/config.xml | 2 + etc/events.xml | 6 -- etc/module.xml | 2 +- i18n/en_US.csv | 37 +++++----- i18n/es_ES.csv | 22 +++--- i18n/fr_FR.csv | 41 +++++------ tests/Model/BankTypeTest.php | 23 +++++++ view/frontend/web/css/style.css | 10 +++ .../method-renderer/fintecture-bnpl.js | 3 + .../method-renderer/fintecture-payment.js | 3 + .../web/template/payment/fintecture-bnpl.html | 3 + .../web/template/payment/fintecture.html | 9 ++- 26 files changed, 191 insertions(+), 92 deletions(-) rename Model/{Banktype.php => BankType.php} (100%) create mode 100644 etc/adminhtml/events.xml create mode 100644 tests/Model/BankTypeTest.php diff --git a/Block/System/Config/Button.php b/Block/System/Config/Button.php index ddcae24..160d3c4 100644 --- a/Block/System/Config/Button.php +++ b/Block/System/Config/Button.php @@ -53,7 +53,7 @@ public function getButtonHtml(): string $button = $this->getLayout()->createBlock(WidgetButton::class); $button->setData([ 'id' => 'connection-test', - 'label' => __('Test Connection'), + 'label' => __('Test connection'), ]); return $button->toHtml(); diff --git a/Controller/Adminhtml/Settings/ConnectionTest.php b/Controller/Adminhtml/Settings/ConnectionTest.php index aec898e..8b6687d 100644 --- a/Controller/Adminhtml/Settings/ConnectionTest.php +++ b/Controller/Adminhtml/Settings/ConnectionTest.php @@ -82,7 +82,7 @@ public function execute() throw new LocalizedException(__('Some fields are empty')); } - // Handle already saved app secret + // Handle already saved APP secret if ($jsParams['appSecret'] === '******') { $jsParams['appSecret'] = $this->config->getAppSecret($jsParams['environment'], $scopeId); } diff --git a/Gateway/Config/BnplConfig.php b/Gateway/Config/BnplConfig.php index bd9d7bf..e7d1f43 100644 --- a/Gateway/Config/BnplConfig.php +++ b/Gateway/Config/BnplConfig.php @@ -9,9 +9,15 @@ class BnplConfig extends BaseConfig const CODE = 'fintecture_bnpl'; const KEY_ACTIVE = 'active'; + const KEY_RECOMMEND_BNPL_BADGE = 'recommend_bnpl_badge'; public function isActive(): bool { return (bool) $this->getValue(self::KEY_ACTIVE); } + + public function isRecommendedBnplBadgeActive(): bool + { + return (bool) $this->getValue(self::KEY_RECOMMEND_BNPL_BADGE); + } } diff --git a/Gateway/Config/Config.php b/Gateway/Config/Config.php index 0bfc85c..95262f3 100644 --- a/Gateway/Config/Config.php +++ b/Gateway/Config/Config.php @@ -7,7 +7,7 @@ class Config extends BaseConfig { const CODE = 'fintecture'; - const VERSION = '3.1.0'; + const VERSION = '3.2.0'; const KEY_SHOP_NAME = 'general/store_information/name'; const KEY_ACTIVE = 'active'; @@ -30,6 +30,7 @@ class Config extends BaseConfig const KEY_CHECKOUT_DESIGN_SELECTION = 'checkout_design_selection'; const KEY_CUSTOM_RECONCILIATION_FIELD_ACTIVE = 'custom_reconciliation_field_active'; const KEY_CUSTOM_RECONCILIATION_FIELD = 'custom_reconciliation_field'; + const KEY_RECOMMEND_IT_BADGE = 'recommend_it_badge'; public function getShopName(): ?string { @@ -153,6 +154,11 @@ public function getCustomReconciliationField(): ?string return $this->getValue(self::KEY_CUSTOM_RECONCILIATION_FIELD); } + public function isRecommendedItBadgeActive(): bool + { + return (bool) $this->getValue(self::KEY_RECOMMEND_IT_BADGE); + } + public function getNewOrderStatus(): string { $status = $this->getValue('payment/fintecture/new_order_status'); diff --git a/Helper/Stats.php b/Helper/Stats.php index 69ca5cf..a2edd10 100644 --- a/Helper/Stats.php +++ b/Helper/Stats.php @@ -4,6 +4,7 @@ namespace Fintecture\Payment\Helper; +use Fintecture\Payment\Gateway\Config\BnplConfig; use Fintecture\Payment\Gateway\Config\Config; use Fintecture\Payment\Logger\Logger as FintectureLogger; use Fintecture\Payment\Model\Environment; @@ -17,6 +18,9 @@ class Stats /** @var Config */ protected $config; + /** @var BnplConfig */ + protected $bnplConfig; + /** @var FintectureLogger */ protected $fintectureLogger; @@ -34,6 +38,7 @@ class Stats public function __construct( Config $config, + BnplConfig $bnplConfig, FintectureLogger $fintectureLogger, ResourceConnection $resourceConnection, ProductMetadataInterface $productMetadata, @@ -41,6 +46,7 @@ public function __construct( StoreManagerInterface $storeManager ) { $this->config = $config; + $this->bnplConfig = $bnplConfig; $this->fintectureLogger = $fintectureLogger; $this->resourceConnection = $resourceConnection; $this->productMetadata = $productMetadata; @@ -99,6 +105,8 @@ public function getConfigurationSummary(): array 'module_production_app_id' => $this->config->getAppId(Environment::ENVIRONMENT_PRODUCTION), 'module_branding' => $this->config->isShowLogo(), 'module_checkout_design' => $this->config->getCheckoutDesign(), + 'module_recommended_it' => $this->config->isRecommendedItBadgeActive(), + 'module_recommended_bnpl' => $this->bnplConfig->isRecommendedBnplBadgeActive(), ]; } } diff --git a/Model/Banktype.php b/Model/BankType.php similarity index 100% rename from Model/Banktype.php rename to Model/BankType.php diff --git a/Model/Config/File/PemFile.php b/Model/Config/File/PemFile.php index a1f5ed9..427310d 100644 --- a/Model/Config/File/PemFile.php +++ b/Model/Config/File/PemFile.php @@ -11,12 +11,12 @@ protected function _getDeleteCheckbox() $value = $this->getValue(); if ($value) { if (substr_compare($value, '.pem', -strlen('.pem')) === 0) { - return '

' . __('Please re-upload Private Key file') . '
'; + return '

' . __('Please re-upload private key file') . '
'; } else { - return '

' . __('Private Key file already saved') . '
'; + return '

' . __('Private key file already saved') . '
'; } } else { - return '

' . __('Please upload Private Key file') . '
'; + return '

' . __('Please upload private key file') . '
'; } } } diff --git a/Model/Config/Options/CheckoutDesignSelectionOptions.php b/Model/Config/Options/CheckoutDesignSelectionOptions.php index b1ecae7..81b4245 100644 --- a/Model/Config/Options/CheckoutDesignSelectionOptions.php +++ b/Model/Config/Options/CheckoutDesignSelectionOptions.php @@ -9,8 +9,8 @@ public function toOptionArray() return [ ['value' => 'it', 'label' => __('Immediate Transfer')], ['value' => 'ist', 'label' => __('Immediate Transfer & Smart Transfer')], - ['value' => 'ist_long', 'label' => __('Long Version')], - ['value' => 'ist_short', 'label' => __('Short Version')], + ['value' => 'ist_long', 'label' => __('Long version')], + ['value' => 'ist_short', 'label' => __('Short version')], ]; } } diff --git a/Model/Ui/BnplConfigProvider.php b/Model/Ui/BnplConfigProvider.php index f7ec3ff..df8a8bd 100644 --- a/Model/Ui/BnplConfigProvider.php +++ b/Model/Ui/BnplConfigProvider.php @@ -37,6 +37,7 @@ public function getConfig() 'active' => $this->gatewayConfig->isActive(), 'todayDate' => $this->beautifulDate->formatDatetime($today), 'laterDate' => $this->beautifulDate->formatDatetime($later), + 'recommendBnplBadge' => $this->gatewayConfig->isRecommendedBnplBadgeActive(), ], ], ]; diff --git a/Model/Ui/ConfigProvider.php b/Model/Ui/ConfigProvider.php index a912edd..dc97b8e 100644 --- a/Model/Ui/ConfigProvider.php +++ b/Model/Ui/ConfigProvider.php @@ -24,6 +24,7 @@ public function getConfig() Config::CODE => [ 'active' => $this->gatewayConfig->isActive(), 'checkoutDesign' => $this->gatewayConfig->getCheckoutDesign(), + 'recommendItBadge' => $this->gatewayConfig->isRecommendedItBadgeActive(), ], ], ]; diff --git a/README.md b/README.md index ffeae02..f4a4124 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ To enable it, you must install this dependency: Go to Stores > Configuration > Sales > Payment methods. - Select environment (sandbox/production) -- Fill app id, app secret and private key based on the selected environment (https://console.fintecture.com/) +- Fill APP ID, APP secret and private key based on the selected environment (https://console.fintecture.com/) - Select payment method display (show logo or not) - Test your connection (if everything is ok you should have a green message) - Don't forget to enable the payment method unless it won't be displayed in the front end diff --git a/composer.json b/composer.json index b552c37..0edb5a4 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "email": "contact@fintecture.com" }, "type": "magento2-module", - "version": "3.1.0", + "version": "3.2.0", "license": [ "GPL-3.0" ], @@ -28,7 +28,8 @@ "phpstan/phpstan": "^1", "bitexpert/phpstan-magento": "^0.30.0", "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/extension-installer": "^1.1" + "phpstan/extension-installer": "^1.1", + "phpunit/phpunit": "*" }, "suggest": { "chillerlan/php-qrcode": "QR Code library for payment with \"Login as Customer\" feature enabled" diff --git a/etc/adminhtml/events.xml b/etc/adminhtml/events.xml new file mode 100644 index 0000000..63d70d6 --- /dev/null +++ b/etc/adminhtml/events.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 0811c68..e0d227b 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -28,13 +28,13 @@ - - Fintecture\Payment\Model\Banktype + + Fintecture\Payment\Model\BankType Filter the bank type @@ -51,7 +51,7 @@ - + sandbox @@ -84,7 +84,7 @@ - + production @@ -95,7 +95,7 @@ - + production @@ -110,47 +110,54 @@ - + - + - + validate-number payment/fintecture/sort_order - + payment/fintecture/allowspecific Magento\Payment\Model\Config\Source\Allspecificcountries - + payment/fintecture/specificcountry Magento\Directory\Model\Config\Source\Country 1 - + - + - + - + Please select the message you want to display on your checkout page, depending on the payment solutions you have. Fintecture\Payment\Model\Config\Options\CheckoutDesignSelectionOptions payment/fintecture/checkout_design_selection + + + + Magento\Config\Model\Config\Source\Yesno + Recommend the payment method on checkout page + payment/fintecture/recommend_it_badge + - + - + - + Fintecture\Payment\Block\Adminhtml\System\Config\Form\Version @@ -255,7 +262,7 @@ - + @@ -275,9 +282,9 @@ - + - + @@ -285,11 +292,24 @@ payment/fintecture_bnpl/sort_order - + + + + + + + + + Magento\Config\Model\Config\Source\Yesno + Recommend the payment method on checkout page + payment/fintecture_bnpl/recommend_bnpl_badge + + + - + Fintecture\Payment\Block\Adminhtml\System\Config\Form\Version @@ -304,7 +324,7 @@ - + diff --git a/etc/config.xml b/etc/config.xml index 33d2746..5f6f6e9 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -37,6 +37,7 @@ 0 qrcode it + 0 0 @@ -54,6 +55,7 @@ Fintecture 0 FR + 0 diff --git a/etc/events.xml b/etc/events.xml index 167b5c2..5b48578 100644 --- a/etc/events.xml +++ b/etc/events.xml @@ -3,10 +3,4 @@ - - - - - - \ No newline at end of file diff --git a/etc/module.xml b/etc/module.xml index 8dd8dd4..d6b0b60 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,7 +1,7 @@ - + diff --git a/i18n/en_US.csv b/i18n/en_US.csv index deed47d..2ee1289 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -3,17 +3,17 @@ "A partial payment has been made.","A partial payment has been made." "A problem occurred during the payment initiation with Fintecture. Please try again or choose another payment method.","A problem occurred during the payment initiation with Fintecture. Please try again or choose another payment method." "Accepted payment","Accepted payment" -"Advanced Settings","Advanced Settings" +"Advanced settings","Advanced settings" "All","All" "Allow your professional buyers to buy now and pay later directly from your check-out. An innovative solution made for B2B merchants looking to boost their sales.","Allow your professional buyers to buy now and pay later directly from your check-out. An innovative solution made for B2B merchants looking to boost their sales." "Alternative payment methods for 'Login as Customer' feature","Alternative payment methods for 'Login as Customer' feature" "Amount","Amount" "Automatic expiration of pending orders after","Automatic expiration of pending orders after" "Automatic expiration of pending orders","Automatic expiration of pending orders" -"Bank Type","Bank Type" +"Bank type","Bank type" "Buy Now Pay Later","Buy Now Pay Later" "Can't save the private key","Can't save the private key" -"Checkout Design","Checkout Design" +"Checkout design","Checkout design" "Choose how to send your payment link","Choose how to send your payment link" "Choose the alternative payment method for 'Login as Customer' feature","Choose the alternative payment method for 'Login as Customer' feature" "Choose to pay by","Choose to pay by" @@ -26,7 +26,7 @@ "Corporate","Corporate" "Custom field for the reconciliation","Custom field for the reconciliation" "Debit ","Debit " -"Design Options","Design Options" +"Design options","Design options" "Enable alternative payment methods for 'Login as Customer' feature","Enable alternative payment methods for 'Login as Customer' feature" "Enable automatic expiration of pending orders","Enable automatic expiration of pending orders" "Enable custom field for the reconciliation","Enable custom field for the reconciliation" @@ -36,9 +36,9 @@ "Failed payment","Failed payment" "Filter the bank type","Filter the bank type" "Fintecture APP ID","Fintecture APP ID" -"Fintecture APP Secret","Fintecture APP Secret" +"Fintecture APP secret","Fintecture APP secret" "Fintecture is a payment institution supervised by the Banque de France and the ACPR under the N°17248.","Fintecture is a payment institution supervised by the Banque de France and the ACPR under the N°17248." -"Fintecture Private Key","Fintecture Private Key" +"Fintecture private key","Fintecture private key" "How it works?","How it works?" "How to make an immediate transfer?","How to make an immediate transfer?" "If the payment has been made, then the order will be validated in a few moments.","If the payment has been made, then the order will be validated in a few moments." @@ -52,7 +52,7 @@ "Invalid request","Invalid request" "Invoicing","Invoicing" "Login with your usual banking ID's","Login with your usual banking ID's" -"Long Version","Long Version" +"Long version","Long version" "Module version:","Module version:" "New order status","New order status" "No private key file found","No private key file found" @@ -72,16 +72,16 @@ "Pay","Pay" "Payment by QR Code","Payment by QR Code" "Payment by SMS or Email","Payment by SMS or Email" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Payment Options","Payment Options" +"Payment from applicable countries","Payment from applicable countries" +"Payment from specific countries","Payment from specific countries" +"Payment options","Payment options" "Payment status mapping between Fintecture and Magento","Payment status mapping between Fintecture and Magento" "Payment was initiated but has not been confirmed yet. Merchant will send confirmation once the transaction is settled.","Payment was initiated but has not been confirmed yet. Merchant will send confirmation once the transaction is settled." "Pending payment","Pending payment" -"Please re-upload Private Key file","Please re-upload Private Key file" +"Please re-upload private key file","Please re-upload private key file" "Please select the message you want to display on your checkout page, depending on the payment solutions you have.","Please select the message you want to display on your checkout page, depending on the payment solutions you have." -"Please upload Private Key file","Please upload Private Key file" -"Private Key file already saved","Private Key file already saved" +"Please upload private key file","Please upload private key file" +"Private key file already saved","Private key file already saved" "Production","Production" "Retail","Retail" "Return to the homepage","Return to the homepage" @@ -93,13 +93,13 @@ "Send by Email","Send by Email" "Send by SMS","Send by SMS" "Settings","Settings" -"Short Version","Short Version" -"Show Logo","Show Logo" +"Short version","Short version" +"Show logo","Show logo" "Smart Transfer","Smart Transfer" "Some fields are empty","Some fields are empty" "Sorry, something went wrong. Please try again later.","Sorry, something went wrong. Please try again later." -"Sort Order","Sort Order" -"Test Connection","Test Connection" +"Sort order","Sort order" +"Test connection","Test connection" "The bank is validating the payment.","The bank is validating the payment." "The order is confirmed, you will receive the funds under 30 days.","The order is confirmed, you will receive the funds under 30 days." "The payer got redirected to their bank and needs to authenticate.","The payer got redirected to their bank and needs to authenticate." @@ -125,3 +125,6 @@ "You will be automatically redirected to your secured bank environment to confirm your payment.","You will be automatically redirected to your secured bank environment to confirm your payment." "Your payment link has been sent successfully","Your payment link has been sent successfully" "Your purchase is confirmed!","Your purchase is confirmed!" +"""Recommended"" badge", """Recommended"" badge" +"Recommend the payment method on checkout page","Recommend the payment method on checkout page" +"RECOMMENDED","RECOMMENDED" \ No newline at end of file diff --git a/i18n/es_ES.csv b/i18n/es_ES.csv index 4541bc6..191d46e 100644 --- a/i18n/es_ES.csv +++ b/i18n/es_ES.csv @@ -1,5 +1,5 @@ "All","Todo" -"Bank Type","Tipo de banco" +"Bank type","Tipo de banco" "Confirm your payment securely","Confirma tu pago de forma segura" "Connection did not succeed. Make sure you have entered the right parameters.","La conexión ha fallado. Asegúrate de haber introducido los parámetros correctos." "Connection succeeded","Conexión exitosa" @@ -7,9 +7,9 @@ "Enabled","Activado" "Environment","Espacio" "Filter the bank type","Filtrar el tipo de banco" -"Fintecture APP ID","App ID de Fintecture" -"Fintecture APP Secret","App Secret de Fintecture" -"Fintecture Private Key","Clave privada de Fintecture" +"Fintecture APP ID","APP ID de Fintecture" +"Fintecture APP secret","App secret de Fintecture" +"Fintecture private key","Clave privada de Fintecture" "Settings","Ajustes" "How it works?","¿Cómo funciona?" "Instant bank payment","Pago bancario inmediato" @@ -18,20 +18,20 @@ "Pay for your purchases instantly and securely.","Paga tus compras de forma inmediata y segura." "Pay instantly and securely directly from your bank account.
Collect payments without any credit limit. Reduce your transaction fees by 40%!","Paga de forma inmediata y segura directamente desde tu aplicación bancaria.
Cobra sin límite de crédito. ¡Reduce tus gastos de transacción en un 40%!" "Pay Now","Pagar ahora" -"Payment from Applicable Countries","Pagos de Países Aplicables" -"Payment from Specific Countries","Pagos de Países Específicos" -"Payment Options","Opciones de pago" +"Payment from applicable countries","Pagos de países aplicables" +"Payment from specific countries","Pagos de países específicos" +"Payment options","Opciones de pago" "Payment pending","Pagos pendientes" "Payment was initiated but has not been confirmed yet. Merchant will send confirmation once the transaction is settled.","El pago se ha iniciado pero aún no se ha confirmado. La empresa enviará la confirmación una vez que se haya liquidado la transacción." -"Please re-upload Private Key file","Por favor, vuelve a cargar el archivo de Clave Privada" -"Please upload Private Key file","Por favor, carga el archivo de Clave Privada" -"Private Key file already saved","Archivo de Clave Privada guardado" +"Please re-upload private key file","Por favor, vuelve a cargar el archivo de clave privada" +"Please upload private key file","Por favor, carga el archivo de clave privada" +"Private key file already saved","Archivo de Clave Privada guardado" "Production","Producción" "Retail","Venta al por menor" "Sandbox","Sandbox" "Select your bank","Selecciona tu banco" "Show logo at checkout","Mostrar logo en caja" -"Show Logo","Mostrar logo" +"Show logo","Mostrar logo" "Technical Error","Error técnico" "Test Connection","Conexión de prueba" "The buyer has either abandoned the payment flow on the banks web page","El comprador ha abandonado el proceso de pago en la página web del banco" diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv index 6d3b06c..9fe6a47 100644 --- a/i18n/fr_FR.csv +++ b/i18n/fr_FR.csv @@ -3,17 +3,17 @@ "A partial payment has been made.","Un paiement partiel a été effectué." "A problem occurred during the payment initiation with Fintecture. Please try again or choose another payment method.","Un problème est survenu lors de l'initiation du paiement avec Fintecture. Veuillez réessayer ou choisir un autre mode de paiement." "Accepted payment","Paiement accepté" -"Advanced Settings","Paramètres avancés" +"Advanced settings","Paramètres avancés" "All","Tous" "Allow your professional buyers to buy now and pay later directly from your check-out. An innovative solution made for B2B merchants looking to boost their sales.","Permettez à vos clients professionnels d'acheter maintenant et de payer plus tard directement depuis votre checkout. Une solution innovante conçue pour les marchands B2B qui cherchent à faire décoller leur chiffre d'affaires et booster leurs ventes." "Alternative payment methods for 'Login as Customer' feature","Méthodes de paiement alternatives pour la fonction ""Se connecter en tant que client""" "Amount","Montant" "Automatic expiration of pending orders after","Expiration automatique des commandes en attente après" "Automatic expiration of pending orders","Expiration automatique des commandes en cours" -"Bank Type","Type de banque" +"Bank type","Type de banque" "Buy Now Pay Later","Buy Now Pay Later" "Can't save the private key","Impossible d'enregistrer la clé privée" -"Checkout Design","Affichage sur la page de paiement" +"Checkout design","Affichage sur la page de paiement" "Choose how to send your payment link","Choisissez comment envoyer votre lien de paiement" "Choose the alternative payment method for 'Login as Customer' feature","Choisissez la méthode de paiement alternative pour la fonction ""Se connecter en tant que client""." "Choose to pay by","Choisissez de payer par" @@ -26,7 +26,7 @@ "Corporate","Entreprise" "Custom field for the reconciliation","Champ personnalisé pour le rapprochement" "Debit ","Prélèvement" -"Design Options","Options d'affichage" +"Design options","Options d'affichage" "Enable alternative payment methods for 'Login as Customer' feature","Activer d'autres méthodes de paiement pour la fonction ""Se connecter en tant que client""" "Enable automatic expiration of pending orders","Activer l'expiration automatique des commandes en attente" "Enable custom field for the reconciliation","Activer le champ personnalisé pour le rapprochement" @@ -36,23 +36,23 @@ "Failed payment","Échec du paiement" "Filter the bank type","Filter le type de banque" "Fintecture APP ID","Fintecture APP ID" -"Fintecture APP Secret","Fintecture APP Secret" +"Fintecture APP secret","Fintecture APP secret" "Fintecture is a payment institution supervised by the Banque de France and the ACPR under the N°17248.","Fintecture est un établissement de paiement supervisé par la Banque de France et l'ACPR sous le N°17248." -"Fintecture Private Key","Clé privée de Fintecture" +"Fintecture private key","Clé privée de Fintecture" "How it works?","Comment ça marche ?" "How to make an immediate transfer?","Comment faire un virement immédiat ?" "If the payment has been made, then the order will be validated in a few moments.","Si le paiement a été effectué, la commande sera validée dans quelques instants." "If you activate this feature without having the option on your Fintecture account, your users will see an error on the payment page.","Si vous activez cette fonctionnalité sans avoir l'option sur votre compte Fintecture, vos utilisateurs verront une erreur sur la page de paiement." "Immediate Transfer & Smart Transfer","Virement Immédiat et Virement Intelligent" "immediate transfer","virement immédiat" -"Immediate Transfer","Virement Immédiat" +"Immediate Transfer","Virement immédiat" "In 30 days","Dans 30 jours" "In minutes. Minimum value: 3","En minutes. Valeur minimale : 3" "Instant bank payment","Virement immédiat" "Invalid request","Reqûete non valide" "Invoicing","Facturation" "Login with your usual banking ID's","Connectez-vous avec vos identifiants bancaires habituels" -"Long Version","Version longue" +"Long version","Version longue" "Module version:","Version du module :" "New order status","Statut de la nouvelle commande" "No private key file found","Aucun fichier de clé privée n'a été trouvé" @@ -72,16 +72,16 @@ "Pay","Payer" "Payment by QR Code","Paiement par QR Code" "Payment by SMS or Email","Paiement par SMS ou par e-mail" -"Payment from Applicable Countries","Paiement à partir des pays autorisés" -"Payment from Specific Countries","Paiement à partir de pays spécifiques" -"Payment Options","Option de paiement" +"Payment from applicable countries","Paiement à partir des pays autorisés" +"Payment from specific countries","Paiement à partir de pays spécifiques" +"Payment options","Option de paiement" "Payment status mapping between Fintecture and Magento","Mappage des statuts de paiement entre Fintecture et Magento" "Payment was initiated but has not been confirmed yet. Merchant will send confirmation once the transaction is settled.","Le paiement a été initié mais n'a pas encore été confirmé. Le marchand enverra une confirmation une fois la transaction réglée." "Pending payment","Paiement en attente" -"Please re-upload Private Key file","Veuillez télécharger à nouveau le fichier de la clé privée" +"Please re-upload private key file","Veuillez télécharger à nouveau le fichier de la clé privée" "Please select the message you want to display on your checkout page, depending on the payment solutions you have.","Veuillez choisir le message que vous voulez afficher sur votre page de paiement, selon les solutions de paiement dont vous disposez." -"Please upload Private Key file","Veuillez télécharger le fichier de la clé privée" -"Private Key file already saved","Fichier de clé privée déjà enregistré" +"Please upload private key file","Veuillez télécharger le fichier de la clé privée" +"Private key file already saved","Fichier de clé privée déjà enregistré" "Production","Production" "QR Code error: no URL provided","Erreur de QR Code : pas d'URL fournie" "Retail","Particulier" @@ -94,13 +94,13 @@ "Send by Email","Envoyer par mail" "Send by SMS","Envoyer par SMS" "Settings","Paramètres" -"Short Version","Version courte" -"Show Logo","Afficher le logo" +"Short version","Version courte" +"Show logo","Afficher le logo" "Smart Transfer","Virement Intelligent" "Some fields are empty","Certains champs sont vides" "Sorry, something went wrong. Please try again later.","Désolé, quelque chose s'est mal passé. Veuillez réessayer plus tard." -"Sort Order","Ordre de tri" -"Test Connection","Test de connexion" +"Sort order","Ordre de tri" +"Test connection","Test de connexion" "The bank is validating the payment.","La banque valide le paiement." "The order is confirmed, you will receive the funds under 30 days.","La commande est confirmée, vous recevrez les fonds sous 30 jours." "The payer got redirected to their bank and needs to authenticate.","Le payeur a été redirigé vers sa banque et doit s'authentifier." @@ -124,4 +124,7 @@ "You are a professional, buy now and pay in 30 days without any fees on the transaction.","Vous êtes un professionnel, achetez maintenant et payez dans 30 jours sans aucun frais sur la transaction." "You will be automatically redirected to your secured bank environment to confirm your payment.","Vous serez automatiquement redirigé vers votre environnement bancaire sécurisé pour confirmer votre paiement." "Your payment link has been sent successfully","Votre lien de paiement a bien été envoyé" -"Your purchase is confirmed!","Votre achat est confirmé !" \ No newline at end of file +"Your purchase is confirmed!","Votre achat est confirmé !" +"""Recommended"" badge", "Badge ""recommandé""" +"Recommend the payment method on checkout page","Recommander la méthode de paiement dans la page de paiement" +"RECOMMENDED","RECOMMANDÉ" \ No newline at end of file diff --git a/tests/Model/BankTypeTest.php b/tests/Model/BankTypeTest.php new file mode 100644 index 0000000..34833c3 --- /dev/null +++ b/tests/Model/BankTypeTest.php @@ -0,0 +1,23 @@ +toOptionArray(); + $this->assertIsArray($toOptionArray); + } +} diff --git a/view/frontend/web/css/style.css b/view/frontend/web/css/style.css index 783248b..3f81329 100644 --- a/view/frontend/web/css/style.css +++ b/view/frontend/web/css/style.css @@ -128,6 +128,16 @@ font-weight: bold; } +.fintecture-badge { + background-color: #2a45a7; + padding: 2px 8px; + font-size: 12px; + border-radius: 13px; + color: #FFF; + font-weight: 700; + margin-left: 10px; +} + @media screen and (max-width: 640px) { .checkout_block { padding-left: 32px; diff --git a/view/frontend/web/js/view/payment/method-renderer/fintecture-bnpl.js b/view/frontend/web/js/view/payment/method-renderer/fintecture-bnpl.js index e59969f..cf5fda1 100644 --- a/view/frontend/web/js/view/payment/method-renderer/fintecture-bnpl.js +++ b/view/frontend/web/js/view/payment/method-renderer/fintecture-bnpl.js @@ -36,5 +36,8 @@ define([ return format.replace(/%s/g, amount); }, + isRecommendedBnplBadgeActive: function () { + return window.checkoutConfig.payment.fintecture_bnpl.recommendBnplBadge; + } }); }); diff --git a/view/frontend/web/js/view/payment/method-renderer/fintecture-payment.js b/view/frontend/web/js/view/payment/method-renderer/fintecture-payment.js index 86834e8..da9396d 100644 --- a/view/frontend/web/js/view/payment/method-renderer/fintecture-payment.js +++ b/view/frontend/web/js/view/payment/method-renderer/fintecture-payment.js @@ -15,6 +15,9 @@ define([ }, getCheckoutDesign: function () { return window.checkoutConfig.payment.fintecture.checkoutDesign; + }, + isRecommendedItBadgeActive: function () { + return window.checkoutConfig.payment.fintecture.recommendItBadge; } }); }); diff --git a/view/frontend/web/template/payment/fintecture-bnpl.html b/view/frontend/web/template/payment/fintecture-bnpl.html index b6c0a5a..95ce337 100644 --- a/view/frontend/web/template/payment/fintecture-bnpl.html +++ b/view/frontend/web/template/payment/fintecture-bnpl.html @@ -5,6 +5,9 @@ + + +
diff --git a/view/frontend/web/template/payment/fintecture.html b/view/frontend/web/template/payment/fintecture.html index ac4b07c..8126d6a 100644 --- a/view/frontend/web/template/payment/fintecture.html +++ b/view/frontend/web/template/payment/fintecture.html @@ -4,17 +4,20 @@ data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"> + + +