Developer notes
Technical reference for developers who customize Worldline Online Payments. Every endpoint, field, status and signature below is taken from the official Worldline documentation (retrieved 2026-11-11); the pages are listed under “Sources”.
Add-on identity
Section titled “Add-on identity”| Item | Value |
|---|---|
| Add-on id | kv_worldline |
| Function prefix | fn_kv_worldline_ |
| Language variables | kv_worldline.* |
| CSS scope | .kv-worldline |
| PHP namespace | Tygh\Addons\KvWorldline |
| Preset | payment (generated by kv new --kind integration --class payment) |
Which Worldline product the add-on talks to
Section titled “Which Worldline product the add-on talks to”Worldline Direct (API v2): the platform of https://docs.direct.worldline-solutions.com/ with the Merchant Portal, a PSPID (merchant id) and the Hosted Checkout Page. It is the current Worldline online platform; the French “Migrate from Sips” chapter and the “Getting started” page (“switch to our new API Direct”) point existing acquiring customers to it. Worldline Connect (the former Ingenico Connect, https://docs.connect.worldline-solutions.com/, API v1, MyCheckout pages) is a different contract and API and is not supported.
A free test account is created at https://signup.direct.preprod.worldline-solutions.com/ (“create a test account … you can upgrade to a paid account at any time”). It gives a pre-production PSPID, an API key and secret (Merchant Portal > Developer > Payment API) and a webhook key and secret (Developer > Webhooks).
Endpoints (all below /v2/{merchantId}/)
Section titled “Endpoints (all below /v2/{merchantId}/)”Base URL test: https://payment.direct.ecom.preprod.worldline-solutions.com, live: https://payment.direct.ecom.worldline-solutions.com (guide “API environment and versioning”: the generic European endpoints; the older host names remain available).
| Add-on call | Request | Used for |
|---|---|---|
Api::ping() |
GET services/testconnection (answer {"result": ...}) |
“Test connection”, daily probe |
Api::createHostedCheckout() |
POST hostedcheckouts |
start of a payment; answer hostedCheckoutId, RETURNMAC, redirectUrl, partialRedirectUrl, merchantReference |
Api::getHostedCheckout() |
GET hostedcheckouts/{hostedCheckoutId} |
read back until a payment exists (valid 3 hours by default, sessionTimeout); status IN_PROGRESS / PAYMENT_CREATED / CANCELLED_BY_CONSUMER |
Api::getPayment() |
GET payments/{paymentId} |
read back afterwards, before every capture / cancel / refund |
Api::capture() |
POST payments/{paymentId}/capture {amount, isFinal} |
capture of an authorisation |
Api::cancel() |
POST payments/{paymentId}/cancel |
cancel an authorisation |
Api::refund() |
POST payments/{paymentId}/refund {amountOfMoney{amount, currencyCode}, reason} |
refund |
Api::getCaptures(), Api::getRefunds() |
GET payments/{paymentId}/captures, /refunds |
reconcile after a lost answer; book refunds made in the Merchant Portal |
Request authentication
Section titled “Request authentication”Manual authentication (“no SDK”) of the developer guide: Authorization: GCS v1HMAC:<API key id>:<base64(HMAC-SHA256(API secret, subject))>, with the subject METHOD \n Content-Type \n Date \n [x-gcs-* headers as "lower-case-name:value" sorted by name, one per line] \n path-with-query \n. Content-Type is application/json for a request with a body and empty without. Date is an RFC 1123 UTC timestamp, identical in the header and the subject, rejected after 5 minutes. Client\Api::authorization() is checked in tests/unit.php against the two signature vectors of the official PHP SDK (V1HmacAuthenticatorTest).
Several attempts on the hosted page
Section titled “Several attempts on the hosted page”The hosted checkout page lets the customer try again after a declined payment (up to 10 attempts unless the payment method limits them), and every attempt is a payment of its own with its own id (“we strongly recommend not building your business operations around” the payment id, Webhooks guide). The add-on therefore never pins the first payment id: while an attempt holds no money the SESSION is read (GetHostedCheckout, createdPaymentOutput.payment = the latest payment) and the id read last is stored; a webhook of the attempt names a payment id as a hint that is read and adopted only when it carries the merchantReference of the row and money. A decline while the session is open changes neither the row (it stays pending) nor the order; the return page (the customer left the page) or the end of the session makes it final.
Mode, account and reference of a payment
Section titled “Mode, account and reference of a payment”Every call about an existing payment uses the mode and the account stored on its row (Client::forTxn): switching the connection from test to live, or toggling the marketplace owner mode, never redirects old payments to another merchant account. The merchantReference is wl<order>-<attempt>-<shop tag> (the tag is 4 hex characters of a hash of the database name and the store secret); a payment whose merchantReference differs from the row’s is ignored and logged (another shop on the same merchant account, a forged id).
Idempotence
Section titled “Idempotence”X-GCS-Idempotence-Key (guide “Idempotent requests”): at most 40 ASCII characters, unique per operation, not reused within 24 hours; a repeat answers with the first outcome and the header X-GCS-Idempotence-Request-Timestamp; 409 while the first request is still processing. Documented for CreatePayment, CancelPayment, RefundPayment, CapturePayment, CompletePayment, CreatePayout and SubsequentPayment. CreateHostedCheckout is not on the list, so the add-on writes its transaction row first, reuses the open session of an order when the customer presses “pay” again (Transactions::openSession), and treats an orphan session as harmless (nothing can be paid on a session nobody was sent to).
The add-on key is random: wl + 32 hex characters (34 characters), generated at insert and stored on the row (PaymentService::newKey), never derived from an auto-increment id (tables restart after a reinstall, a staging copy repeats ids inside the 24 hour window). A capture, cancel or refund row is written BEFORE the call (creating); after a call without an answer the same stored key is sent again, and before that GetCaptures / GetRefunds is read and a matching booking (same amount, id not used by another row) is adopted instead of sending anything. A row that fails permanently before anything was sent becomes failed; a pending refund is only ever resumed by its id (the queue), never replaced by another amount.
The webhook keys of the previous pair are kept for seven days after the webhook key or secret is changed on the Connection page (rotation in the Merchant Portal); rejected webhooks write at most one log row per minute and account.
The guide’s wording differs between pages (“x-gcs-idempotency-key” in the manual authentication examples, “X-GCS-Idempotence-Key” in the idempotence guide and in the SDKs); the add-on sends the SDK spelling.
Webhooks
Section titled “Webhooks”The guide (“Webhooks”) describes the events and the retry schedule (10 min, 1 h, 2 h, 8 h, 24 h; retry-count header) but shows the signature only as SDK code. The add-on follows the official SDK (SignatureValidator): headers X-GCS-KeyId (the webhook key id) and X-GCS-Signature = base64(HMAC-SHA256(webhook secret, raw body)); the secret is looked up by the key id in the account, never taken from the request. The test vector of the SDK (SignatureValidatorTest) runs in tests/unit.php.
The endpoint is index.php?dispatch=kv_worldline.webhook&c=<account>, sent to Worldline with every request in feedbacks.webhooksUrls (the guide recommends it for several shops) and also entered once in the Merchant Portal. Rules: signature first, nothing parsed before it passes; body is one event object (the guide’s examples are lists: both accepted); events of another merchantId are ignored; payment.test is acknowledged; every other event becomes a job (unique per type and payment id) and the answer is 200 OK at once. The job never trusts the body: the state is read back with GetPayment / GetHostedCheckout and the order is moved from that.
Status vocabulary
Section titled “Status vocabulary”From the guide “Statuses” (tables “Possible outcomes” and “Numeric status codes”): the numeric statusOutput.statusCode decides (Transition::fromCode):
| statusCode | Meaning | Local status |
|---|---|---|
| 0, 46, 41, 4, 50, 51, 52, 55, 98 | created, waiting for authentication / bank / result | pending (never cancelled) |
| 5, 56 | authorised, waiting for capture | authorized |
| 91, 92, 99 | capture requested / processing / uncertain | capturing |
| 9 | payment requested (captured) | paid |
| 2, 57, 59 | declined / refused | failed (only final once the page cannot give another attempt) |
| 93 | capture refused: the global status stays 5; seen in GetCaptures | authorized again |
| 1, 6, 64, 75, 96 | cancelled by the customer / session expired / authorisation cancelled | canceled |
| 7, 8, 85 | refunded | refunded (from the refund rows) |
| 84 | declined by the acquirer = paid back to the customer (chargeback) | the status is kept, the reason is shown on the row and logged |
| 61, 62 | authorisation deletion waiting / uncertain | the cancel row is requested, the payment stays authorized until 6 (cancelled) or 63 (rejected: stays authorised) |
| anything else | unknown | pending |
Guards: a late answer never moves a paid payment backwards (Transition::merge), the captured payment object does not turn a refunded payment back into paid, an authorisation does not become pending again, the paid amount and currency must equal the amount the checkout was created for.
order.amountOfMoney.amount is an integer in the smallest currency unit (API reference: EUR 1234 = 12.34, KWD 1234 = 1.234, JPY zero decimals); Money holds the complete ISO 4217 exponent table. Worldline publishes no list of currencies for the hosted checkout (it depends on the account), so an unsupported currency is answered by the API (shown in the log). CS-Cart’s secondary currency is honoured: the order total is converted and sent in the currency the customer sees.
Payment methods and capture
Section titled “Payment methods and capture”Per CS-Cart payment method (processor settings): product ids for hostedCheckoutSpecificInput.paymentProductFilters.restrictTo.products (one id = the customer goes straight to that method), cardPaymentMethodSpecificInput.groupCards, allowedNumberOfPaymentAttempts (1 to 10), and the authorisation mode: SALE (default), PRE_AUTHORIZATION (up to 30 days, partial capture and cancel) or FINAL_AUTHORIZATION (7 days, full capture) in cardPaymentMethodSpecificInput.authorizationMode, with redirectPaymentMethodSpecificInput.requiresApproval for non-card methods (“Authorisation and Direct Sale”). Methods that cannot authorise are charged at once.
Payment product ids (Overview of each method page): Visa 1, American Express 2, Mastercard 3, Maestro 117, Cartes Bancaires 130, Bancontact 3012, iDEAL 809, PayPal 840, Wero 900, Google Pay 320, EPS 5406, TWINT 5407, Przelewy24 3124.
A partial capture closes the authorisation (isFinal: true): one capture per authorisation. Several partial captures of one authorisation are not supported. The captured amount becomes the amount of the payment at once; refunds and “refund in full” are measured against it.
Return URL
Section titled “Return URL”hostedCheckoutSpecificInput.returnUrl receives RETURNMAC and hostedCheckoutId as query parameters (API reference). The add-on stores the RETURNMAC of the CreateHostedCheckout answer, reads the state back with the id it stored (never the one in the URL) and polls up to three times, two seconds apart, only when the RETURNMAC matches. showResultPage is false so the customer is redirected at once. A payment that is still pending never gives the cart back (the customer is sent to the order page); a final failure or cancellation does.
Multi-Vendor
Section titled “Multi-Vendor”Marketplace owner mode (default): every order uses the account of the marketplace owner (account 0). Vendors may open the payment tab but cannot capture, cancel or refund (denied in Access::canMoveMoney, checked server side). With the owner mode off each vendor has their own account (PSPID, keys) in the vendor panel. No split payouts: the public documentation offers no marketplace split for this contract; the marketPlace and subMerchant objects describe sub-merchants to the card schemes and splitPaymentProductFilters splits one order over several payment methods, neither moves money between sellers. A cart with several vendors is paid on the parent order; child orders refund their own share (Transactions::shareLeft).
Structure
Section titled “Structure”| Class | Role |
|---|---|
Client\BaseClient |
HTTP (cURL, TLS verification, timeouts), JSON, per-request signing hook, error mapping, masked logging |
Client\Api |
The Worldline Direct calls and the request signature |
Client |
Client per company, the connection test |
Accounts, Secret |
PSPID, API key and secret, webhook key and secret (test and live), sealed with AES-256-GCM; one account per store owner or per vendor |
Config, Access |
Settings, owner mode, who may see and manage what |
Support |
Pure helpers: product catalogue, locale, merchant reference, idempotence key, redirect safety, the hosted checkout request |
Transition |
Status mapping and the never-backwards rule |
PaymentService |
Start, read-back, capture, cancel, refund, reconcile, order moves |
Transactions |
Payment rows, open session, lookup by merchant reference / payment id |
Queue, Jobs, JobException |
Job queue (back-off 5 min / 15 min / 1 h / 3 h / 12 h), webhook, sync, capture, cancel, refund jobs |
Log |
Event log with masking, filters, CSV, retention |
Webhook |
Signature check, events, headers (with the Authorization fallbacks of PHP-FPM) |
Database tables
Section titled “Database tables”| Table | Purpose |
|---|---|
?:kv_worldline_accounts |
Credentials per company (secrets sealed), last connection check |
?:kv_worldline_log |
Log |
?:kv_worldline_jobs |
Queue |
?:kv_worldline_transactions |
One row per payment attempt: hosted checkout id, payment id, merchant reference, RETURNMAC, authorisation mode, captured and refunded amounts |
?:kv_worldline_ops |
Captures and cancellations of authorisations (row before the call) |
?:kv_worldline_refunds |
Refunds (ours and the ones booked from the Merchant Portal) |
Hooks used
Section titled “Hooks used”PHP: change_order_status_post (capture / refund at an order status), prepare_checkout_payment_methods (hides the method while the add-on cannot start payments), init_templater_post (upgrade synchronizer, only while pending). Template hooks: orders:tabs_extra (payment tab), addons:manage, addons:tabs_content, index:styles (admin). Controllers: kv_worldline (admin, vendor and public), orders.post, payment_notification through the processor script payments/kv_worldline.php.
License
Section titled “License”The domain-bound license client (License\Client) gates the paths that start new payments (fn_kv_worldline_is_active(): the method at checkout and the creation of a hosted checkout session). Money in flight is never blocked: webhooks, the queue, return pages, captures, cancellations, refunds and the order-status triggers keep working. Details: the License tab of the add-on settings.
Test the HTTP layer without Worldline
Section titled “Test the HTTP layer without Worldline”The base URL can be overridden for tests in config.local.php (development only):
$config['kv_worldline_base_url'] = 'http://127.0.0.1:8738';node tests/mock-server/server.js 8738 starts a local stand-in of the API (signature check, idempotence, statuses, webhooks), node tests/e2e/e2e.mjs --root <store dir> runs the HTTP end-to-end test against it (it refuses to run unless the store points at 127.0.0.1), php tests/unit.php runs the unit tests. Fixtures are byte copies of the official examples (tests/fixtures/README.md).
Open items
Section titled “Open items”GET services/testconnection: the schema says{"result": string}, the value is not documented; any HTTP 200 counts as authenticated.- No JSON example for GetHostedCheckout, capture, refund and cancel answers in the guide: the fixtures are built from the OpenAPI schema and the status tables (marked in
tests/fixtures/README.md). - The add-on was never run against the real pre-production platform (no test account is created by us); the owner runs the pre-production smoke test with a real account.
Sources (retrieved 2026-11-11)
Section titled “Sources (retrieved 2026-11-11)”- Hosted Checkout Page: https://docs.direct.worldline-solutions.com/documentation/integrate/hosted-checkout-page/ and https://docs.direct.worldline-solutions.com/en/integration/basic-integration-methods/hosted-checkout-page
- API environment and versioning: https://docs.direct.worldline-solutions.com/en/integration/api-developer-guide/api
- Authentication, manual authentication: https://docs.direct.worldline-solutions.com/en/integration/api-developer-guide/authentication and
/manual-authentication - Idempotent requests:
/idempotent-requests; Webhooks:/webhooks; Statuses:/statuses; Maintenance operations:/maintenance-operations; Authorisation and Direct Sale:/authorisation-and-directsale(all below/en/integration/api-developer-guide/) - Test cases and test cards: https://docs.direct.worldline-solutions.com/en/integration/how-to-integrate/test-cases/
- API contract (OpenAPI, version 2.531.0): https://payment.direct.ecom.preprod.worldline-solutions.com/v1/public-contract-definition.yaml
- Payment method pages (product ids): https://docs.direct.worldline-solutions.com/en/payment-methods-and-features/payment-methods/
- Logos page: https://docs.direct.worldline-solutions.com/en/integration/best-practices/optimise-customer-experience/logos
- Official PHP SDK (request signature, webhook signature, test vectors): https://github.com/wl-online-payments-direct/sdk-php
- Product line comparison: https://docs.connect.worldline-solutions.com/testing/sandbox-access (Connect) and https://docs.direct.worldline-solutions.com/en/getting-started/ (Direct)