# Stripe.jsから非推奨の決済インテント、Setup Intents、Sourcesメソッドを削除 ## 新機能 Stripe.js から非推奨のメソッドをいくつか削除し、より明確な命名と機能の向上を備えた同等のメソッドを使用します。 ## 対応処理が必要な変更である理由 以下のメソッドは削除されました。これらのメソッドを呼び出すと、エラーが発生します。 **Payment Intents API:** - `handleCardPayment` - `confirmPaymentIntent` - `handleFpxPayment` **Setup Intents API:** - `handleCardSetup` - `confirmSetupIntent` **Sources API:** - `createSource` - `retrieveSource` ## 効果 導入で非推奨のメソッドを使用している場合は、次の例のように、別のメソッドを使用するようにコードを更新する必要があります。 ### Payment Intents API メソッド - `handleCardPayment` を、API シグネチャと動作が似ている [confirmCardPayment](https://docs.stripe.com/js/payment_intents/confirm_card_payment?api-version=2026-03-25.dahlia) に置き換えます。 ```javascript // Before (deprecated) stripe.handleCardPayment(clientSecret, cardElement); // After stripe.confirmCardPayment(clientSecret, { payment_method: { card: cardElement, }, }); ``` - `confirmPaymentIntent` をより明示的な [confirmCardPayment](https://docs.stripe.com/js/payment_intents/confirm_card_payment?api-version=2026-03-25.dahlia) に置き換えます。 ```javascript // Before (deprecated) stripe.confirmPaymentIntent(clientSecret, { payment_method: { card: cardElement, }, }); // After stripe.confirmCardPayment(clientSecret, { payment_method: { card: cardElement, }, }); ``` - `handleFpxPayment` を、API 署名と動作が同一の [confirmFpxPayment](https://docs.stripe.com/js/payment_intents/confirm_fpx_payment?api-version=2026-03-25.dahlia) に置き換えます。 ```javascript // Before (deprecated) stripe.handleFpxPayment(clientSecret, { payment_method: { fpx: fpxBankElement, }, }); // After stripe.confirmFpxPayment(clientSecret, { payment_method: { fpx: fpxBankElement, }, }); ``` ### Setup Intents API メソッド - handleCardSetup` を、API シグネチャと動作が似ている [confirmCardSetup](https://docs.stripe.com/js/setup_intents/confirm_card_setup?api-version=2026-03-25.dahlia) に置き換えます。 ```javascript // Before (deprecated) stripe.handleCardSetup(clientSecret, cardElement); // After stripe.confirmCardSetup(clientSecret, { payment_method: { card: cardElement, }, }); ``` - `confirmSetupIntent` をより明示的な [confirmCardSetup](https://docs.stripe.com/js/setup_intents/confirm_card_setup?api-version=2026-03-25.dahlia) に置き換えます。 ```javascript // Before (deprecated) stripe.confirmSetupIntent(clientSecret, { payment_method: { card: cardElement, }, }); // After stripe.confirmCardSetup(clientSecret, { payment_method: { card: cardElement, }, }); ``` ### Sources API メソッド コードで、従来の Sources API からの `createSource` や `retrieveSource` などのメソッドを使用している場合は、代わりに [Payment Methods API を使用するように組み込みを移行してください](https://docs.stripe.com/payments/payment-methods/transitioning.md)。 [Payment Methods API](https://docs.stripe.com/payments/payment-methods.md) は、決済方法、再利用性、法令遵守要件に対するサポートを強化します。 ## 関連する変更 - [Address Element の state フィールドをデフォルトでラテン文字形式に変更](https://docs.stripe.com/changelog/dahlia/2026-03-25/address-element-getvalue-and-change-event-formatting.md) - [elements.update() メソッドを更新して Promise を返すように変更](https://docs.stripe.com/changelog/dahlia/2026-03-25/elements-update-returns-promise.md) - [options.layout.radios のブール値のサポートを削除](https://docs.stripe.com/changelog/dahlia/2026-03-25/disallow-booleans-for-radios.md) - [決済初期化メソッドの名前を変更](https://docs.stripe.com/changelog/dahlia/2026-03-25/rename-init-checkout-to-init-checkout-elements.md) - [埋め込み型決済初期化メソッドの名称を変更](https://docs.stripe.com/changelog/dahlia/2026-03-25/rename-init-embedded-checkout-to-create-embedded-checkout-page.md)