Stripe Payment
Momen integrates Stripe Payment Element for one-time payments, recurring payments, and refunds. Before continuing, read the Payment Overview, prepare an order table, and understand how generated Webhook Actionflows confirm final payment results.
Set up Stripe
Prepare a Stripe account
Create or sign in to a Stripe account . In the Stripe Dashboard, open Developers → API keys to copy the publishable key and reveal the secret key for the environment you intend to use. Do not mix test and live keys.
Activate Stripe
Open Action → Payment → Stripe (Web) and select Activate. If Stripe is the project’s first payment gateway, select the order table.
Enter Stripe information
| Setting | Required | Description |
|---|---|---|
| Publishable key | Yes | Client-safe Stripe publishable key |
| Secret key | Yes | Server-side Stripe secret key |
| Brand name | No | Name shown in the checkout experience |
| Brand slogan | No | Supporting checkout text |
| Brand logo | No | Logo shown in the checkout experience |
Save the credentials and optional brand information. Momen creates the required Stripe callback configurations and exposes the generated one-off payment, recurring payment, refund, and recurring deduction Actionflows under Related Actionflows.
Do not change the events or destination of a Stripe Webhook created for a generated payment Actionflow. Use a separate Webhook Trigger and Actionflow for additional Stripe events.
Publish and test
Publish the payment configuration, system tables, Actionflows, and frontend changes. Complete the full flow with Stripe test data before using live keys.
One-time payments
Create an order and add the action
Create an order in the bound order table, then add Stripe → One-time payment from the Payment category under a page or component Trigger.
| Parameter | Type | Required | Description |
|---|---|---|---|
| Order id | Integer | Yes | ID of the order record in the bound table |
| Currency | Text | Yes | Currency code supported by Stripe, such as USD |
| Amount | Decimal | Yes | Amount in the currency’s smallest unit; 1000 represents USD 10.00 |
| Product name | Text | No | Product name shown during checkout |
| Product description | Text | No | Product description shown during checkout |
The action’s On success branch means the frontend call returned successfully. For security, it cannot contain data mutations. Use the Stripe payment Webhook Actionflow to confirm the final result.
Handle the payment webhook
The generated one-off payment Actionflow updates payment_record and exposes:
| Result | Type | Description |
|---|---|---|
orderId | Integer | Related order ID |
paymentFound | Boolean | Whether the payment record was found |
paymentStatus | Text | SUCCESSFUL or FAILED |
alreadyProcessed | Boolean | Whether the same status was already processed |
Run fulfillment only when paymentFound is true, paymentStatus is SUCCESSFUL, and alreadyProcessed is false. Compare the payment amount and currency with the trusted order before granting access or delivering goods.
Show the final result
Query the order table or payment_record from the frontend. Use a real-time data source or reload the relevant data when the page needs the latest status.
Refunds
Restrict refund permissions
Refund actions should not be available to regular users. Under Settings → Permissions → Payment, enable Stripe refunds only for a trusted administrator role.
Add a refund action
Add Stripe → Refund from the Payment category.
| Parameter | Type | Required | Description |
|---|---|---|---|
| Payment id | Integer | Yes | ID from payment_record, not the order ID |
| Refund amount | Decimal | Yes | Amount to refund; cumulative refunds cannot exceed the original payment |
Query payment_record by order when you need to obtain the payment ID. Before starting another refund, check the payment status and the total of successful refunds.
Handle the refund webhook
The generated refund Actionflow updates refund and exposes orderId, refundFound, paymentStatus, and alreadyProcessed. paymentStatus is REFUNDED or FAILED.
Handle a result only when refundFound is true and alreadyProcessed is false. Add order updates, entitlement revocation, or notifications to the reserved branches.
Recurring payments
Create a recurring product and Price in Stripe before configuring the Momen action.
Start a subscription
Add Stripe → Recurring payment → Initiate.
| Parameter | Type | Required | Description |
|---|---|---|---|
| Order id | Integer | Yes | ID of the first order in the bound table |
| Price id | Text | Yes | Recurring Price ID from Stripe |
| Product name | Text | No | Product name shown during checkout |
| Product description | Text | No | Product description shown during checkout |
Cancel a subscription
Add Stripe → Recurring payment → Cancel and bind the Recurring payment id from recurring_payment.
Handle subscription status
The generated recurring payment Actionflow updates recurring_payment. Stripe subscription states can include INCOMPLETE, INCOMPLETE_EXPIRED, ACTIVE, PAST_DUE, CANCELED, TRIALING, and UNPAID. Enable or disable subscription benefits from the corresponding branches required by your product.
Create renewal orders
When Stripe charges a subscription again, the generated recurring deduction Actionflow receives the invoice event. Momen does not design the business order for you. In the reserved part of the Actionflow:
- Create a new order for the billing period.
- Bind the new order ID to the following payment-record creation step.
- Fulfill that period only after its payment status is confirmed.
Additional Stripe events
To handle an event not covered by the generated payment flows, create an Actionflow with a Webhook Trigger, copy its Webhook URL to a separate Stripe endpoint, and branch on the event type in that Actionflow. Do not add unrelated events to Momen’s generated payment endpoints.
Troubleshooting
- Checkout does not open: Verify that the publishable and secret keys belong to the same Stripe environment and that all required action inputs are bound.
- The frontend succeeds but the order is unchanged: Confirm that the generated payment Actionflow is published and that its successful branch updates the order.
- The charged amount is unexpected: Stripe amounts use the smallest currency unit. Check the currency’s exponent before binding the amount.
- A subscription does not activate: Inspect
recurring_paymentand the recurring payment Actionflow instead of relying on the frontend checkout result. - A refund action is unavailable: Check the current role’s payment permissions.