LokiCheckout_Worldline
This Magento 2 module is an add-on package to the LokiCheckout.
Installation
Install this package via composer:
composer require loki-checkout/magento2-worldline
Next, enable this module:
bin/magento module:enable LokiCheckout_Worldline
Supported payment methods
| Method | Behaviour |
|---|---|
| worldline_hosted_checkout | Redirect to the Worldline hosted checkout |
| worldline_redirect_payment_<productId> | Redirect to a single Worldline payment product |
| worldline_cc | Credit card through the Worldline hosted-tokenization iframe |
Stored cards (the *_vault methods) are not supported yet and are hidden from the payment method
list by LokiCheckout\Worldline\Plugin\AvailableMethodsFilterPlugin.
How the order is placed
Worldline does not place the Magento order during checkout. BaseCreatePaymentManagement saves the
payment information, reserves an order id, deactivates the quote and preserves it for restoration;
the order is only created once the shopper returns through worldline/returns/*.
LokiCheckout\Worldline\Service\CreatePaymentService therefore replaces the order placement of
LokiCheckout\Core\Step\FinalStep. The payment component throws a
Loki\Components\Exception\RedirectException, which Loki turns into a JSON redirect, so the
checkout never reaches its own placeOrder() call.
This module also replaces the worldline/returns/waiting and worldline/returns/pendingpayment
templates, whose Knockout-based polling never starts on a Hyvä theme.
Regenerating the payment method wiring
Worldline registers one Magento payment method per payment product, so etc/loki_components.xml
and view/frontend/layout/loki_checkout_block_payment_methods.xml list every method individually.
Regenerate both after upgrading worldline/module-magento-payment-redirect-payment:
php dev/generate-payment-method-xml.php vendor/worldline/module-magento-payment-redirect-payment bin/magento cache:flush config
Development without Worldline credentials
loki-checkout/magento2-worldline-dev-tools replaces the Worldline API with local stubs and serves
a stand-in for the hosted payment page, which is what the Playwright tests use.
Current status
@dev
to the composer command.
Support
For getting support, create an Issue under the following project URL:
https://gitlab.yireo.com/loki-checkout/LokiCheckout_Worldline.git
Loki Components
The following LokiComponents are created or references in this module:
loki-checkout.payment.methods.worldline_cc.form
loki-checkout.payment.methods.worldline_hosted_checkout.form
loki-checkout.payment.methods.worldline_redirect_payment_1.form
Module Dependencies
The following dependencies are declared in the module its `etc/module.xml` file:
LokiCheckout_Core
Loki_Base
Loki_Components
Loki_CssUtils
Loki_FieldComponents
Loki_MapComponents
Magento_Backend
Magento_Catalog
Magento_Checkout
Magento_CheckoutAgreements
Magento_Config
Magento_Customer
Magento_Directory
Magento_Eav
Magento_Newsletter
Magento_Payment
Magento_Quote
Magento_Sales
Magento_Shipping
Magento_Store
Magento_Tax
Magento_Vault
Worldline_PaymentCore
Worldline_CreditCard
Worldline_HostedCheckout
Worldline_RedirectPayment
Yireo_CspUtilities
Composer details
LokiCheckout_Worldlineloki-checkout/magento2-worldline
ext-pcre: *
loki-checkout/magento2-core: ^2.0
loki/magento2-components: ^2.0
loki/magento2-css-utils: ^1.0
loki/magento2-field-components: ^2.0
magento/framework: ^103.0
magento/module-checkout: ^100.0
magento/module-payment: ^100.0
magento/module-quote: ^101.0
magento/module-store: ^101.0
php: >=8.2 <8.6
wl-online-payments-direct/sdk-php: >=8.0
worldline/module-magento-payment-core: >=2.50
worldline/module-magento-payment-credit-card: >=1.50
worldline/module-magento-payment-hosted-checkout: >=1.50
worldline/module-magento-payment-redirect-payment: >=1.50
yireo/magento2-csp-utilities: ^1.0
Releases
Changelog
Added
- Support for
worldline_hosted_checkoutand allworldline_redirect_payment_<productId>methods, converted from the Hyvä Checkout moduleworldline/module-magento-theme-hyva. - Support for
worldline_ccthrough the Worldline hosted-tokenization iframe, including the surcharge calculation. Payment/Icon/IconResolverrendering the Worldline payment product, credit card and hosted checkout icons.Plugin/AvailableMethodsFilterPluginhiding payment products that are inactive or unavailable, the umbrellaworldline_redirect_paymentmethod and all vault methods.- Alpine replacements for the
worldline/returns/waitingandworldline/returns/pendingpaymentpages, whose Knockout polling never starts on a Hyvä theme. dev/generate-payment-method-xml.phpto regenerate the per-payment-method component and layout wiring.Step/FinalStep/Task/PreventUnpaidWorldlineOrderTaskas a server-side guarantee that an order can never be placed for a Worldline method that has no Worldline payment attached.
Fixed
- The payment method filter fetched the Worldline payment product list once per payment method, which turned a failing or slow Worldline API call into dozens of blocking requests and stalled the payment step. The list is now fetched once per payment method list.
Removed
Payment/Redirect/RedirectResolver, which can never run: Worldline creates the order after the shopper returns, so Loki Checkout never places an order for a Worldline payment.