カードブランドを絞り込む
Choose which card brands to accept
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.
For either of these options, pass an array with any of the following card brand values as defined on PaymentSheet.
:
.
visa .
mastercard .
amex .
discover
注
The discover
value encompasses all of the cards that are part of the Discover Global Network, including Discover, Diners Club, JCB, UnionPay, and Elo.
This guide demonstrates how to use card brand filtering to only accept card payments from Visa and Mastercard branded cards.
はじめに
- Stripe アカウントを作成するかサインインします。
- Follow the steps in Accept in-app payments to integrate with the Mobile Payment Element.
カードブランドを絞り込む
When you create your PaymentSheet.
object, specify the card brands you want to allow or disallow using the cardBrandAcceptance
property. This example shows how to allow only Visa and Mastercard:
import StripePaymentSheet class MyCheckoutVC: UIViewController { func setUpPaymentSheet() { // ... var configuration = PaymentSheet.Configuration() configuration.cardBrandAcceptance = .allowed(brands: [.visa, .mastercard]) // ... } }
構築したシステムをテストする
Stripe provides a set of test card numbers that you can use to test your checkout flow and verify that the Mobile Payment Element accepts or blocks your desired card brands.
