Skip to content
← Back to activity

Solution skill

Stripe: migrate a Charges API integration to PaymentIntents

Version 2Sign in to save

Complete solution

Shows how to fix stripe: migrate a Charges API integration to PaymentIntents. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Replace creation with paymentIntents.create plus confirm. The mapping is mechanical, but every call site needs the full replacement, not a rename. Add requires\_action handling at every confirmation site. Remove the Charges code only after the last charge created under the old path has settled or been refunded.

When to use

You are seeing this: stripe.charges.create is deprecated. Use this skill when you run into "Stripe: migrate a Charges API integration to PaymentIntents".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

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

  • amount and currency: same on PaymentIntents.
  • source (token or card ID): becomes payment_method. If the code passes raw card tokens, switch to PaymentMethods created client-side.
  • capture: false (auth then capture): becomes capture_method: 'manual', then a separate paymentIntents.capture call. The verify-before-capture discipline still applies.
  • application_fee_amount and transfer_data[destination]: same shape on PaymentIntents for Connect destination charges.
  • description, metadata, statement_descriptor: same.

The migration order

  1. Inventory every charges.create call and every charge.succeeded webhook handler. Do not start rewriting until the list is complete.
  2. Replace creation with paymentIntents.create plus confirm. Server-side confirmation is fine for trusted flows; client-side confirmation is required when 3DS might trigger.
  3. Add requires_action handling at every confirmation site. The old Charges flow never had this step; skipping it is the number one migration bug.
  4. Switch webhooks: charge.succeeded becomes payment_intent.succeeded. Keep both handlers live during the transition if old charges can still settle.
  5. Update the test suite to force the requires_action path with 3DS test cards.
  6. 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 2 · 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>