# 顧客の氏名を収集 ビジネス名と個人名を決済時にファーストクラスのフィールドとして徴収します。 # ホスト型ページ > This is a ホスト型ページ for when payment-ui is stripe-hosted. View the full page at https://docs.stripe.com/payments/checkout/name-collection?payment-ui=stripe-hosted. You can enable name collection on the payment form to collect business or individual names from your customers. The information is available after the session is complete. これらの*ファーストクラス* (First-class fields are prominent input fields that appear at the top level of the payment form and API, rather than being grouped within other sections such as billing or shipping details)の名前は、Billing および配送先情報内で収集された名前とは別に、有効化されている場合は常に支払いフォームのトップレベルの名前フィールドとして表示されます。 ![決済フォームのファーストクラスの名前のフィールド](https://b.stripecdn.com/docs-statics-srv/assets/preview.d9469cc97e1794c04837c664c0cda4bb.png) 決済では、連絡先の詳細内の支払いフォームに最上位の名前フィールドが追加されます。 ## Enable name collection 名前回収の設定を指定して、決済セッションを作成します。名前回収を有効にするには、決済セッションの作成時に [name_回収](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-name_collection)オブジェクトを設定します。ビジネス名、個人名、またはその両方を徴収し、ニーズに応じて各フィールドを必須またはオプションとして設定できます。 ```curl curl https://api.stripe.com/v1/checkout/sessions \ -u "<>:" \ -d mode=payment \ --data-urlencode success_url="https://example.com/success" \ -d "line_items[0][price]"="{{PRICE_ID}}" \ -d "line_items[0][quantity]"=1 \ -d "name_collection[business][enabled]"=true \ -d "name_collection[individual][enabled]"=true \ -d "name_collection[individual][optional]"=true ``` > ビジネス名回収を必須に設定すると、Express Checkout や Apple Pay などのワンクリック ボタンが支払いフォームの下部に移動するか、無効になります。 ## Retrieve the collected names セッション後の *Customer* (Customer objects represent customers of your business. They let you reuse payment methods and give you the ability to track multiple payments) オブジェクト、または *決済セッション* (A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through Checkout. After a successful payment, the Checkout Session contains a reference to the Customer, and either the successful PaymentIntent or an active Subscription) オブジェクトから顧客のビジネス名または個人名を取得できます。 ### 顧客 決済では、収集された名前が Customer オブジェクトのそれぞれ[のビジネス名](https://docs.stripe.com/api/customers/object.md#customer_object-business_name)または[個人名](https://docs.stripe.com/api/customers/object.md#customer_object-individual_name)プロパティに保存されます。このプロパティには、[API](https://docs.stripe.com/api/customers/retrieve.md) で Customer オブジェクトを直接取得するか、*Webhook* で [customer.created](https://docs.stripe.com/api/events/types.md#event_types-customer.created) イベントをリッスンすることでプログラムでアクセスできます。 Customer オブジェクトの[名前](https://docs.stripe.com/api/customers/object.md#customer_object-name)も、その注文でビジネス名または個人名に設定されます。 ```json { "object": { "id": "cus_HQmikpKnGHkNwW", "object": "customer", ... "name": "Stripe, Inc.""business_name": "Stripe, Inc." ..."individual_name": "Jenny Rosen" ... } } ``` [ダッシュボード](https://dashboard.stripe.com/customers)で顧客名を確認することもできます。 ### 決済セッション 顧客の名前は、Checkout Sessionオブジェクトの `collected_information` ハッシュと `customer_details` ハッシュにも保存されます。 - [collected_information.business_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-collected_information-business_name) and [collected_information.individual_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-collected_information-individual_name) - [customer_details.business_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-customer_details-business_name) and [customer_details.individual_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-customer_details-individual_name) ```json { "object": { "id": "cs_test_a1dJwt0TCJTBsDkbK7RcoyJ91vJxe2Y", "object": "checkout.session", ... "collected_information": {"business_name": "Stripe, Inc.", "individual_name": "Jenny Rosen" }, ... "customer": "cus_id_of_new_customer", "customer_details": { ..."business_name": "Stripe, Inc.", "individual_name": "Jenny Rosen", "name": "Stripe, Inc." }, ... } } ``` 決済セッションが成功すると、Stripe は [payment.session.completed](https://docs.stripe.com/api/events/types.md#event_types-checkout.session.completed) イベントを送信します。このイベントには 決済 Session オブジェクトと収集された値が含まれ、*Webhook* でリッスンできます。 # Embedded Page > This is a Embedded Page for when payment-ui is embedded-form. View the full page at https://docs.stripe.com/payments/checkout/name-collection?payment-ui=embedded-form. You can enable name collection on the payment form to collect business or individual names from your customers. The information is available after the session is complete. これらの*ファーストクラス* (First-class fields are prominent input fields that appear at the top level of the payment form and API, rather than being grouped within other sections such as billing or shipping details)の名前は、Billing および配送先情報内で収集された名前とは別に、有効化されている場合は常に支払いフォームのトップレベルの名前フィールドとして表示されます。 ![決済フォームのファーストクラスの名前のフィールド](https://b.stripecdn.com/docs-statics-srv/assets/preview.d9469cc97e1794c04837c664c0cda4bb.png) 決済では、連絡先の詳細内の支払いフォームに最上位の名前フィールドが追加されます。 ## Enable name collection 名前回収の設定を指定して、決済セッションを作成します。名前回収を有効にするには、決済セッションの作成時に [name_回収](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-name_collection)オブジェクトを設定します。ビジネス名、個人名、またはその両方を徴収し、ニーズに応じて各フィールドを必須またはオプションとして設定できます。 ```curl curl https://api.stripe.com/v1/checkout/sessions \ -u "<>:" \ -d mode=payment \ --data-urlencode return_url="https://example.com/return" \ -d ui_mode=embedded \ -d "line_items[0][price]"="{{PRICE_ID}}" \ -d "line_items[0][quantity]"=1 \ -d "name_collection[business][enabled]"=true \ -d "name_collection[individual][enabled]"=true \ -d "name_collection[individual][optional]"=true ``` > ビジネス名回収を必須に設定すると、Express Checkout や Apple Pay などのワンクリック ボタンが支払いフォームの下部に移動するか、無効になります。 ## Retrieve the collected names セッション後の *Customer* (Customer objects represent customers of your business. They let you reuse payment methods and give you the ability to track multiple payments) オブジェクト、または *決済セッション* (A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through Checkout. After a successful payment, the Checkout Session contains a reference to the Customer, and either the successful PaymentIntent or an active Subscription) オブジェクトから顧客のビジネス名または個人名を取得できます。 ### 顧客 決済では、収集された名前が Customer オブジェクトのそれぞれ[のビジネス名](https://docs.stripe.com/api/customers/object.md#customer_object-business_name)または[個人名](https://docs.stripe.com/api/customers/object.md#customer_object-individual_name)プロパティに保存されます。このプロパティには、[API](https://docs.stripe.com/api/customers/retrieve.md) で Customer オブジェクトを直接取得するか、*Webhook* で [customer.created](https://docs.stripe.com/api/events/types.md#event_types-customer.created) イベントをリッスンすることでプログラムでアクセスできます。 Customer オブジェクトの[名前](https://docs.stripe.com/api/customers/object.md#customer_object-name)も、その注文でビジネス名または個人名に設定されます。 ```json { "object": { "id": "cus_HQmikpKnGHkNwW", "object": "customer", ... "name": "Stripe, Inc.""business_name": "Stripe, Inc." ..."individual_name": "Jenny Rosen" ... } } ``` [ダッシュボード](https://dashboard.stripe.com/customers)で顧客名を確認することもできます。 ### 決済セッション 顧客の名前は、Checkout Sessionオブジェクトの `collected_information` ハッシュと `customer_details` ハッシュにも保存されます。 - [collected_information.business_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-collected_information-business_name) and [collected_information.individual_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-collected_information-individual_name) - [customer_details.business_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-customer_details-business_name) and [customer_details.individual_name](https://docs.stripe.com/api/checkout/sessions/object.md#checkout_session_object-customer_details-individual_name) ```json { "object": { "id": "cs_test_a1dJwt0TCJTBsDkbK7RcoyJ91vJxe2Y", "object": "checkout.session", ... "collected_information": {"business_name": "Stripe, Inc.", "individual_name": "Jenny Rosen" }, ... "customer": "cus_id_of_new_customer", "customer_details": { ..."business_name": "Stripe, Inc.", "individual_name": "Jenny Rosen", "name": "Stripe, Inc." }, ... } } ``` 決済セッションが成功すると、Stripe は [payment.session.completed](https://docs.stripe.com/api/events/types.md#event_types-checkout.session.completed) イベントを送信します。このイベントには 決済 Session オブジェクトと収集された値が含まれ、*Webhook* でリッスンできます。