Skip to Content

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

SettingRequiredDescription
Publishable keyYesClient-safe Stripe publishable key
Secret keyYesServer-side Stripe secret key
Brand nameNoName shown in the checkout experience
Brand sloganNoSupporting checkout text
Brand logoNoLogo 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.

ParameterTypeRequiredDescription
Order idIntegerYesID of the order record in the bound table
CurrencyTextYesCurrency code supported by Stripe, such as USD
AmountDecimalYesAmount in the currency’s smallest unit; 1000 represents USD 10.00
Product nameTextNoProduct name shown during checkout
Product descriptionTextNoProduct 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:

ResultTypeDescription
orderIdIntegerRelated order ID
paymentFoundBooleanWhether the payment record was found
paymentStatusTextSUCCESSFUL or FAILED
alreadyProcessedBooleanWhether 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.

ParameterTypeRequiredDescription
Payment idIntegerYesID from payment_record, not the order ID
Refund amountDecimalYesAmount 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.

ParameterTypeRequiredDescription
Order idIntegerYesID of the first order in the bound table
Price idTextYesRecurring Price ID from Stripe
Product nameTextNoProduct name shown during checkout
Product descriptionTextNoProduct 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:

  1. Create a new order for the billing period.
  2. Bind the new order ID to the following payment-record creation step.
  3. 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

  1. 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.
  2. The frontend succeeds but the order is unchanged: Confirm that the generated payment Actionflow is published and that its successful branch updates the order.
  3. The charged amount is unexpected: Stripe amounts use the smallest currency unit. Check the currency’s exponent before binding the amount.
  4. A subscription does not activate: Inspect recurring_payment and the recurring payment Actionflow instead of relying on the frontend checkout result.
  5. A refund action is unavailable: Check the current role’s payment permissions.
Last updated on