WordPress Integration

Add PayNexus M-Pesa payments to WordPress

Use the PayNexus plugin to collect payments from WooCommerce checkout, donation pages, booking forms, service pages, or any WordPress page that can display a shortcode.

M-Pesa checkout, without custom code

Customers enter their phone number, receive an STK Push, and PayNexus sends payment updates back to your site.

WordPress 5.8+ PHP 7.4+ WooCommerce optional
SETUP FLOW

How to integrate PayNexus with WordPress

Follow these steps after creating your PayNexus merchant account.

1

Install from WordPress

In WordPress admin, open Plugins, choose Add New, search for PayNexus Payment Gateway, then install and activate it.

2

Add API keys

Go to PayNexus Settings in WordPress and paste your merchant Secret Key. Add the Public Key if your setup uses it.

3

Connect webhooks

Register your site webhook URL in PayNexus so successful, failed, and pending payment updates return to WordPress.

4

Test and go live

Run a test payment, confirm the WordPress payment record updates, then enable PayNexus for your live checkout.

WooCommerce checkout

For online stores, enable PayNexus under WooCommerce Payments. Customers can choose M-Pesa at checkout, complete the STK Push, and orders are marked as paid after confirmation.

  • Works with WooCommerce stores
  • Supports automated order payment updates
  • Keeps payment records in WordPress admin

Shortcode payment forms

For non-store websites, place a PayNexus form on any page or post. This is ideal for donations, memberships, bookings, invoices, deposits, and service payments.

[paynexus_payment_form amount="1000" description="Service payment" reference="PAYNEXUS"]
  • No WooCommerce required
  • Fixed or customer-entered amounts
  • Real-time payment status updates
Webhook URL

Use your WordPress REST endpoint for payment updates

After saving your API keys, copy the webhook URL from the plugin settings and add it inside the PayNexus merchant dashboard.

https://yourdomain.com/wp-json/paynexus/v1/webhook
Ready for WordPress payments?

Connect your site and start collecting M-Pesa payments

Create your merchant account, install the plugin, and test your first STK Push payment from WordPress.