diff --git a/.github/workflows/templates/magento/configure-mollie.sh b/.github/workflows/templates/magento/configure-mollie.sh index 3cab4876433..bb108fb6b65 100644 --- a/.github/workflows/templates/magento/configure-mollie.sh +++ b/.github/workflows/templates/magento/configure-mollie.sh @@ -1,3 +1,8 @@ +# +# Copyright Magmodules.eu. All rights reserved. +# See COPYING.txt for license details. +# + if [ -z "$MOLLIE_API_KEY_TEST" ]; then echo "Variable \$MOLLIE_API_KEY_TEST is not set" exit 1 @@ -23,6 +28,7 @@ bin/magento config:set payment/mollie_methods_paypal/active 1 & bin/magento config:set payment/mollie_methods_przelewy24/active 1 & bin/magento config:set payment/mollie_methods_alma/active 1 & bin/magento config:set payment/mollie_methods_bancontact/active 1 & +bin/magento config:set payment/mollie_methods_bancomatpay/active 1 & bin/magento config:set payment/mollie_methods_belfius/active 1 & bin/magento config:set payment/mollie_methods_eps/active 1 & bin/magento config:set payment/mollie_methods_giropay/active 1 & diff --git a/Helper/General.php b/Helper/General.php index 887b8f3a249..12de810bf54 100755 --- a/Helper/General.php +++ b/Helper/General.php @@ -621,6 +621,7 @@ public function getAllActiveMethods($storeId) $methodCodes = [ 'mollie_methods_applepay', 'mollie_methods_alma', + 'mollie_methods_bancomatpay', 'mollie_methods_bancontact', 'mollie_methods_banktransfer', 'mollie_methods_belfius', diff --git a/Model/Methods/Bancomatpay.php b/Model/Methods/Bancomatpay.php new file mode 100644 index 00000000000..282a9a027e4 --- /dev/null +++ b/Model/Methods/Bancomatpay.php @@ -0,0 +1,24 @@ + { const availableMethods = Cypress.env('mollie_available_methods'); [ 'alma', + 'bancomatpay', 'bancontact', 'banktransfer', 'belfius', diff --git a/Test/End-2-end/cypress/e2e/magento/methods/bancomatpay.cy.js b/Test/End-2-end/cypress/e2e/magento/methods/bancomatpay.cy.js new file mode 100644 index 00000000000..03544549aee --- /dev/null +++ b/Test/End-2-end/cypress/e2e/magento/methods/bancomatpay.cy.js @@ -0,0 +1,60 @@ +/* + * Copyright Magmodules.eu. All rights reserved. + * See COPYING.txt for license details. + */ + +import CheckoutPaymentPage from "Pages/frontend/CheckoutPaymentPage"; +import VisitCheckoutPaymentCompositeAction from "CompositeActions/VisitCheckoutPaymentCompositeAction"; +import MollieHostedPaymentPage from "Pages/mollie/MollieHostedPaymentPage"; +import CheckoutSuccessPage from "Pages/frontend/CheckoutSuccessPage"; +import OrdersPage from "Pages/backend/OrdersPage"; +import CartPage from "Pages/frontend/CartPage"; + +const checkoutPaymentPage = new CheckoutPaymentPage(); +const visitCheckoutPayment = new VisitCheckoutPaymentCompositeAction(); +const mollieHostedPaymentPage = new MollieHostedPaymentPage(); +const checkoutSuccessPage = new CheckoutSuccessPage(); +const ordersPage = new OrdersPage(); +const cartPage = new CartPage(); + +if (Cypress.env('mollie_available_methods').includes('bancomatpay')) { + describe('Check that bancomatpay behaves as expected', () => { + [ + {status: 'paid', orderStatus: 'Processing', title: 'C3190598: Validate the submission of an order with Bancomat Pay as payment method and payment mark as "Paid"'}, + {status: 'failed', orderStatus: 'Canceled', title: 'C3190599: Validate the submission of an order with Bancomat Pay as payment method and payment mark as "Failed" '}, + {status: 'expired', orderStatus: 'Canceled', title: 'C3190600: Validate the submission of an order with Bancomat Pay as payment method and payment mark as "Expired" '}, + {status: 'canceled', orderStatus: 'Canceled', title: 'C3190601: Validate the submission of an order with Bancomat Pay as payment method and payment mark as "Cancelled" '}, + ].forEach((testCase) => { + it(testCase.title, () => { + visitCheckoutPayment.visit(); + + cy.intercept('mollie/checkout/redirect/paymentToken/*').as('mollieRedirect'); + + checkoutPaymentPage.selectPaymentMethod('Bancomat Pay'); + checkoutPaymentPage.placeOrder(); + + mollieHostedPaymentPage.selectStatus(testCase.status); + + if (testCase.status === 'paid') { + checkoutSuccessPage.assertThatOrderSuccessPageIsShown(); + } + + if (testCase.status === 'canceled') { + cartPage.assertCartPageIsShown(); + } + + cy.backendLogin(); + + cy.get('@order-id').then((orderId) => { + ordersPage.openOrderById(orderId); + }); + + if (testCase.status === 'expired') { + ordersPage.callFetchStatus(); + } + + ordersPage.assertOrderStatusIs(testCase.orderStatus); + }); + }); + }) +} diff --git a/Test/Integration/Etc/Config/MethodsConfigurationTest.php b/Test/Integration/Etc/Config/MethodsConfigurationTest.php index b5dd4a45797..a4ee19885f8 100644 --- a/Test/Integration/Etc/Config/MethodsConfigurationTest.php +++ b/Test/Integration/Etc/Config/MethodsConfigurationTest.php @@ -16,6 +16,7 @@ public function methods(): array return [ ['mollie_methods_applepay'], ['mollie_methods_alma'], + ['mollie_methods_bancomatpay'], ['mollie_methods_bancontact'], ['mollie_methods_banktransfer'], ['mollie_methods_belfius'], diff --git a/Test/Integration/Helper/GeneralTest.php b/Test/Integration/Helper/GeneralTest.php index 2361be46d23..1dd7fb46fab 100644 --- a/Test/Integration/Helper/GeneralTest.php +++ b/Test/Integration/Helper/GeneralTest.php @@ -143,6 +143,7 @@ public function getMethodCodeDataProvider() 'applepay' => ['mollie_methods_applepay', 'applepay'], 'alma' => ['mollie_methods_alma', 'alma'], + 'bancomatpay' => ['mollie_methods_bancomatpay', 'bancomatpay'], 'bancontact' => ['mollie_methods_bancontact', 'bancontact'], 'banktransfer' => ['mollie_methods_banktransfer', 'banktransfer'], 'belfius' => ['mollie_methods_belfius', 'belfius'], diff --git a/Test/Integration/Model/Methods/BancomatpayTest.php b/Test/Integration/Model/Methods/BancomatpayTest.php new file mode 100644 index 00000000000..f50575aeeb5 --- /dev/null +++ b/Test/Integration/Model/Methods/BancomatpayTest.php @@ -0,0 +1,16 @@ +assertArrayHasKey('mollie_methods_applepay', $result['payment']['image']); $this->assertArrayHasKey('mollie_methods_alma', $result['payment']['image']); + $this->assertArrayHasKey('mollie_methods_bancomatpay', $result['payment']['image']); $this->assertArrayHasKey('mollie_methods_bancontact', $result['payment']['image']); $this->assertArrayHasKey('mollie_methods_banktransfer', $result['payment']['image']); $this->assertArrayHasKey('mollie_methods_belfius', $result['payment']['image']); diff --git a/Test/Integration/Service/Config/PaymentFeeTest.php b/Test/Integration/Service/Config/PaymentFeeTest.php index 13388b2c0e3..dc680f8e83a 100644 --- a/Test/Integration/Service/Config/PaymentFeeTest.php +++ b/Test/Integration/Service/Config/PaymentFeeTest.php @@ -25,6 +25,7 @@ public function isAvailableForMethodProvider() return [ ['mollie_methods_applepay', true], ['mollie_methods_alma', true], + ['mollie_methods_bancomatpay', true], ['mollie_methods_bancontact', true], ['mollie_methods_banktransfer', true], ['mollie_methods_belfius', true], diff --git a/Test/Integration/Service/Mollie/Order/CreateInvoiceOnShipmentTest.php b/Test/Integration/Service/Mollie/Order/CreateInvoiceOnShipmentTest.php index fa68bb60df7..53e3c288c86 100644 --- a/Test/Integration/Service/Mollie/Order/CreateInvoiceOnShipmentTest.php +++ b/Test/Integration/Service/Mollie/Order/CreateInvoiceOnShipmentTest.php @@ -2,7 +2,6 @@ namespace Mollie\Payment\Test\Integration\Service\Mollie\Order; -use Mollie\Payment\Model\Adminhtml\Source\InvoiceMoment; use Mollie\Payment\Model\Methods\Bancontact; use Mollie\Payment\Model\Methods\Banktransfer; use Mollie\Payment\Model\Methods\Billie; diff --git a/composer.json b/composer.json index e10f2156b2c..70736e173ef 100644 --- a/composer.json +++ b/composer.json @@ -9,6 +9,8 @@ "apple pay", "alma", "bancontact", + "bancomat", + "bancomat pay", "banktransfer", "belfius", "belfius direct net", diff --git a/etc/adminhtml/methods.xml b/etc/adminhtml/methods.xml index d3402c05eb3..7a31d6028ce 100644 --- a/etc/adminhtml/methods.xml +++ b/etc/adminhtml/methods.xml @@ -7,6 +7,7 @@ + diff --git a/etc/adminhtml/methods/bancomatpay.xml b/etc/adminhtml/methods/bancomatpay.xml new file mode 100644 index 00000000000..98a7ad21326 --- /dev/null +++ b/etc/adminhtml/methods/bancomatpay.xml @@ -0,0 +1,156 @@ + + + + + + + + + Magento\Config\Model\Config\Source\Yesno + payment/mollie_methods_bancomatpay/active + + + + payment/mollie_methods_bancomatpay/title + + 1 + + + + + Mollie\Payment\Model\Adminhtml\Source\Method + payment/mollie_methods_bancomatpay/method + + 1 + + here + to read more about the differences between the Payment and Orders API.]]> + + + + payment/mollie_methods_bancomatpay/payment_description + + + payment + 1 + + + + + validate-digits-range digits-range-1-365 + payment/mollie_methods_bancomatpay/days_before_expire + + 1 + order + + How many days before orders for this method becomes expired? Leave empty to use default expiration (28 days) + + + + Magento\Payment\Model\Config\Source\Allspecificcountries + payment/mollie_methods_bancomatpay/allowspecific + + 1 + + + + + Magento\Directory\Model\Config\Source\Country + 1 + payment/mollie_methods_bancomatpay/specificcountry + + 1 + + + + + payment/mollie_methods_bancomatpay/min_order_total + + 1 + + + + + payment/mollie_methods_bancomatpay/max_order_total + + 1 + + + + + payment/mollie_methods_bancomatpay/payment_surcharge_type + Mollie\Payment\Model\Adminhtml\Source\PaymentFeeType + + 1 + + + + + payment/mollie_methods_bancomatpay/payment_surcharge_fixed_amount + Mollie\Payment\Model\Adminhtml\Backend\VerifiyPaymentFee + validate-not-negative-number + + 1 + fixed_fee,fixed_fee_and_percentage + + + + + payment/mollie_methods_bancomatpay/payment_surcharge_percentage + Mollie\Payment\Model\Adminhtml\Backend\VerifiyPaymentFee + validate-number-range number-range-0-10 + + 1 + percentage,fixed_fee_and_percentage + + + + + payment/mollie_methods_bancomatpay/payment_surcharge_limit + + Mollie\Payment\Model\Adminhtml\Backend\VerifiyPaymentFee + validate-not-negative-number + + 1 + percentage,fixed_fee_and_percentage + + + + + payment/mollie_methods_bancomatpay/payment_surcharge_tax_class + \Magento\Tax\Model\TaxClass\Source\Product + + 1 + fixed_fee,percentage,fixed_fee_and_percentage + + + + + validate-number + payment/mollie_methods_bancomatpay/sort_order + + 1 + + + + diff --git a/etc/adminhtml/methods/bancontact.xml b/etc/adminhtml/methods/bancontact.xml index 74a44308b04..28fbf32e411 100644 --- a/etc/adminhtml/methods/bancontact.xml +++ b/etc/adminhtml/methods/bancontact.xml @@ -1,7 +1,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -109,6 +114,25 @@ 0 1 + + 1 + Mollie\Payment\Model\Methods\Bancomatpay + Bancomat Pay + {ordernumber} + payment + order + 0 + + 1 + 1 + 1 + 1 + 0 + 1 + 0 + 0 + 1 + 1 Mollie\Payment\Model\Methods\Banktransfer diff --git a/etc/di.xml b/etc/di.xml index 9fb71038043..7eb6a9fdbe6 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -1,4 +1,9 @@ + + @@ -507,6 +512,51 @@ + + + + Magento\Payment\Block\Form + Mollie\Payment\Block\Info\Base + MollieBancomatpayValueHandlerPool + MollieCommandPool + MollieBancomatpayValidatorPool + + + + + + + MollieBancomatpayConfigValueHandler + + + + + + + MollieBancomatpayConfig + + + + + + Mollie\Payment\Model\Methods\Bancomatpay::CODE + + + + + + + MollieBancomatpayCountryValidator + + + + + + + MollieBancomatpayConfig + + + diff --git a/etc/graphql/di.xml b/etc/graphql/di.xml index 5017366df3e..bffa9f50add 100644 --- a/etc/graphql/di.xml +++ b/etc/graphql/di.xml @@ -10,6 +10,7 @@ Mollie\Payment\GraphQL\DataProvider Mollie\Payment\GraphQL\DataProvider + Mollie\Payment\GraphQL\DataProvider Mollie\Payment\GraphQL\DataProvider Mollie\Payment\GraphQL\DataProvider Mollie\Payment\GraphQL\DataProvider diff --git a/etc/payment.xml b/etc/payment.xml index 16c2a8ede56..774d1d7a692 100644 --- a/etc/payment.xml +++ b/etc/payment.xml @@ -15,6 +15,9 @@ 0 + + 0 + 0 diff --git a/i18n/de_DE.csv b/i18n/de_DE.csv index 55074350eb4..5f5c7067919 100644 --- a/i18n/de_DE.csv +++ b/i18n/de_DE.csv @@ -194,6 +194,7 @@ "Sorting Order","Sortierreihenfolge" "Alma","Alma" "Bancontact","Bancontact" +"Bancomat Pay","Bancomat Pay" "Banktransfer","Banküberweisung" "Status Pending","Status ausstehend" "We recommend using another 'pending' status as the default Magento pending status can automatically cancel the order before the payment expiry time is reached.
By default the status ""Pending Payment"" is not visible for customers, therefore we advise you to create a new status for this, which should also be visible to the customer, informing them they still have to complete their payment.","Wir empfehlen, einen anderen als den standardmäßigen ausstehenden Status von Magento zu verwenden, da die Zahlung bei diesem vor Ablauf der Zahlungsfrist automatisch storniert werden kann.
Standardmäßig ist der Status „Ausstehende Zahlung“ für den Kunden nicht sichtbar. Wir empfehlen Ihnen daher, einen neuen Status zu erstellen, der auch für den Kunden sichtbar ist und ihm mitteilt, dass er die Zahlung noch vervollständigen muss." diff --git a/i18n/en_US.csv b/i18n/en_US.csv index b09a1b55a5c..47dd21fa85c 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -194,6 +194,7 @@ "Sorting Order","Sorting Order" "Alma","Alma" "Bancontact","Bancontact" +"Bancomat Pay","Bancomat Pay" "Banktransfer","Banktransfer" "Status Pending","Status Pending" "We recommend using another 'pending' status as the default Magento pending status can automatically cancel the order before the payment expiry time is reached.
By default the status ""Pending Payment"" is not visible for customers, therefore we advise you to create a new status for this, which should also be visible to the customer, informing them they still have to complete their payment.","We recommend using another 'pending' status as the default Magento pending status can automatically cancel the order before the payment expiry time is reached.
By default the status ""Pending Payment"" is not visible for customers, therefore we advise you to create a new status for this, which should also be visible to the customer, informing them they still have to complete their payment." diff --git a/i18n/es_ES.csv b/i18n/es_ES.csv index b8a8db57c49..c15a6c313dc 100644 --- a/i18n/es_ES.csv +++ b/i18n/es_ES.csv @@ -194,6 +194,7 @@ "Sorting Order","Orden de clasificación" "Alma","Alma" "Bancontact","Contacto bancario" +"Bancomat Pay","Bancomat Pay" "Banktransfer","Transferencia bancaria" "Status Pending","Estado pendiente" "We recommend using another 'pending' status as the default Magento pending status can automatically cancel the order before the payment expiry time is reached.
By default the status ""Pending Payment"" is not visible for customers, therefore we advise you to create a new status for this, which should also be visible to the customer, informing them they still have to complete their payment.","Recomendamos utilizar otro estado 'pendiente', ya que el estado pendiente por defecto de Magento puede cancelar automáticamente el pedido antes de que se llegue a la fecha de vencimiento del pago.
Por defecto, el estado «Pago pendiente» no es visible para los clientes, por lo que le aconsejamos que cree un nuevo estado para esto, que también debería ser visible para el cliente, que le informe de que todavía tiene que completar su pago." diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv index 4128f6df607..364504e61d7 100644 --- a/i18n/fr_FR.csv +++ b/i18n/fr_FR.csv @@ -194,6 +194,7 @@ "Sorting Order","Tri des commandes" "Alma","Alma" "Bancontact","Bancontact" +"Bancomat Pay","Bancomat Pay" "Banktransfer","Virement bancaire" "Status Pending","Statut en attente" "We recommend using another 'pending' status as the default Magento pending status can automatically cancel the order before the payment expiry time is reached.
By default the status ""Pending Payment"" is not visible for customers, therefore we advise you to create a new status for this, which should also be visible to the customer, informing them they still have to complete their payment.","Nous vous recommandons d'utiliser un autre statut «en attente», car le statut en attente Magento par défaut peut annuler automatiquement la commande avant même l'expiration du délai de paiement.
Comme le statut «Paiement en attente» n'est pas visible par défaut par les clients, nous vous recommandons de créer un nouveau statut qui sera visible par la clientèle et l'informera qu'elle doit finaliser son paiement." diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv index ce54e3eba97..159fb1dd14a 100644 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -194,6 +194,7 @@ "Sorting Order","Sorteervolgorde" "Alma","Alma" "Bancontact","Bancontact" +"Bancomat Pay","Bancomat Pay" "Banktransfer","Bankoverschrijving" "Status Pending","Status openstaand" "We recommend using another 'pending' status as the default Magento pending status can automatically cancel the order before the payment expiry time is reached.
By default the status ""Pending Payment"" is not visible for customers, therefore we advise you to create a new status for this, which should also be visible to the customer, informing them they still have to complete their payment.","Wij raden u aan om een andere status voor 'openstaand' te gebruiken, omdat de standaard Magento-status 'openstaand' de bestelling automatisch kan annuleren, voordat de vervaltermijn is afgelopen.
Standaard is de status 'openstaande betaling' niet zichtbaar voor klanten, daarom adviseren wij u om hiervoor een nieuwe status aan te maken, die ook zichtbaar is voor de klant, om hem te laten weten dat hij zijn betaling nog dient te voltooien." diff --git a/view/adminhtml/templates/form/mollie_paymentlink.phtml b/view/adminhtml/templates/form/mollie_paymentlink.phtml index ba4307efcd2..d080dff317c 100644 --- a/view/adminhtml/templates/form/mollie_paymentlink.phtml +++ b/view/adminhtml/templates/form/mollie_paymentlink.phtml @@ -18,6 +18,7 @@ $code; ?>" style="display:none">