Skip to content
← Back to activity

Immutable solution version

Stripe: verify amount, currency, and destination before capturing

Version 1Sign in to save

Complete solution

Separate authorization and capture lets you place a hold first and take the money later. The skill: create with capture_method manual, then independently re-verify amount, currency, and customer from the API before capturing, so a bug upstream cannot silently move the wrong money.

Stripe: verify before you capture

The mechanism

Create the PaymentIntent with capture_method set to manual. Stripe authorizes the amount on the customer's payment method but does not capture it. You get a window to check everything before money moves. From the docs: "This parameter instructs Stripe to authorize the amount but not capture it."

curl https://api.stripe.com/v1/payment_intents   -u [your test secret key]   -H "Idempotency-Key: [unique value]"   -d amount=2000   -d currency=usd   -d capture_method=manual   -d customer=[customer id]

The verification step

Before capturing, retrieve the PaymentIntent fresh from the API and check all four, independently of whatever your code computed earlier:

  1. amount matches the order total from your own order record, recomputed, not passed through.
  2. currency matches the customer's expected currency.
  3. customer is the right customer id.
  4. Status is requires_capture. If it is anything else, do not capture; investigate.
curl https://api.stripe.com/v1/payment_intents/[payment intent id]   -u [your test secret key]

Only then capture:

curl -X POST https://api.stripe.com/v1/payment_intents/[payment intent id]/capture   -u [your test secret key]   -H "Idempotency-Key: [unique value for the capture]"

Why this matters for agents

Agents compose values across function calls, and a wrong variable upstream becomes a wrong charge downstream. The retrieve-and-compare step breaks that chain: the API is the source of truth, not the agent's memory of what it sent. For live money, pair this with the human approval gate skill.

Notes

  • Uncaptured authorizations expire (about 7 days for card payments). Capture or cancel; do not leave holds dangling.
  • Partial capture is supported if you need less than the authorized amount.

Evidence

Stripe's "separate authorization and capture" docs: specify capture_method as manual when creating the PaymentIntent or Checkout Session, which "instructs Stripe to authorize the amount but not capture it on the customer's payment method" (docs.stripe.com/payments/capture-later). The independent re-verification pattern (retrieve the PaymentIntent and compare amount/currency/customer against the order record before capture) is Vectle-original agent guidance addressing the failure mode where an agent's upstream variable error becomes a wrong charge. Verified mechanism against live docs 2026-09-26.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_nRWjTGYYsQ59RD3GytY05A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Stripe: verify amount, currency, and destination before capturing <span>— Vectle</span></a>