Payment Overview
Momen’s built-in payment feature connects payment gateways, verifies callbacks, and maintains payment records. You provide an order table, start payments from the frontend, and add order updates, entitlement delivery, or other business logic to the generated Actionflows.
Payment features are available on Pro plans and above. Payments stop working if the project is downgraded to a plan that does not include them.
Supported gateways
| Gateway | Clients | One-time payment | Recurring payment | Refund |
|---|---|---|---|---|
| Stripe | Web and Native App | Yes | Yes | Yes |
| Airwallex | Web and Native App | Yes | Yes | Yes |
All active gateways in a project share one order table.
Activate payments
Prepare an order table
Create a table for your business orders under Data. Momen does not require a fixed schema, but an order usually needs an amount, a status, and a relation to the account table.
The order table selected during the first activation cannot be replaced. Confirm the data model before continuing.
Activate a gateway
Open Action → Payment and select Activate for the gateway. Select the order table during the first activation. Gateways activated later use the same table.
Momen creates three system tables whose structures cannot be edited manually. Records cannot be added to these tables through the data editor; payment actions and callback flows maintain them.
| System table | Purpose |
|---|---|
payment_record | Stores one-time payments and recurring deductions and relates them to orders |
recurring_payment | Stores subscriptions, their current status, and related billing data |
refund | Stores refunds and relates them to payment records |
Momen also generates gateway-specific Actionflows for payment, refund, subscription, and recurring-deduction callbacks. Open them from Related Actionflows in the payment configuration.
Enter merchant information
Follow the gateway guide, enter the required merchant credentials, and save the configuration. Publish the payment configuration, system tables, and Actionflow changes before testing them at runtime.
How payments work
A payment normally follows this sequence:
- Create an order in your order table.
- Call a payment action from a page or component and bind the order ID and payment inputs.
- The user completes the gateway’s checkout flow.
- The gateway sends a Webhook to Momen. A generated Actionflow verifies it and updates the payment system tables.
- Add order updates, entitlement delivery, or notifications to the reserved branches in that Actionflow.
- Query the order or payment data on the frontend to show the final result.
Frontend result and final payment status
Payment actions have On success and On failure branches for the frontend request or checkout result. For security, data mutations cannot be added under On success for a payment action.
Treat the gateway Webhook and the status processed by its generated Actionflow as the final payment result. Do not fulfill an order or grant access based only on a frontend branch.
Duplicate callbacks
Gateways may deliver the same Webhook more than once. Generated processing nodes expose alreadyProcessed:
false: This callback state is being processed for the first time.true: The same state was already processed, so business logic normally should not run again.
This value protects the system payment record only. Use order-state conditions, unique constraints, or another idempotency mechanism for fulfillment, entitlement delivery, inventory changes, and other downstream work.
Validate order amounts
Payment amounts come from frontend action inputs. Before fulfillment, use the callback’s order ID to compare the payment record with your trusted order data, including amount and currency. Reject or flag mismatches before granting the purchased item or service.
Read payment results
The frontend can query the order table or, when permissions allow, payment_record, recurring_payment, and refund. Use a real-time data source or reload the relevant data when the page needs a current status.
The refund table exposes basic query permissions by default. Enable only the required aggregate or payment permissions for trusted roles. Refund actions should not be available to regular users.
Disable all payments
The payment page includes Disable all payments. Confirming Clear and close permanently:
- Removes merchant credentials for every gateway.
- Deletes the payment system tables and their relations. Publishing the change also removes their production data.
- Deletes generated payment Actionflows and callback Triggers, invalidating existing payment actions.
Reactivating payments creates new tables, Actionflows, and Triggers. Momen cannot restore or automatically associate the previous payment data.