Stripe Payment Intent
Stripe Payment Intent manages Stripe payments from start to finish. A payment (a payment intent in Stripe) stands for a charge you want to make to a customer and goes through several steps: it is created, confirmed with a payment method and collected. With this component you can do each step from a flow, and also hold an amount to collect later or cancel a payment you no longer want to make.
It is the way of charging that Stripe recommends for cards and other modern payment methods. For a direct charge to a card token, there is also Stripe Charge.
When to use it
- You want to charge a customer with the payment method they already have saved in Stripe.
- You run a booking service and want to hold the amount at booking time and collect it when the service is delivered.
- A booking is cancelled and you want to release the held amount.
- You want to check the status of a customer’s payments to answer a support request.
Configuration
You need a Stripe API credential with the secret key of your Stripe account. See Credentials.
| Field | What it does |
|---|---|
| Credential (required) | The Stripe API credential of your account. |
| Operation (required) | The action the component performs. Defaults to Create. See Operations. |
| Mode | Only in Get. By ID looks up one payment; All returns the list of payments. Defaults to By ID. |
| Payment Intent ID | The payment’s identifier in Stripe (starts with pi_). Required in Cancel, Capture, Confirm, Update and Get with By ID. |
| Customer ID | The customer’s identifier in Stripe (starts with cus_). In Create, links the payment to the customer. In Get with All, shows only that customer’s payments. |
| Amount | Only in Create, and required there. The amount in the smallest unit of the currency, for example cents: 1000 is 10.00. |
| Currency | Only in Create, and required there. The payment’s currency, such as eur or usd. Defaults to usd. |
| Description | Free text saved with the payment. In Create and Update. |
| Payment Method ID | The payment method used to charge (starts with pm_). In Create, Update and Confirm. It comes empty; on Update, leaving it empty keeps the payment method it already had. With the test key you can use pm_card_visa, a Stripe test card. |
| Confirm Immediately | Only in Create. true confirms the payment as it is created, without a separate Confirm. Empty or false, the payment waits for confirmation. |
| Capture Method | In Create and Update. automatic collects as soon as the payment is confirmed; manual only holds the amount and you collect it later with Capture. Left empty, collection is automatic. |
| Allow Redirects | Only in Create. never accepts only payment methods that do not send the customer to another page; this suits automated flows. always accepts all of them. Defaults to never. |
| Return URL | In Create and Confirm. The page the customer returns to if the payment method sends them to another page to authorize the payment. In Create, only used with Allow Redirects set to always. |
| Setup Future Usage | Only in Create. Saves the payment method on the customer for future payments: on_session if the customer will be present for those payments, off_session if you will charge them without the customer. Left empty, it is not saved. |
| Limit | Only in Get with All. Maximum number of payments returned, between 1 and 100. Defaults to 100. |
Operations
- Cancel: cancels a payment that has not been collected yet. If an amount was held, it is released.
- Capture: collects a payment that was created with Capture Method set to
manualand is already confirmed. In any other case the component stops and explains why. - Confirm: confirms a payment with the given payment method, which is the step that triggers the charge or the hold.
- Create: creates a payment for the given amount and currency.
- Get: with
By IDreturns one payment; withAllreturns the list of payments, for one customer if you give one. - Update: changes the description, payment method or capture method of a payment that is not yet complete.
Output
The Data output returns the payment you worked with. With Get and All, it returns one item per payment. Each item includes, among other Stripe details, the payment’s identifier, amount, currency and status, for example requires_confirmation (waiting for confirmation), requires_capture (amount held) or succeeded (collected).
You can connect it to a condition that checks the status, to a confirmation email or to your order system. The component can also be connected to an Agent as a tool, so the agent decides when to use it. See Tool Mode.
Example
A car rental company holds a 300 EUR deposit when a booking is confirmed and only collects it if there is damage.
- When the booking is confirmed, add Stripe Payment Intent with Operation set to
Create. - Set Amount to
30000, Currency toeur, the customer’s Customer ID and their payment method in Payment Method ID. - Set Capture Method to
manualand Confirm Immediately totrue. The amount is now held. - Store the payment’s identifier with the booking.
- When the car is returned, use another Stripe Payment Intent with
Captureif the deposit must be collected, or withCancelto release it.
Good practices
- Test your flows with Stripe’s test key and test cards before you move to the live key.
- Stripe only keeps an amount on hold for a limited time. Capture or cancel held payments instead of leaving them forgotten.
Related components
- Stripe Customer: create and manage customers.
- Stripe Charge: direct charges with a card token.
- Stripe Refund: refund a payment that was collected.