Skip to main content

Little Pay WooCommerce Plugin

The Little Pay Gateway plugin for WooCommerce allows merchants to accept Card and Mobile Money payments (including M-PESA STK Push) directly on their WordPress site.


1. Installation

The plugin is distributed as a ZIP file. You can download it here.

  1. Log in to your WordPress Admin dashboard.
  2. Navigate to Plugins > Add New > Upload Plugin.
  3. Select the Little_Pay_Plugin.zip file and click Install Now.
  4. Activate the plugin.

2. WooCommerce Configuration

To enable and configure the gateway:

  1. Go to WooCommerce > Settings > Payments.
  2. Find Little Pay Gateway in the list and click Finish set up (or Manage).
  3. Ensure the checkbox Enable Little Pay is checked.
  4. Fill in the following credentials (retrieved from your Little Pay Merchant Portal):
    • Client ID
    • Client Secret
    • Client Token ID
  5. (Optional) Set an IPN URL if you wish to receive Instant Payment Notifications at a specific endpoint.
  6. Click Save changes. WooCommerce Payment Settings

3. Automatic Order Status Updates (REST API)

To ensure order statuses (e.g., from "Pending" to "Processing/Completed") update automatically after a successful payment, you must link your WooCommerce REST API to the Little Pay Portal.

Step 1: Generate WooCommerce API Keys

  1. Go to WooCommerce > Settings > Advanced > REST API.

  2. Click Add key. Generate WooCommerce API Keys

  3. Provide a description (e.g., "Little Pay Integration").

  4. Select a User (usually your admin account).

  5. Set Permissions to Read/Write.

  6. Click Generate API key.

  7. Copy the Consumer Key and Consumer Secret.

Step 2: Configure Little Pay Portal

  1. Log in to the Little Pay Merchant Portal.
  2. Navigate to Merchants > Merchant Settings > Integrations > Wordpress. Little Pay Integrations ListWordPress Configuration in Little Pay Portal
  3. Paste the Consumer Key and Consumer Secret generated in Step A.
  4. Save the settings.

4. Payment Flow

  1. At checkout, the customer selects Little Pay.
  2. Upon clicking "Place Order", they are redirected to the Little Pay checkout page.
  3. If paying via M-PESA, they will receive an STK Push prompt on their phone.
  4. Once payment is confirmed, the customer is redirected back to your "Thank You" page.
  5. The WooCommerce REST API integration handles the background update of the order status.

5. Troubleshooting

  • Order status not updating: Ensure the REST API keys have Read/Write permissions and are correctly entered in the Little Pay portal.
  • Redirect issues: Ensure your site's permalinks are set to something other than "Plain" (e.g., "Post name").
  • STK Prompt not appearing: Confirm the customer provided a valid Safaricom number and that the Little Pay keys (Client ID/Secret) are correct.