- If your plugin only creates payments, the payment adapter is enough.
- If your plugin also needs to update orders, donations, invoices, or membership records after payment, implement the webhook adapter too.
Payment Adapter
The payment adapter should provide:- An adapter ID.
- A method for building the Monime payment payload.
- Optional payment options and metadata.
Webhook Adapter
If your plugin needs to process Monime webhook events, implement the webhook handler as well. This is where you convert a Monime payment event into your application’s internal state update. For example, you might mark an invoice as paid, activate a membership, or mark a donation as complete.Payload Fields
The payment payload commonly includes:- line items,
- idempotency key,
- reference,
- name,
- description,
- cancel URL,
- success URL,
- financial account ID,
- currency,
- payment options,
- metadata,
- callback state.
What These Fields Usually Represent
- line items: what the customer is paying for.
- idempotency key: a unique value that prevents duplicate payment creation.
- reference: your internal payment or order reference.
- name / description: text shown to the donor or customer in checkout.
- cancel URL / success URL: where Monime should return the user after cancel or success.
- financial account ID: optional settlement target inside Monime.
- currency: the payment currency used for the checkout session.
- payment options: the channels and provider restrictions you want to send to Monime.
- metadata: any additional application data you want to carry through the payment flow.
- callback state: extra state you want returned or preserved for post-payment handling.
Registration
Register the adapter from your main plugin file, before you create any checkout sessions. That is the safest place to load your adapter class and register it with Monime. Example pattern:monime_gateway.php.
Configuration Checklist
Before going live, confirm that:- Your adapter class is required by the main plugin file.
- Your adapter registration runs during plugin boot, not only inside a request-specific class.
- Your adapter ID is unique.
- The payload includes the URLs Monime should return to.
- The reference maps back to a real object in your application.
- Your webhook handler can safely ignore duplicate webhook deliveries.
- Your plugin can recover from a payment that succeeds after the user closes the tab.