カードブランドを絞り込む
受け付けるカードブランドを選択する
Use Stripe In-app Payments to control which card brands you accept. Card brand filtering lets you specify allowed or disallowed card brands for:
- The credit card form in In-app Payments
- 買い手が Apple Pay で使用できるカード
When you configure In-app Payments, you can specify one of two options:
allowed
:指定したカードブランドのみを受け付けます。disallowed
:指定したものを除くすべてのカードブランドを受け付けます。
これらのオプションのいずれかに、EmbeddedPaymentElement.
で定義されている以下のカードブランド値のいずれかを含む配列を渡します。
.
visa .
mastercard .
amex .
discover
注
discover
値には、ディスカバー、ダイナースクラブ、JCB、銀聯、Elo など、ディスカバーグローバルネットワークに属するすべてのカードが含まれます。
このガイドでは、カードブランドのフィルタリングを使用して、Visa および Mastercard ブランドのカードからのカード支払いのみを受け付ける方法について説明します。
はじめに
- Stripe アカウントを作成するかサインインします。
- Payment Element アプリ内決済を受け付けるガイドに従って、モバイル Payment Element を統合します。
カードブランドを絞り込む
EmbeddedPaymentElement.
オブジェクトを作成するときは、cardBrandAcceptance
プロパティを使用して、許可または禁止するカードブランドを指定します。次に、Visa と Mastercard のみを許可する例を示します。
import StripePaymentSheet class MyCheckoutVC: UIViewController { func createEmbeddedPaymentElement() async throws -> EmbeddedPaymentElement { // ... var configuration = EmbeddedPaymentElement.Configuration() configuration.cardBrandAcceptance = .allowed(brands: [.visa, .mastercard]) // ... } }
構築したシステムをテストする
Stripe には、決済フローをテストし、Mobile Payment Element が目的のカードブランドを受け入れるかブロックするかを確認するために使用できる、テストカード番号のセットが用意されています。
