A payment gateway written against the classic WooCommerce checkout does not fail loudly in the block checkout. It renders as a selectable option with an empty body — the fields it needs simply never appear, and the customer submits an order with nothing filled in.
Two checkouts, two rendering models
The classic checkout prints payment fields from PHP. The block checkout is React: it builds its interface from JavaScript payment methods registered with WooCommerce Blocks, and PHP’s only role is to hand over configuration — the label, the icon, whether the method is currently available, and which script provides the interface.
Supporting both therefore means the gateway keeps its PHP rendering for the classic path and gains a small JavaScript module for the block path, plus an integration class that tells Blocks where to find it.
The part that actually bites: validation
Classic checkout validation runs on the standard checkout process hook. The block checkout submits through the Store API, whose compatibility bridge calls the gateway’s own validation method instead, with the submitted payment data temporarily standing in for the usual request data.
That is two different entry points arriving at the same decision. Written separately, they drift: a rule gets tightened on the classic path during a bug fix, the block path keeps accepting what the classic path now rejects, and the failure only appears for the subset of customers using the newer checkout.
We extracted the pass-or-fail check into a single method that both entry points call. Neither path contains a rule of its own, so there is nothing to keep in sync.
Key takeaways
- A classic gateway does not error in the block checkout — it renders empty, which is easy to miss in testing.
- The block checkout needs a registered JavaScript payment method; PHP only supplies its configuration.
- Two validation entry points with two copies of the rules will diverge. Extract the rule once and call it from both.
- Test the gateway in both checkouts before release, not just the one your theme happens to use.
Related reading: manual bKash, Nagad and Rocket payments, our WordPress plugin development service.
Running into a similar limitation in your own WooCommerce or WordPress store? Let’s Talk — ArtinTech Solution builds exactly this kind of custom store tooling.