カードブランドを絞り込む
受け付けるカードブランドを選択する
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.
これらのオプションのいずれかに、EmbeddedPaymentElement.
で定義されている以下のカードブランド値のいずれかを含む配列を渡します。
.
visa .
mastercard .
amex .
discover
注
discover
値には、ディスカバー、ダイナースクラブ、JCB、銀聯、Elo など、ディスカバーグローバルネットワークに属するすべてのカードが含まれます。
このガイドでは、カードブランドのフィルタリングを使用して、Visa および Mastercard ブランドのカードからのカード支払いのみを受け付ける方法について説明します。
はじめに
- Stripe アカウントを作成するかサインインします。
- Mobile Payment Element と統合するには、Embedded Payment Element のアプリ内決済を受け付けるガイドに従ってください。
カードブランドを絞り込む
EmbeddedPaymentElement.
オブジェクトを作成するときは、cardBrandAcceptance
プロパティを使用して、許可または禁止するカードブランドを指定します。次に、Visa と Mastercard のみを許可する例を示します。
@_spi(EmbeddedPaymentElementPrivateBeta) import StripePaymentSheet class MyCheckoutVC: UIViewController { func createEmbeddedPaymentElement() async throws -> EmbeddedPaymentElement { // ... var configuration = EmbeddedPaymentElement.Configuration() configuration.cardBrandAcceptance = .allowed(brands: [.visa, .mastercard]) // ... } }
構築したシステムをテストする
Stripe には、決済フローをテストし、Mobile Payment Element が目的のカードブランドを受け入れるかブロックするかを確認するために使用できる、テストカード番号のセットが用意されています。
