コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
売上
プラットフォームおよびマーケットプレイス
資金管理
開発者向けリソース
概要
バージョン管理
変更ログ
API バージョンのアップグレード
SDK バージョンをアップグレードする
Essentials
SDK
API
テスト
Stripe CLI
ツール
ワークベンチ
開発者ダッシュボード
Stripe Shell
Visual Studio Code をご利用の場合
機能
ワークフロー
イベントの送信先
Stripe 健全性アラートファイルのアップロード
AI ソリューション
エージェントツールキット
セキュリティとプライバシー
セキュリティ
プライバシー
Stripe を拡張する
Build Stripe apps
Use apps from Stripe
    概要
    Stripe-built apps
    Adobe Commerce
      ガイド
        支払いにその他のメタデータを追加
        Stripe Webhook にカスタムイベントを追加
        決済フォームに外部の支払い方法を追加する
        Express Checkout モーダルの配送方法を無効化
        手動キャプチャーを有効にする
        マルチキャプチャーを有効にする
        オーバーキャプチャーを有効にする
        PaymentElement フォームに表示される規約を非表示
        税金の計算にカスタムの手数料を導入する
        3D セキュアの支払いを回収する前に注文を実施
        購入時の決済フォームのスタイルを設定
        特定の支払い方法が表示されない理由をテスト
      Payments and tax app for Adobe Commerce
      Standalone tax app for Adobe Commerce
    Cegid
    Commercetools
    Mirakl
    NetSuite
    Oracle Opera
    PrestaShop
    Salesforce
    SAP
    Shopware 6
    Stripe Tax for BigCommerce
    Stripe Tax for WooCommerce
    Partner apps
    Build your own app
パートナー
Partner Ecosystem
パートナー認定
ホーム開発者向けリソースUse apps from StripeAdobe CommerceCookbooks

Express Checkout モーダルで特定の配送方法を無効にする

Express Checkout モーダルから特定の配送方法を削除します。

店舗での受け取りなど特定の配送方法では、集荷先住所など、顧客に追加情報を入力していただく必要があります。Express Checkout ウォレットは支払いモーダルをカスタマイズする方法を提供していないため、これらの配送方法は Express Checkout ウォレットには適していません。

この種の配送方法を使用する場合は、モジュールのカスタマイズを使用して Express Checkout に対して配送方法を無効にすることができます。

新しいモジュールを作成する

次のディレクトリ構造で新しいモジュールを作成します。Vendor をご希望のベンダー名に置き換えます。

app/code/Vendor/StripeCustomizations/ ├── etc/ │ └── module.xml ├── Plugin/ │ └── Api/ │ └── Response/ │ └── ECEResponse.php ├── registration.php

registration.php 内で、モジュールを Magento に登録します。

<?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Vendor_StripeCustomizations', __DIR__ );

etc/module.xml 内で、モジュールを定義し、Stripe モジュールの後に読み込まれるように依存関係を設定します。

<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd"> <module name="Vendor_StripeCustomizations" setup_version="1.0.0"> <sequence> <module name="StripeIntegration_Payments"/> </sequence> </module> </config>

etc/di.xml 内で、次のプラグインを定義します。

<?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="StripeIntegration\Payments\Model\Config"> <plugin name="vendor_stripecustomizations_eceresponse_plugin" type="Vendor\StripeCustomizations\Plugin\Api\Response\ECEResponse" sortOrder="10" disabled="false" /> </type> </config>

Plugin/Api/Response/ECEResponse.php 内で、afterMethod インターセプターを作成します。

<?php namespace Vendor\StripeCustomizations\Plugin\Payments; class ECEResponse { /** * After plugin for getShippingRatesForQuoteShippingAddress method. * * @param $subject * @param array $result * @return array */ public function afterGetShippingRatesForQuoteShippingAddress($subject, array $result) { $idToRemove = "store_pickup"; return array_filter($result, function ($shippingRate) use ($idToRemove) { return $shippingRate['id'] !== $idToRemove; }); } }

モジュールを有効にします。

php bin/magento module:enable Vendor_StripeCustomizations php bin/magento setup:upgrade php bin/magento cache:clean php bin/magento cache:flush
このページはお役に立ちましたか。
はいいいえ
お困りのことがございましたら 、サポートにお問い合わせください。
早期アクセスプログラムにご参加ください。
変更ログをご覧ください。
ご不明な点がございましたら、お問い合わせください。
LLM ですか?llms.txt を読んでください。
Powered by Markdoc