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