Skip to Content

Payment Reference

This page lists the data structures and values used by payments. For setup, see the Payment Overview.

Payment callback data

When you configure Actionflow inputs under Payment result handling, you can bind data under Payment callback. Each event provides different data:

DataTypeOn paymentOn refundOn subscription status changeOn recurring billing
Paymentpayment_record recordYesYes
Order paid amountDecimalYes
Refundrefund recordYes
Recurring paymentrecurring_payment recordYes
Previous statusTextYes
Previous cancel at period endBooleanYes
Callback request bodyJSONYesYesYes
  • Payment, Refund, and Recurring payment expose the record and its fields, but not its relations.
  • Order paid amount is the total of all SUCCESSFUL payment records for the order.
  • Callback request body is the raw notification from the gateway; its format depends on the gateway.

System table fields

payment_record

FieldDescription
idPayment record ID, used for refunds
typePayment channel type
grand_total_valuePayment amount, in the same unit as the gateway’s payment action
currencyCurrency code
statusSee Payment status
descriptionTransaction description
order_idRelated order ID
transaction_idGateway transaction ID
out_trade_noOrder number Momen sends to the gateway
account_idAccount that started the payment
recurring_payment_idRelated subscription for subscription charges
config_idPayment configuration used

refund

FieldDescription
idRefund record ID
payment_record_idRefunded payment record
account_idAccount that started the refund
statusREFUNDING, REFUNDED, or FAILED
out_refund_noGateway refund ID
amountRefund amount

recurring_payment

FieldDescription
idSubscription ID, used to cancel a subscription
account_idSubscribing account
agreement_noGateway subscription ID
first_order_idOrder used to start the subscription
statusSee Subscription status
payment_typeGateway of the subscription
current_period_startStart of the current billing period
current_period_endEnd of the current billing period
cancel_at_period_endWhen true, the subscription ends after the current period
config_idPayment configuration used

All three tables also have creation and update timestamps.

Payment status

StatusDescription
PENDINGThe payment record exists and is waiting for the gateway notification
SUCCESSFULPayment succeeded
CANCELLEDPayment was canceled
PARTIALLY_REFUNDEDPartially refunded
REFUNDEDFully refunded

PENDING can only change to SUCCESSFUL or CANCELLED. SUCCESSFUL and PARTIALLY_REFUNDED can only change to PARTIALLY_REFUNDED or REFUNDED through refunds. Notifications that break these rules are ignored.

Only SUCCESSFUL or PARTIALLY_REFUNDED payments can be refunded. A refund record moves from REFUNDING to REFUNDED or FAILED.

Subscription status

StatusDescription
INCOMPLETESubscription started; the first period is not paid yet
INCOMPLETE_EXPIREDThe first period was not paid in time and the subscription expired
TRIALINGIn trial
ACTIVEActive
PAST_DUEA charge is overdue
UNPAIDUnpaid
CANCELEDCanceled

CANCELED and INCOMPLETE_EXPIRED are final. A notification that only moves the billing period updates the record without running On subscription status change.

Amount units

GatewayPayment action amountExample
StripeSmallest currency unitEnter 1000 to charge USD 10.00
AirwallexMajor currency unitEnter 10 to charge USD 10.00

Refund amounts use the same unit as the original payment. A refund larger than the remaining refundable amount refunds the remaining amount.

Validation messages

The editor reports an error in these cases:

MessageFix
Action does not choose a payment configSelect a Payment configuration on the payment action
The payment config referenced by the action does not existThe configuration was deleted; select another one
The payment config belongs to a different channel than the actionSelect a configuration of the action’s gateway
Action does not choose a payment productSelect a Payment product on the payment action
The payment product is not available on this clientSelect a product available on the current client
The payment config does not enable the payment productEnable the product under the configuration’s Payment products
A payment config field cannot be blankFill in the required merchant information
A payment config field must be a Secret bindingBind the sensitive field to a secret
The Actionflow handling subscription invoice creation must run synchronously and output a BIGINT order IDSee Handle subscription renewals
Payment callback data can only be used in a payment callback configurationBind Payment callback data only in Actionflow inputs under Payment result handling
The payment callback field does not apply to this event typeBind data that the event provides; see Payment callback data
Last updated on