WP Manifestindependent plugin directory
manifest / ecommerce / pmpro-n-genius-gateway

PMPro N-Genius Gateway

N-Genius payment integration for PMPro

by Your Name · github.com/swmaina/pmpro-n-genius-gateway · website

★ 0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/swmaina/pmpro-n-genius-gateway/archive/refs/heads/main.zip

N-Genius (Stanbic Bank) payment gateway integration for Paid Memberships Pro. Enables Tanzanian users to purchase time-limited memberships using hosted card checkout.

Features

  • Hosted Payment Page: Secure card payments processed by N-Genius (PCI DSS compliant)
  • Manual Renewal: One-time payments with manual renewal (no auto-billing)
  • TZS Currency Support: Full support for Tanzanian Shilling
  • Webhook Integration: Automatic membership activation on payment confirmation
  • Admin Dashboard: View active members, recent payments, and manage memberships
  • Sandbox Testing: Test mode for development and testing
  • Security: Nonce verification, capability checks, input sanitization, output escaping

Requirements

  • WordPress 5.8 or higher
  • PHP 7.4 or higher
  • Paid Memberships Pro (free version)
  • N-Genius merchant account (sandbox or live)

Installation

  1. Upload the plugin folder to /wp-content/plugins/PMPro-N-Genius-Gateway/
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Go to Memberships > Settings > Payments
  4. Select N-Genius as your payment gateway
  5. Configure your N-Genius credentials (see Configuration below)

Configuration

Step 1: Get N-Genius Credentials

  1. Create a sandbox account at https://www.network.ae/en/test-account
  2. Log in to the N-Genius portal at https://portal.sandbox.ngenius-payments.com
  3. Get your API Key and Outlet ID from the portal

Step 2: Configure Plugin Settings

  1. Go to Memberships > Settings > Payments
  2. Select N-Genius as the gateway
  3. Enter your credentials:
    • Environment: Sandbox (for testing) or Live (for production)
    • API Key: Your N-Genius API key
    • Outlet ID: Your N-Genius outlet reference
    • Webhook Secret: Generate a random string (e.g., ngenius_webhook_secret_12345)

Step 3: Configure Webhooks in N-Genius Portal

  1. Copy the Webhook URL from the plugin settings
  2. Log in to your N-Genius portal
  3. Navigate to webhook settings
  4. Add the webhook URL
  5. Add a custom header: X-Webhook-Secret with the same secret you configured in the plugin

Usage

For Site Administrators

View Dashboard:

  • Go to Memberships > N-Genius Dashboard
  • View active members and their expiration dates
  • View recent payment transactions

Manage Memberships:

  • Extend Membership: Click "Extend" next to a member and enter number of days
  • Revoke Membership: Click "Revoke" to cancel a member's access

For Members

  1. Select a membership level on your site
  2. Complete the registration form
  3. Click "Proceed to Payment"
  4. You'll be redirected to N-Genius secure payment page
  5. Enter card details and complete payment
  6. Return to your site with activated membership

Payment Flow

  1. User registers and selects membership level
  2. Plugin creates order in PMPro and N-Genius
  3. User redirected to N-Genius hosted payment page
  4. User completes card payment
  5. N-Genius sends webhook notification to your site
  6. Plugin verifies payment and activates membership
  7. User receives confirmation email

Webhook URL

Your webhook URL is:

https://yoursite.com/wp-json/pmpro-ngenius/v1/webhook

Configure this in your N-Genius portal with the custom header X-Webhook-Secret.

Testing

Sandbox Mode

  1. Set environment to "Sandbox"
  2. Use sandbox credentials from N-Genius
  3. Use test card numbers from N-Genius documentation
  4. Test complete checkout flow
  5. Verify webhook processing in WordPress debug log

Test Cards

Refer to N-Genius documentation for test card numbers: https://docs.ngenius-payments.com/reference/sandbox-test-environment

Troubleshooting

Payment not activating membership

  1. Check webhook is configured correctly in N-Genius portal
  2. Verify webhook secret matches in both plugin and N-Genius
  3. Enable WordPress debug logging: define('WP_DEBUG', true);
  4. Check error logs for webhook processing errors

API errors

  1. Verify API key and Outlet ID are correct
  2. Check environment setting (sandbox vs live)
  3. Ensure credentials match the selected environment
  4. Check N-Genius API status

Webhook verification failing

  1. Ensure webhook secret is configured in both plugin and N-Genius portal
  2. Verify custom header name is exactly X-Webhook-Secret
  3. Check webhook URL is accessible (not blocked by firewall)

Security

  • All forms use WordPress nonces for CSRF protection
  • Capability checks on all admin functions
  • Input sanitization using WordPress functions
  • Output escaping to prevent XSS
  • Webhook signature verification using secret header
  • No card data stored (handled by N-Genius hosted page)

Support

For issues related to:

  • Plugin functionality: Check WordPress debug logs
  • N-Genius API: Contact N-Genius support
  • PMPro integration: Refer to PMPro documentation

License

GPL v2 or later

Changelog

1.0.0

  • Initial release
  • N-Genius hosted payment page integration
  • Webhook handler for payment confirmation
  • Admin dashboard for membership management
  • Sandbox and live environment support