Linux 软件免费装
Banner图

OzuPay Payment Gateway for M-Pesa

开发者 fearofbug
更新时间 2026年9月7日 02:40
PHP版本: 8.0 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce payment gateway kenya mpesa safaricom

下载

5.1.15 5.1.23

详情介绍:

OzuPay accepts M-Pesa payments in WooCommerce. Customers enter their Safaricom number at checkout and receive a payment prompt on their phone. What's included in the free edition What OzuPay Pro adds Upgrade at ozupay.com Requirements

安装:

  1. Upload the ozupay-payment-gateway folder to the /wp-content/plugins/ directory, or install directly through the WordPress plugins screen.
  2. Activate the plugin through the Plugins screen in WordPress.
  3. Go to OzuPay → Settings and enter your Daraja credentials.
  4. Go to WooCommerce → Payments and enable the M-Pesa gateway.
  5. Configure the gateway title and description under WooCommerce → Payments → M-Pesa → Manage.
  6. Test with the Sandbox Testing panel before going live.
Getting your Daraja credentials
  1. Create a free developer account at developer.safaricom.co.ke
  2. Create an app under My Apps and add the Lipa Na M-Pesa product
  3. Copy the Consumer Key and Consumer Secret from the Keys tab
  4. Copy the STK Passkey from the sandbox credentials section
  5. Use shortcode 174379 and passkey from the test credentials page for sandbox testing

屏幕截图:

  • Settings — Credentials tab, with sandbox testing tools and a live Daraja health check.
  • Dashboard — payment activity at a glance.
  • Settings — Checkout Settings tab, controlling the checkout-page fields customers see.
  • Settings — Features tab, showing what's included in the free edition.

常见问题:

What is the test phone number for sandbox STK Push?

Safaricom's official sandbox test phone is 254708374149. Any STK Push to this number in sandbox mode will succeed. You can change this in the Sandbox Testing panel.

What are the sandbox credentials?

Shortcode: 174379 Passkey: bfb279f9aa9bdbcf158e97dd71a467cd2e0c893059b10f78e6b72ada1ed2c919 These are public Safaricom test credentials. The plugin's Sandbox Testing panel can pre-fill these automatically.

Why is the gateway not showing at checkout?

The most common reasons:

  1. The store currency is not set to KES — go to WooCommerce → Settings → General
  2. The gateway is not enabled — go to WooCommerce → Payments and enable M-Pesa
  3. Consumer Key, Consumer Secret, Shortcode, or Passkey is missing — go to OzuPay → Settings
  4. The Health Check panel (OzuPay → Settings → Health Check) will tell you exactly what is missing

Why is "Invalid TransactionType" returned by Daraja?

Your Shortcode Type setting does not match the type registered in Daraja. Paybill numbers use CustomerPayBillOnline and Till numbers use CustomerBuyGoodsOnline. The sandbox shortcode 174379 is a Paybill — set the type to Paybill.

Do callbacks work on localhost, and is HTTPS required?

Daraja requires a publicly accessible HTTPS callback URL. For local testing, use a secure tunnel such as ngrok, then confirm delivery with the Sandbox Testing panel.

Can I upgrade to Pro later without losing data?

Yes. The free and Pro editions use the same database tables and option names (ozupay_mpesa_settings, wp_ozupay_mpesa_transactions). Upgrading to Pro or switching back to free never deletes your data.

Where are API credentials stored?

Consumer Key, Consumer Secret, and STK Passkey are stored AES-256-GCM encrypted in the WordPress options table. The encryption key is derived from your site's AUTH_KEY and SECURE_AUTH_KEY constants. They are never stored in plain text.

Does this plugin phone home or send usage data?

Payment processing uses Daraja. Optional OzuPay diagnostics are off by default and run only after you opt in. The report includes your hostname and is not anonymous. Details follow.

更新日志:

5.1.23 5.1.22