← Back to cases
Magento 40h

Custom Payment Method Development for Magento 2

Custom Payment Method Development for Magento 2

Client request

The client approached us with a specific need: build a custom payment method for their Magento 2 store. The standard payment modules didn't fit their workflow — they work with a local payment provider that doesn't have an official Magento 2 extension, and they needed full integration with their checkout, order management, and accounting processes.

What we found

After reviewing the provider's API documentation and the client's business requirements, we identified the key technical points: The payment provider offers a REST API with hosted payment page redirection, Callback (webhook) handling is required to confirm payment status asynchronously, The method should be available only for specific customer groups and currencies, Orders must transition through proper states: pending payment → processing → complete (or canceled on failure), Refunds via API need to be available from the Magento admin, The payment method should respect Magento's multi-store configuration (different credentials per store view), Full compatibility with the client's customized one-step checkout is required. A generic offline payment module wouldn't cover this — a fully custom Magento 2 module had to be developed from scratch.

Our solution

We prepared a proposal estimated at 40 hours, broken down as follows: Discovery & technical specification (4h) — analyzing the provider's API, defining the module architecture, agreeing on the scope with the client. Module skeleton & configuration (4h) — creating the Magento 2 module structure, admin configuration fields (API keys, mode, allowed currencies, customer groups), system.xml and config.xml setup. Payment method class & checkout integration (8h) — implementing the payment method model, frontend renderer, and integrating it into the checkout flow. API client & request handling (6h) — building a service layer to communicate with the provider's API (authorization, payment initiation, status check, refund). Redirect flow & return handling (4h) — implementing the redirect to the hosted payment page and processing the customer's return to the store. Webhook controller (4h) — building a secure callback endpoint to handle asynchronous payment notifications, with signature verification and idempotency. Order state management (3h) — proper handling of order statuses, invoice creation on successful payment, and order cancellation on failure. Refunds from admin (2h) — enabling full and partial refunds via the Magento admin panel. Testing on stage (4h) — full end-to-end testing: successful payments, failed payments, 3DS flows, webhooks, refunds, edge cases. Production deployment & monitoring (1h) — releasing to live, monitoring the first real transactions. All development is first deployed to stage, verified by the client, and only then released to live.

What the client said

From the first call, it was clear we were working with real Magento professionals. They analyzed our requirements in detail, proposed a clean architecture, and built a fully custom payment module that fits our business perfectly. Communication was transparent throughout, and the stage → live deployment workflow meant zero disruption to our live sales. A pleasure to work with.

A
Anna Kowalski CTO
Delivered by

Magedia

We are a leading IT company with extensive experience in delivering innovative technology solutions across a wide range of industries.

Related cases

Magento 120h

Magento 2.4.3 → 2.4.8p5 Upgrade

Read →
Magento 16h

Porto Theme Update

Read →
Magento 24h

Stripe Payment Integration for Magento 2

Read →