# カードブランドを絞り込む 受け付けるカードブランドを選択する # iOS > This is a iOS for when platform is ios. View the full page at https://docs.stripe.com/payments/mobile/filter-card-brands?platform=ios. Stripe [In-app Payments](https://docs.stripe.com/payments/mobile.md)を使用して、受け付けるクレジットカードブランドを管理します。クレジットカードブランドのフィルタリングでは、以下に対して許可または禁止のクレジットカードブランドを指定できます: - In-app Payments のクレジットカードフォーム - 買い手が Apple Pay で使用できるカード In-app Payments を設定する際は、次の 2 つのオプションのいずれかを指定できます: - `allowed`:指定したカードブランドのみを受け付けます。 - `disallowed`:指定したものを除くすべてのカードブランドを受け付けます。 これらのオプションのいずれかに、`PaymentSheet.Configuration.CardBrandAcceptance.BrandCategory` で定義されている以下のカードブランド値のいずれかを含む配列を渡します。 - `.visa` - `.mastercard` - `.amex` - `.discover` > `discover` 値には、Discover、ダイナースクラブ、JCB、銀聯、Elo など、Discover グローバルネットワークに属するすべてのカードが含まれます。 このガイドでは、カードブランドのフィルタリングを使用して、Visa および Mastercard ブランドのカードからのカード支払いのみを受け付ける方法について説明します。 ## Before you begin 1. [Stripe アカウントを作成する](https://dashboard.stripe.com/register)か[サインイン](https://dashboard.stripe.com/login)します。 1. Mobile Payment Element を導入するには、[アプリ内決済を受け付ける](https://docs.stripe.com/payments/mobile/accept-payment.md)ための手順に従ってください。 ## カードブランドを絞り込む `PaymentSheet.Configuration` オブジェクトを作成するときは、`cardBrandAcceptance` プロパティを使用して、許可または禁止するカードブランドを指定します。次に、Visa と Mastercard のみを許可する例を示します。 ```swift import StripePaymentSheet class MyCheckoutVC: UIViewController { func setUpPaymentSheet() { // ... var configuration = PaymentSheet.Configuration()configuration.cardBrandAcceptance = .allowed(brands: [.visa, .mastercard]) // ... } } ``` ## 構築したシステムをテストする Stripe には、決済フローをテストし、Mobile Payment Element が目的のカードブランドを受け入れるかブロックするかを確認するために使用できる、[テストカード番号](https://docs.stripe.com/testing.md#cards)のセットが用意されています。 ![カードブランドが許可されていない場合の Mobile Payment Element](https://b.stripecdn.com/docs-statics-srv/assets/filter-card-brands-ios.c8b98aa3d749a318709592a99ece0cdd.png) # Android > This is a Android for when platform is android. View the full page at https://docs.stripe.com/payments/mobile/filter-card-brands?platform=android. Stripe [In-app Payments](https://docs.stripe.com/payments/mobile.md)を使用して、受け付けるクレジットカードブランドを管理します。クレジットカードブランドのフィルタリングでは、以下に対して許可または禁止のクレジットカードブランドを指定できます: - In-app Paymentsのクレジットカードフォーム - 買い手が Google Pay で使用できるカード。 In-app Payments を設定する際は、次の 2 つのオプションのいずれかを指定できます: - `allowed`:指定したカードブランドのみを受け付けます。 - `disallowed`:指定したものを除くすべてのカードブランドを受け付けます。 これらのオプションのいずれかに、`PaymentSheet.CardBrandAcceptance.BrandCategory` で定義されている以下のカードブランド値のいずれかを含む配列を渡します。 - `Visa` - `Mastercard` - `Amex` - `Discover` > `Discover` 値には、Discover、ダイナースクラブ、JCB、銀聯、Elo など、Discover グローバルネットワークに属するすべてのカードが含まれます。 このガイドでは、カードブランドのフィルタリングを使用して、Visa および Mastercard ブランドのカードからのカード支払いのみを受け付ける方法について説明します。 ## Before you begin 1. [Stripe アカウントを作成する](https://dashboard.stripe.com/register)か[サインイン](https://dashboard.stripe.com/login)します。 1. Mobile Payment Element を導入するには、[アプリ内決済を受け付ける](https://docs.stripe.com/payments/mobile/accept-payment.md)ための手順に従ってください。 ## カードブランドを絞り込む `PaymentSheet.Configuration` オブジェクトを作成するときは、`cardBrandAcceptance` プロパティを使用して、許可または禁止するカードブランドを指定します。次に、Visa と Mastercard のみを許可する例を示します。 ```kotlin import com.stripe.android.paymentsheet.PaymentSheet class CheckoutActivity : AppCompatActivity() { private fun onPayClicked( paymentSheet: PaymentSheet, paymentIntentClientSecret: String, ) { val configuration = PaymentSheet.Configuration.Builder(merchantDisplayName = "Example, Inc.").cardBrandAcceptance( PaymentSheet.CardBrandAcceptance.allowed( listOf( PaymentSheet.CardBrandAcceptance.BrandCategory.Visa, PaymentSheet.CardBrandAcceptance.BrandCategory.Mastercard ) ) ) .build() // Present Payment Sheet paymentSheet.presentWithPaymentIntent(paymentIntentClientSecret, configuration) } } ``` ## 構築したシステムをテストする Stripe には、決済フローをテストし、Mobile Payment Element が目的のカードブランドを受け入れるかブロックするかを確認するために使用できる、[テストカード番号](https://docs.stripe.com/testing.md#cards)のセットが用意されています。 ![カードブランドが許可されていない場合の Mobile Payment Element](https://b.stripecdn.com/docs-statics-srv/assets/filter-card-brands-android.fb9f9a9aa83ea4848db35adbaca08e7a.png) # React Native > This is a React Native for when platform is react-native. View the full page at https://docs.stripe.com/payments/mobile/filter-card-brands?platform=react-native. Stripe [In-app Payments](https://docs.stripe.com/payments/mobile.md)を使用して、受け付けるクレジットカードブランドを管理します。クレジットカードブランドのフィルタリングでは、以下に対して許可または禁止のクレジットカードブランドを指定できます: - In-app Payments のクレジットカードフォーム。 - 買い手が Apple Pay で使用できるカード In-app Payments を設定する際は、次の 2 つのオプションのいずれかを指定できます: - `Allowed`:指定したカードブランドのみを受け付けます。 - `Disallowed`:指定したものを除くすべてのカードブランドを受け付けます。 これらのオプションのいずれかに、`PaymentSheet.CardBrandCategory` で定義されている以下のカードブランド値を含む配列を渡します。 - `.Visa` - `.Mastercard` - `.Amex` - `.Discover` > `Discover` の値には、Discover、ダイナースクラブ、JCB、銀聯、Elo など、Discover グローバルネットワークに属するすべてのカードが指定されます。 このガイドでは、カードブランドのフィルタリングを使用して、Visa および Mastercard ブランドのカードからのカード支払いのみを受け付ける方法について説明します。 ## Before you begin 1. [Stripe アカウントを作成する](https://dashboard.stripe.com/register)か[サインイン](https://dashboard.stripe.com/login)します。 1. Mobile Payment Element を導入するには、[アプリ内決済を受け付ける](https://docs.stripe.com/payments/mobile/accept-payment.md)ための手順に従ってください。 ## カードブランドを絞り込む PaymentSheet の作成時に、`cardBrandAcceptance` プロパティを使用して、許可または禁止するカードブランドを指定します。以下は、Visa と Mastercard のみを許可している例です。 ```javascript import { useStripe } from '@stripe/stripe-react-native'; export default function CheckoutScreen() { const { initPaymentSheet } = useStripe(); const initializePaymentSheet = async () => { const { error } = await initPaymentSheet({ // ... other configuration optionscardBrandAcceptance: { filter: PaymentSheet.CardBrandAcceptanceFilter.Allowed, brands: [PaymentSheet.CardBrandCategory.Visa, PaymentSheet.CardBrandCategory.Mastercard], }, }); if (error) { // handle error } }; } ``` ## 構築したシステムをテストする Stripe には、決済フローをテストし、Mobile Payment Element が目的のカードブランドを受け入れるかブロックするかを確認するために使用できる、[テストカード番号](https://docs.stripe.com/testing.md#cards)のセットが用意されています。 ![カードブランドが許可されていない場合の Mobile Payment Element](https://b.stripecdn.com/docs-statics-srv/assets/filter-card-brands-ios.c8b98aa3d749a318709592a99ece0cdd.png)