Skip to content
Santosh Gautam - Full Stack Developer Gurugram India
SANTOSH GAUTAM Full Stack Developer
WooCommerce Payment Gateway Boilerplate — Custom PHP Plugin by Santosh Gautam India
Open Source PHP · WooCommerce
View on GitHub
Developer Tool Free · MIT License Production Ready

WooCommerce Payment Gateway Boilerplate

A production-ready PHP boilerplate for building custom WooCommerce payment gateway plugins. Supports block & classic checkout, PayU sample integration, sandbox/live toggle, admin logs and secure transaction handling — fully modular and ready to extend for any payment provider.

Santosh Gautam - Full Stack Developer India

Full Stack Developer · India

PHPWordPressWooCommercePayUWC Blocks

Features

Latest WooCommerce Compatible

Built for current WooCommerce versions.

Block + Classic Checkout

Works with both React Blocks & legacy shortcode.

Secure API Integration

SHA-512 hash validation, secure request handling.

Admin Settings Page

Configure API keys, modes & labels from WP admin.

Sandbox & Live Mode

Toggle between test and production environments.

Admin Payment Logs

Full logging for debugging API calls.

Redirect & Callback Handler

Seamless redirect flow and webhook processing.

PayU Sample Included

Working PayU India integration as reference.

Modular Code Structure

Clean /includes/ and /templates/ separation.

Customizable UI

Payment method title, description & error notices.

Installation

1

Download the repository as a ZIP file from GitHub.

2

Go to WordPress Admin → Plugins → Add New and click Upload Plugin.

3

Choose the ZIP file, click Install Now, then Activate.

4

Navigate to WooCommerce → Settings → Payments and configure with your API keys.

Usage

1

Enable the payment gateway in WooCommerce settings.

2

Add your PayU (or other provider) API credentials in the settings tab.

3

Enable Sandbox mode and test the full payment flow.

4

Check WooCommerce payment logs to verify API calls.

5

Switch to Live mode once testing is complete.

Clone & Customize

Clone the repo and start customizing for your payment provider:

git clone https://github.com/Santosh-gautam/WooCommerce-Payment-Gateway-Boilerplate.git
cd WooCommerce-Payment-Gateway-Boilerplate

Key files to modify:

includes/templates/class-gateway.phpassets/js/

PayU Sample Integration

This boilerplate ships with PayU India as a working sample. Swap it for any provider — Razorpay, Cashfree, Stripe or custom — by updating the API methods and endpoints.

The architecture is provider-agnostic — one clean class extension handles everything. Change API credentials and hash logic to switch providers in minutes.

Need a Custom Payment Gateway for Your Store?

I build custom WooCommerce payment gateway plugins for any provider — PayU, Razorpay, Cashfree, Stripe and more. Full setup, webhook handling, Blocks compatibility and production deployment. Available for remote work globally.

Available for remote work worldwide 4+ years WooCommerce experience PayU, Razorpay, Cashfree supported Blocks checkout compatible Clean production-ready code

License

MIT License — Free to use, fork & extend

Author

Santosh Gautam

Santosh Gautam

hisantosh.com