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.zipN-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
- Upload the plugin folder to
/wp-content/plugins/PMPro-N-Genius-Gateway/ - Activate the plugin through the 'Plugins' menu in WordPress
- Go to Memberships > Settings > Payments
- Select N-Genius as your payment gateway
- Configure your N-Genius credentials (see Configuration below)
Configuration
Step 1: Get N-Genius Credentials
- Create a sandbox account at https://www.network.ae/en/test-account
- Log in to the N-Genius portal at https://portal.sandbox.ngenius-payments.com
- Get your API Key and Outlet ID from the portal
Step 2: Configure Plugin Settings
- Go to Memberships > Settings > Payments
- Select N-Genius as the gateway
- 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
- Copy the Webhook URL from the plugin settings
- Log in to your N-Genius portal
- Navigate to webhook settings
- Add the webhook URL
- Add a custom header:
X-Webhook-Secretwith 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
- Select a membership level on your site
- Complete the registration form
- Click "Proceed to Payment"
- You'll be redirected to N-Genius secure payment page
- Enter card details and complete payment
- Return to your site with activated membership
Payment Flow
- User registers and selects membership level
- Plugin creates order in PMPro and N-Genius
- User redirected to N-Genius hosted payment page
- User completes card payment
- N-Genius sends webhook notification to your site
- Plugin verifies payment and activates membership
- 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
- Set environment to "Sandbox"
- Use sandbox credentials from N-Genius
- Use test card numbers from N-Genius documentation
- Test complete checkout flow
- 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
- Check webhook is configured correctly in N-Genius portal
- Verify webhook secret matches in both plugin and N-Genius
- Enable WordPress debug logging:
define('WP_DEBUG', true); - Check error logs for webhook processing errors
API errors
- Verify API key and Outlet ID are correct
- Check environment setting (sandbox vs live)
- Ensure credentials match the selected environment
- Check N-Genius API status
Webhook verification failing
- Ensure webhook secret is configured in both plugin and N-Genius portal
- Verify custom header name is exactly
X-Webhook-Secret - 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