Stripe Payment with Token (not SCA compliant)
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens,Forms,Connectors,Stripe account
Charges the card the user entered in a Stripe Credit Card field on your form. The card is sent from the browser straight to Stripe, which returns a one-time token. The action creates a Stripe customer with that token, charges it, and runs On Success or On Error.
With Stripe Connect, the payment can also go to a connected account, and your platform can keep an application fee.
This action isn't SCA compliant. It uses Stripe's older Charges API and doesn't support Strong Customer Authentication, such as 3D Secure. Payments with cards that need authentication, for example many cards issued in Europe, are declined. Use Stripe Checkout instead whenever you can.
This action is part of the Stripe add-on (DnnSharp.Stripe). The add-on is installed separately and needs the STRIPE feature in your license. If it isn't licensed, the action fails with a "not licensed" error. If you don't see the Stripe actions, the add-on isn't installed.
Typical Use Cases
- Maintain an existing form that already charges cards with this action
- Charge a card on your own form, when your customers' cards don't need SCA
- Charge on behalf of a connected account and keep an application fee
Don't use it to
- Take new payments where SCA applies. Use Stripe Checkout instead.
- Set up recurring payments. Use Stripe Checkout with Subscription, or Stripe Create Subscription.
- Charge a customer you created earlier. The action always creates a new customer from the card field.
- Enter card numbers in regular text fields. The obsolete Stripe Direct Payment (unsafe - obsolete) and Stripe Payment through the platform (unsafe - obsolete) do that, and shouldn't be used.
Related Actions
| Action Name | Description |
|---|---|
| Stripe Checkout | Takes an SCA-compliant payment on a Stripe-hosted page. |
| Add Stripe Connector | Creates the Stripe connector that holds your secret key. |
| Stripe Create Customer | Saves a customer with a card, without charging it. |
| Stripe Add Seller | Connects a seller's Stripe account to your platform. |
| Get Stripe User Account | Finds the ID of a connected account, for Payment To. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| API Connector | The Stripe connector with your platform's secret key. See Add Stripe Connector. When using an expression, the value must be the connector ID. | Yes | None | Yes |
| Application Fee Percentage | Connect payments only. The fee your platform keeps, as a percentage of Amount, with a dot for decimals, for example 2.35. Use 0 for no percentage fee. Ignored for Standard Payment. | Yes | empty string | For Connect payments |
| Application Fee Fixed Amount | Connect payments only. A fixed fee added to the percentage fee, in the currency's main unit, for example 0.50. | Yes | empty string | No |
| Payee Email | The customer's email. It's saved with the customer, and Stripe sends the payment receipt to it. | Yes | empty string | No |
| Description | A description of the payment, for example Order [OrderId]. It's also saved as the customer's description. | Yes | empty string | No |
| Payment Type | Who receives the funds. See Payment types. | No | Standard Payment | No |
| Payment To | Connect payments only. The ID of the connected account, for example acct_.... It must be empty for Standard Payment. | Yes | empty string | For Connect payments |
| Card Field | The form's Stripe Credit Card field. The list shows fields of that type only. | Yes | empty string | Yes |
| Amount | The amount to charge in the currency's main unit, with a dot for decimals, for example 49.95 or [OrderTotal]. The action converts it to cents. The in-product help says "in cents", but that's not what the action does. | Yes | empty string | Yes |
| Currency | A three-letter currency code, for example USD or EUR. | Yes | empty string | Yes |
| On Success | Actions to run when the payment is made. The charge ID is in [Stripe:ChargeId]. | No | None | No |
| On Error | Actions to run when Stripe rejects the payment, for example when the card is declined. The error is in [Stripe:ErrorMessage]. | No | None | No |
Output Parameters Reference
The action has no output parameters. It sets these tokens:
| Token | Description |
|---|---|
[Stripe:ChargeId] | The ID of the charge, for example ch_.... Save it to find or refund the payment later in Stripe. |
[Stripe:ErrorMessage] | Stripe's error message. Available in On Error. |
Payment types
| Payment Type | Who gets the money | Customer and charge are created in |
|---|---|---|
Standard Payment | Your Stripe account. No application fee is charged. | Your account |
Direct Payment to Connected Account | The connected account in Payment To. Your platform gets the application fee. | The connected account |
Destination Payment to Connected Account | The connected account in Payment To. Your platform gets the application fee. | Your account |
The application fee is Amount times Application Fee Percentage, plus Application Fee Fixed Amount. For example, 100.00 with 2.5 and 0.30 is a fee of 2.80. For more on the differences, see Stripe's documentation on Connect charges.
How the payment works
- The user submits the form. The Stripe Credit Card field sends the card to Stripe and gets back a one-time token. The field's value is that token, as JSON.
- The action creates a customer. It creates a Stripe customer with the token, the email and the description.
- The action charges the customer. It charges Amount in Currency, and sets
[Stripe:ChargeId]. - A list runs. If the charge is paid, On Success runs. If Stripe returns an error, for example a declined card, On Error runs.
Set the field's Publishable key, for example pk_test_.... It must belong to the same Stripe account, and the same test or live mode, as the connector's secret key.
Considerations
- Amounts are in the main unit, not cents. Enter
49.95, not4995. Extra decimals are cut off, not rounded. Don't include a currency symbol or thousands separators. - Zero-decimal currencies. For currencies without cents, such as JPY, type the code in upper case, for example
JPY. In lower case, the amount is multiplied by 100. - Set a percentage for Connect payments. For the two Connect payment types, Application Fee Percentage can't be empty. Use
0if you only want a fixed fee. - Payment To must match the type. If it's set for Standard Payment, or empty for a Connect payment, the action fails before anything is sent to Stripe.
- On Error only covers Stripe errors. A declined card or a wrong key runs On Error. If it's empty, the action fails with the error. Other problems, such as a missing connector, an empty card field or an invalid amount, fail the action with an exception, and On Error doesn't run. To handle those, put the action inside Execute Actions and use its On Error. If Stripe creates the charge but it isn't paid, the action fails with
Payment did not succeded!, also without running On Error. - A new customer every time. Each payment creates another Stripe customer. If you need one customer per user, use Stripe Checkout with Customer ID.
- One token, one use. Don't use the same card field in Stripe Create Customer in the same submission. Stripe accepts a card token only once.
- Starting from the template. The Stripe Payment Form with Tokens form template includes this action without a connector. Pick your connector in API Connector before you use it.
- Test first. Use test keys (
sk_test_...in the connector,pk_test_...in the field) and Stripe's test cards. - Where it works. Forms only, because the card comes from a form field.
Examples
To understand how to use the below examples, please see Running Examples.
1. Charge the order total
This action charges [OrderTotal] US dollars to the card in the StripeCard field. The funds go to your Stripe account. On success, the charge ID is saved with the order. Replace the connector ID with your Stripe connector.
{
"Title": "Stripe Payment with Token (not SCA compliant)",
"ActionType": "StripeChargeWithToken",
"Description": "Charge the order total",
"Parameters": {
"Credentials": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"PayeeEmail": "[Email]",
"Description": "Order [OrderId]",
"PaymentType": "StandardPayment",
"CardField": "StripeCard",
"Amount": "[OrderTotal]",
"Currency": "USD",
"OnSuccess": [
{
"Title": "Run SQL Query",
"ActionType": "RunSql",
"Parameters": {
"SqlQuery": "UPDATE Orders SET Status = 'Paid', StripeChargeId = @ChargeId WHERE OrderId = @OrderId",
"BindTokens": [
{
"name": "ChargeId",
"value": "[Stripe:ChargeId]"
},
{
"name": "OrderId",
"value": "[OrderId]"
}
]
}
},
{
"Title": "Display Message",
"ActionType": "ShowMessage",
"Parameters": {
"Message": "<p>Thank you! Your payment was received.</p>"
}
}
],
"OnError": [
{
"Title": "Display Error Message",
"ActionType": "ShowError",
"Parameters": {
"Message": "<p>We couldn't complete your payment: [Stripe:ErrorMessage]</p>"
}
}
]
}
}
2. Pay a seller and keep a fee
This action charges the order total as a destination payment to the seller's connected account in [SellerAccountId]. Your platform keeps 5% plus 0.30.
{
"Title": "Stripe Payment with Token (not SCA compliant)",
"ActionType": "StripeChargeWithToken",
"Description": "Pay the seller and keep the platform fee",
"Parameters": {
"Credentials": {
"Entry": "00000000-0000-0000-0000-000000000000"
},
"ApplicationFee": "5",
"ApplicationFeeFixedAmount": "0.30",
"PayeeEmail": "[Email]",
"Description": "Order [OrderId] from [SellerName]",
"PaymentType": "ConnectDestinationPayment",
"PaymentTo": "[SellerAccountId]",
"CardField": "StripeCard",
"Amount": "[OrderTotal]",
"Currency": "USD",
"OnError": [
{
"Title": "Display Error Message",
"ActionType": "ShowError",
"Parameters": {
"Message": "<p>We couldn't complete your payment: [Stripe:ErrorMessage]</p>"
}
}
]
}
}
Revised 09/27/2026