360Pay adds a modular integration for mobile wallet payments directly inside the native MasterStudy LMS checkout.
This is an independent, third-party plugin. It is not affiliated with, endorsed by, or sponsored by MasterStudy LMS / StylemixThemes or by Vodacom / M-Pesa. “MasterStudy” and “M-Pesa” are trademarks of their respective owners and are used here only to describe the services this plugin integrates with.
The plugin is designed to:
* Keep orders in pending status until the API confirms the payment.
* Ensure all payment confirmations are verified server-side.
* Validate transaction reference, amount, currency, student, course, and payment status before granting access.
* Receive callbacks/webhooks through a secure REST API.
* Fallback to automated polling via WP-Cron.
* Support multiple mobile wallets, including M-Pesa, e-Mola, mKesh, or custom wallets configured manually.
* Never ask for PINs, OTPs, or private wallet data on the site.
* Keep detailed transaction logs without exposing credentials or sensitive info.
Technical details:
* Order post type: stm-orders.
* Native order items table: {$wpdb->prefix}stm_lms_order_items.
* Native enrollment function: stm_lms_add_user_course().
* Cart helper: stm_lms_get_cart_items().
* Action hook: stm_lms_purchase_action_done.
In General Settings, you can configure:
* Enable Gateway: Globally enable or disable the mobile wallet gateway.
* Environment: Sandbox (testing) or Production.
* Default Currency: e.g., MZN.
* Expiry Minutes: Maximum time allowed for payment confirmation before expiration.
* Debug Logging: Enable additional developer logs.
Each wallet config allows you to customize:
* Name and slug.
* Logo via the Media Library.
* Description and instructions for the student.
* Phone number prefixes and length constraints.
* Sandbox and Production API base URLs.
* Initiate Payment endpoint.
* Check Status endpoint.
* API key, secrets, bearer token, Merchant ID, and Webhook secret.
* Auth Method: none, basic_auth, bearer_token, api_key_header, oauth2, or custom.
* Timeout, max retries, and check interval.
* JSON headers.
* Request JSON template.
* Response field mapping.
* Status value mapping for success, pending, failed, and cancelled.
Available tokens in endpoints/templates:
* {reference}
* {external_reference}
* {amount}
* {currency}
* {phone}
* {merchant_id}
* {callback_url}
Wallet Callback URL:
/wp-json/ms-wallet-payments/v1/callback/{wallet_slug}
Public Status Check URL:
/wp-json/ms-wallet-payments/v1/status/{transaction_reference}
Reprocess Callback (Admin only):
/wp-json/ms-wallet-payments/v1/reprocess/{transaction_reference}
Start Payment (Frontend AJAX):
/wp-json/ms-wallet-payments/v1/start
List Active Wallets:
/wp-json/ms-wallet-payments/v1/wallets
You can customize checkout context, order creation, order completion, enrollment, and status checks using filters:
add_filter( 'mswp_masterstudy_checkout_context', function ( $context, WP_REST_Request $request ) { ... } );
add_filter( 'mswp_masterstudy_create_pending_order', function ( $order_id, $transaction ) { ... } );
add_filter( 'mswp_masterstudy_complete_order', function ( $completed, $transaction ) { ... } );
add_filter( 'mswp_masterstudy_enroll_user', function ( $enrolled, $transaction ) { ... } );
add_filter( 'mswp_masterstudy_mark_order_not_paid', function ( $updated, $transaction, $status ) { ... } );<h3>Fallback Shortcodes</h3>
If you need to manually integrate a checkout button for testing:
[mswp_wallet_checkout course_id=”123″ amount=”1500″ currency=”MZN”]
To display payment status:
[mswp_payment_status]
$wpdb->prepare and identifier escaping.This plugin connects to third-party mobile wallet payment APIs to initiate and verify payments. Card/PIN/OTP data is never handled by the site. The following external services may be contacted: