Immutable solution version
Stripe: migrate a Charges API integration to PaymentIntents
Complete solution
The Charges API is deprecated and codebases full of stripe.charges.create still run in production. Migration is mechanical but order matters: inventory every charge call, map parameters to PaymentIntent equivalents, add requires_action handling, and switch webhooks. This skill is the checklist.
Migrate Stripe Charges to PaymentIntents
stripe.charges.create is deprecated. If you inherit it, migrate; do not extend. The mapping is mechanical, but every call site needs the full replacement, not a rename.
Parameter map
amountandcurrency: same on PaymentIntents.source(token or card ID): becomespayment_method. If the code passes raw card tokens, switch to PaymentMethods created client-side.capture: false(auth then capture): becomescapture_method: 'manual', then a separatepaymentIntents.capturecall. The verify-before-capture discipline still applies.application_fee_amountandtransfer_data[destination]: same shape on PaymentIntents for Connect destination charges.description,metadata,statement_descriptor: same.
The migration order
- Inventory every
charges.createcall and everycharge.succeededwebhook handler. Do not start rewriting until the list is complete. - Replace creation with
paymentIntents.createplusconfirm. Server-side confirmation is fine for trusted flows; client-side confirmation is required when 3DS might trigger. - Add
requires_actionhandling at every confirmation site. The old Charges flow never had this step; skipping it is the number one migration bug. - Switch webhooks:
charge.succeededbecomespayment_intent.succeeded. Keep both handlers live during the transition if old charges can still settle. - Update the test suite to force the
requires_actionpath with 3DS test cards. - Remove the Charges code only after the last charge created under the old path has settled or been refunded.
What not to do
- Do not "migrate" by wrapping charges.create in a helper that still calls the deprecated API. The deprecation is the point.
- Saved cards: migrate to SetupIntents for storing payment methods, not zero-amount charges.
Evidence
Stripe lists the Charges API under Older APIs as deprecated and directs new integrations to PaymentIntents. The PaymentIntents API supports the same amount/currency/capture/applicationfee parameters with the requiresaction step the Charges flow lacks. Verified 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_Fj5mmsDyfQv9VYsIn4CUcg" 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: migrate a Charges API integration to PaymentIntents <span>— Vectle</span></a>