Skip to main content
Version: 2.0.0

24Pay

yui/craft-24-pay adds 24Pay (G24pay) as an online payment method to checkout on a store running yui/craft-plugin (yStore). 24Pay is a Slovak card acquirer; the plugin builds and signs a redirect payment request against 24Pay's hosted payment gateway (pay_gate) using the merchant's own Mid/EshopId/Key credentials — there is no third-party SDK involved.

Use it when you want to accept Visa/Mastercard payments routed through 24Pay instead of, or alongside, other yStore payment methods.

What it does

  • Registers itself with the yStore payment method registry (PaymentMethodRegistryInterface) so it appears as a selectable payment option at checkout, next to any other configured payment method.
  • Builds a signed 24Pay payment request from the current order (merchant ID, amount, transaction ID, customer name/email) and redirects the customer to 24Pay's hosted pay_gate/paygt page to enter card details.
  • Reads back the payment result from 24Pay's callback (Result parameter) and reports success/failure to yStore's checkout flow.
  • Adds a License page under the plugin's CP navigation, consistent with other YUI plugins.
  • Ships Slovak and Hungarian translations of the settings UI.

Where admins work with this plugin

In Craft CP, open Settings → Plugins → 24Pay:

  • Settings (g24pay/settings) — merchant credentials, checkout display, currency/language, and visibility restrictions. See Settings.
  • License (g24pay/license) — activate, redeem, or revoke the plugin license, and copy the entitlement token. Same license flow used across YUI plugins.

There is no dedicated payments/transactions list in this plugin version — the merchant portal at admin.24-pay.eu is the source of truth for transaction status, not Craft CP.

How the checkout payment flow works

  1. The customer selects 24Pay (or the configured Select button name) as their payment method at checkout.
  2. yStore calls the plugin's placeOrder(), which builds a signed payment payload (Mid, EshopId, MsTxnId, Amount, ClientId, customer name, Email, Timestamp, Sign, …) via ApiService::prepare().
  3. The customer is redirected (or auto-submitted via the returned form fields) to 24Pay's pay_gate/paygt endpoint — the hosted card entry page.
  4. 24Pay redirects the customer back to the store's checkout callback URL (RURL/NURL, both set to the same callbackUrl) with a Result parameter. The plugin's postValidate() treats Result === 'OK' as a successful payment and anything else as a failure.
  5. Any error during payload preparation is logged through the shared yStore error log under g24pay-gateway:placeOrder / g24pay-gateway:postValidate instead of surfacing raw gateway details to the customer. A failed postValidate() call also logs the full callback payload under a shared key for later lookup.

Known behavior to be aware of

  • Currency and country are not read from settings at request time. The CurrAlphaCode sent to 24Pay is hardcoded to EUR and Country to SVK in the current plugin version, regardless of the Default currency setting. Only use this plugin for EUR/Slovakia-routed checkouts until this is revisited.
  • Default language is not sent to the gateway. The LangCode field is present in the settings form but not included in the request payload in this plugin version, so 24Pay's hosted page uses its own default/browser language regardless of Default language.
  • Payment method price is always 0. getDetails() reads a defaultPrice setting that does not exist on this plugin's settings model, so the checkout price for selecting 24Pay is always 0.

Requirements

  • Craft CMS 5 project.
  • yui/craft-core version 1, yui/craft-plugin (yStore) version 2+.
  • A 24Pay (G24pay) merchant account with a merchant number (Mid), e-shop ID, and signing key, available for both the Test (sandbox) and Live (production) environments.
  • Composer access to https://repo.yui.sk/.

Installation

composer require yui/craft-24-pay

Then open Settings → Plugins → 24Pay and enter the merchant credentials (see Settings).

Security notes

  • The merchant number, e-shop ID, and signing key are stored as plain settings data — do not commit them to version control; set them through the CP settings form on each environment instead.
  • Enable SandboxMode talks to 24Pay's test.24-pay.eu environment instead of admin.24-pay.eu; keep it on until a full test payment has been verified through Test Credentials.

Developer / API reference

See Developer for the Plugin, G24payGateway, and ApiService methods, the request signing algorithm, and CP routes.

Frequently asked questions

Which currency does 24Pay charge in with this plugin? Regardless of the Default currency setting, the request sent to 24Pay always uses EUR as CurrAlphaCode in this plugin version (see Known behavior).

Can I restrict 24Pay to specific countries or a date/time window? Yes — the Restrictions tab lets you pick which store countries can see 24Pay at checkout, and set a Visible From / Visible To window.

How do I test a payment before going live? Turn on Enable SandboxMode, save your test-environment credentials, and use the Test Credentials button on the settings page to confirm the merchant number and e-shop ID authenticate against 24Pay's install endpoint before running an end-to-end checkout test.

Where do I see completed 24Pay transactions? In the 24Pay merchant portal, not in Craft CP — this plugin version does not keep its own payment/transaction list.