Payment Flow
- Build the payment data in your plugin.
- Pass the data to your adapter.
- Create the Monime checkout request.
- Redirect the user to Monime checkout.
- Handle the webhook response in your plugin.
Example Adapter
$data array would usually come from your order builder, donation form, invoice screen, or membership checkout flow.
Webhook Handling
Use your webhook adapter to update custom orders, donations, invoices, or other payment records when Monime sends event updates. Monime verifies the webhook signature before it dispatches the payload to your adapter. That meanshandleWebhook() receives a verified payload, and your job is to map that payload back to your own record system.
What handleWebhook() Should Do
Your handleWebhook() method should usually:
- Find the internal record associated with the Monime reference.
- Confirm the payment state in the payload.
- Update your local record only if the event has not already been processed.
- Store any useful Monime identifiers for future support or reconciliation.
- marking an order as paid,
- recording the Monime transaction reference,
- activating access to a service or membership,
- and storing the final payment status for audit purposes.
Best Practices
- Keep adapter logic small and predictable.
- Do not hardcode sensitive credentials in your custom plugin.
- Treat webhook delivery as the source of truth for payment completion.
- Make webhook handlers idempotent so repeated deliveries do not create duplicate records.
- Log the Monime reference and your internal reference together so you can trace payments later.