# カードブランドを絞り込む 受け付けるカードブランドを選択する # iOS > This is a iOS for when platform is ios. View the full page at https://docs.stripe.com/payments/mobile/embedded-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`:指定したものを除くすべてのカードブランドを受け付けます。 これらのオプションのいずれかに、`EmbeddedPaymentElement.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. [Payment Element アプリ内決済を受け付ける](https://docs.stripe.com/payments/mobile/accept-payment-embedded.md)ガイドに従って、モバイル Payment Element を統合します。 ## カードブランドを絞り込む `EmbeddedPaymentElement.Configuration` オブジェクトを作成するときは、`cardBrandAcceptance` プロパティを使用して、許可または禁止するカードブランドを指定します。次に、Visa と Mastercard のみを許可する例を示します。 ```swift import StripePaymentSheet class MyCheckoutVC: UIViewController { func createEmbeddedPaymentElement() async throws -> EmbeddedPaymentElement { // ... var configuration = EmbeddedPaymentElement.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/embedded-filter-card-brands?platform=android. Stripe [In-app Payments](https://docs.stripe.com/payments/mobile.md)を使用して、受け付けるクレジットカードブランドを管理します。クレジットカードブランドのフィルタリングでは、以下に対して許可または禁止のクレジットカードブランドを指定できます: - In-app Payments のクレジットカードフォーム - 買い手が Apple 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. [Payment Element アプリ内決済を受け付ける](https://docs.stripe.com/payments/mobile/accept-payment-embedded.md)ガイドに従って、モバイル Payment Element を統合します。 ## カードブランドフィルターを指定する `EmbeddedPaymentElement.Configuration` オブジェクトを作成するときは、`cardBrandAcceptance` プロパティを使用して、許可または禁止するカードブランドを指定します。次に、Visa と Mastercard のみを許可する例を示します。 ```kotlin import com.stripe.android.paymentelement.EmbeddedPaymentElement @Composable fun CheckoutScreen() { val embeddedPaymentElementBuilder = remember { EmbeddedPaymentElement.Builder( createIntentCallback = { paymentMethod, shouldSavePaymentMethod -> // Create intent }, resultCallback = { // Handle result }, ) } val embeddedPaymentElement = rememberEmbeddedPaymentElement(embeddedPaymentElementBuilder) LaunchedEffect(embeddedPaymentElement) { embeddedPaymentElement.configure( configuration = EmbeddedPaymentElement.Configuration.Builder("Powdur").cardBrandAcceptance( PaymentSheet.CardBrandAcceptance.allowed( listOf( PaymentSheet.CardBrandAcceptance.BrandCategory.Visa, PaymentSheet.CardBrandAcceptance.BrandCategory.Mastercard ) ) ) .build(), intentConfiguration = PaymentSheet.IntentConfiguration.Builder().build(), ) } embeddedPaymentElement.Content() } ``` ## 構築したシステムをテストする 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) # React Native > This is a React Native for when platform is react-native. View the full page at https://docs.stripe.com/payments/mobile/embedded-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. 「[アプリ内決済を受け付ける](https://docs.stripe.com/payments/mobile/accept-payment-embedded.md)」ガイドに従って、Payment Element を統合します。 ## カードブランドを絞り込む Payment Element を作成するときに、`cardBrandAcceptance` プロパティを使用して許可または禁止するクレジットカードブランドを指定します。次の例は、Visa と Mastercard のみを許可する方法を示しています。 ```javascript import { useEmbeddedPaymentElement, EmbeddedPaymentElementConfiguration, PaymentSheet } from '@stripe/stripe-react-native'; export default function CheckoutScreen() { const initialize = async () => { const elementConfig: EmbeddedPaymentElementConfiguration = { // ... other configuration optionscardBrandAcceptance: { filter: PaymentSheet.CardBrandAcceptanceFilter.Allowed, brands: [ PaymentSheet.CardBrandCategory.Visa, PaymentSheet.CardBrandCategory.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)