# Terminal mit Connect verwenden Vernetzen Sie Stripe Terminal mit Ihrer Connect-Plattform. Stripe Terminal ist kompatibel mit *Connect* (Connect is Stripe's solution for multi-party businesses, such as marketplace or software platforms, to route payments between sellers, customers, and other recipients) und ermöglicht es Ihrer Plattform oder Ihrem Marktplatz, persönliche Zahlungen anzunehmen. integrieren Sie Terminal mit Connect, je nachdem, wie Ihre Plattform Zahlungen für Ihre verbundenen Konten verarbeitet. - Wenn Sie [Direct Charges](https://docs.stripe.com/connect/direct-charges.md) verwenden, übermitteln Sie Terminal-API-Anfragen, um Lesegeräte zu konfigurieren und Zahlungen mit dem API Schlüssel des verbundenen Kontos zu akzeptieren. Ihre Plattform kann den Header `Stripe-Account` verwenden, um das verbundene Konto zu identifizieren und seinen API-Schlüssel zu verwenden. - Wenn Sie [Destination Charges](https://docs.stripe.com/connect/destination-charges.md) verwenden, übermitteln Sie Terminal-API-Anfragen, um Lesegeräte zu konfigurieren und mit dem API-Schlüssel Ihrer Plattform Zahlungen zu akzeptieren. Außerdem identifizieren Sie das verbundene Konto anhand von Metadaten. Verwenden Sie in beiden Fällen [Standorte](https://docs.stripe.com/api/terminal/locations.md), um Lesegeräte zutreffend zu gruppieren. > Verbundene Terminal-Konten müssen die Funktion `card_payments` aufweisen, um Transaktionen durchführen zu können. ## Direct Charges ### Verbundene Konten besitzen Lesegeräte Bei Verwendung dieser Integration gehören alle API-Ressourcen zum verbundenen Konto und nicht zu Ihrer Plattform. Das verbundene Konto ist für die Kosten von Stripe-Gebühren, -Rückerstattungen und -Rückbuchungen verantwortlich. Im Dashboard können Sie Ihre Terminal-Daten anzeigen, indem Sie sich als verbundenes Konto anmelden. #### Standorte und Lesegeräte erstellen (Serverseitig) Erstellen Sie [Standorte](https://docs.stripe.com/terminal/fleet/locations-and-zones.md?dashboard-or-api=dashboard#create-locations-and-zones) und [Lesegeräte](https://docs.stripe.com/terminal/payments/connect-reader.md?reader-type=internet) für verbundene Konten, indem Sie den Header `Stripe-Account` in die API-Anfragen aufnehmen. ```curl curl https://api.stripe.com/v1/terminal/locations \ -u "<>:" \ -H "Stripe-Account: {{CONNECTEDACCOUNT_ID}}" \ -d display_name=HQ \ -d "address[line1]"="1272 Valencia Street" \ -d "address[city]"="San Francisco" \ -d "address[state]"=CA \ -d "address[country]"=US \ -d "address[postal_code]"=94110 ``` ```cli stripe terminal locations create \ --stripe-account {{CONNECTEDACCOUNT_ID}} \ --display-name=HQ \ -d "address[line1]"="1272 Valencia Street" \ -d "address[city]"="San Francisco" \ -d "address[state]"=CA \ -d "address[country]"=US \ -d "address[postal_code]"=94110 ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") location = client.v1.terminal.locations.create( { display_name: 'HQ', address: { line1: '1272 Valencia Street', city: 'San Francisco', state: 'CA', country: 'US', postal_code: '94110', }, }, {stripe_account: '{{CONNECTEDACCOUNT_ID}}'}, ) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. location = client.v1.terminal.locations.create( { "display_name": "HQ", "address": { "line1": "1272 Valencia Street", "city": "San Francisco", "state": "CA", "country": "US", "postal_code": "94110", }, }, {"stripe_account": "{{CONNECTEDACCOUNT_ID}}"}, ) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $location = $stripe->terminal->locations->create( [ 'display_name' => 'HQ', 'address' => [ 'line1' => '1272 Valencia Street', 'city' => 'San Francisco', 'state' => 'CA', 'country' => 'US', 'postal_code' => '94110', ], ], ['stripe_account' => '{{CONNECTEDACCOUNT_ID}}'] ); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); LocationCreateParams params = LocationCreateParams.builder() .setDisplayName("HQ") .setAddress( LocationCreateParams.Address.builder() .setLine1("1272 Valencia Street") .setCity("San Francisco") .setState("CA") .setCountry("US") .setPostalCode("94110") .build() ) .build(); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("{{CONNECTEDACCOUNT_ID}}").build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Location location = client.v1().terminal().locations().create(params, requestOptions); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const location = await stripe.terminal.locations.create( { display_name: 'HQ', address: { line1: '1272 Valencia Street', city: 'San Francisco', state: 'CA', country: 'US', postal_code: '94110', }, }, { stripeAccount: '{{CONNECTEDACCOUNT_ID}}', } ); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.TerminalLocationCreateParams{ DisplayName: stripe.String("HQ"), Address: &stripe.AddressParams{ Line1: stripe.String("1272 Valencia Street"), City: stripe.String("San Francisco"), State: stripe.String("CA"), Country: stripe.String("US"), PostalCode: stripe.String("94110"), }, } params.SetStripeAccount("{{CONNECTEDACCOUNT_ID}}") result, err := sc.V1TerminalLocations.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.Terminal.LocationCreateOptions { DisplayName = "HQ", Address = new AddressOptions { Line1 = "1272 Valencia Street", City = "San Francisco", State = "CA", Country = "US", PostalCode = "94110", }, }; var requestOptions = new RequestOptions { StripeAccount = "{{CONNECTEDACCOUNT_ID}}", }; var client = new StripeClient("<>"); var service = client.V1.Terminal.Locations; Stripe.Terminal.Location location = service.Create(options, requestOptions); ``` ```curl curl https://api.stripe.com/v1/terminal/readers \ -u "<>:" \ -H "Stripe-Account: {{CONNECTEDACCOUNT_ID}}" \ -d registration_code={{READER_REGISTRATION_CODE}} \ --data-urlencode label="Alice's reader" \ -d location="{{TERMINALLOCATION_ID}}" ``` ```cli stripe terminal readers create \ --stripe-account {{CONNECTEDACCOUNT_ID}} \ --registration-code={{READER_REGISTRATION_CODE}} \ --label="Alice's reader" \ --location="{{TERMINALLOCATION_ID}}" ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") reader = client.v1.terminal.readers.create( { registration_code: '{{READER_REGISTRATION_CODE}}', label: 'Alice\'s reader', location: '{{TERMINALLOCATION_ID}}', }, {stripe_account: '{{CONNECTEDACCOUNT_ID}}'}, ) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. reader = client.v1.terminal.readers.create( { "registration_code": "{{READER_REGISTRATION_CODE}}", "label": "Alice's reader", "location": "{{TERMINALLOCATION_ID}}", }, {"stripe_account": "{{CONNECTEDACCOUNT_ID}}"}, ) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $reader = $stripe->terminal->readers->create( [ 'registration_code' => '{{READER_REGISTRATION_CODE}}', 'label' => 'Alice\'s reader', 'location' => '{{TERMINALLOCATION_ID}}', ], ['stripe_account' => '{{CONNECTEDACCOUNT_ID}}'] ); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); ReaderCreateParams params = ReaderCreateParams.builder() .setRegistrationCode("{{READER_REGISTRATION_CODE}}") .setLabel("Alice's reader") .setLocation("{{TERMINALLOCATION_ID}}") .build(); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("{{CONNECTEDACCOUNT_ID}}").build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Reader reader = client.v1().terminal().readers().create(params, requestOptions); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const reader = await stripe.terminal.readers.create( { registration_code: '{{READER_REGISTRATION_CODE}}', label: 'Alice\'s reader', location: '{{TERMINALLOCATION_ID}}', }, { stripeAccount: '{{CONNECTEDACCOUNT_ID}}', } ); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.TerminalReaderCreateParams{ RegistrationCode: stripe.String("{{READER_REGISTRATION_CODE}}"), Label: stripe.String("Alice's reader"), Location: stripe.String("{{TERMINALLOCATION_ID}}"), } params.SetStripeAccount("{{CONNECTEDACCOUNT_ID}}") result, err := sc.V1TerminalReaders.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.Terminal.ReaderCreateOptions { RegistrationCode = "{{READER_REGISTRATION_CODE}}", Label = "Alice's reader", Location = "{{TERMINALLOCATION_ID}}", }; var requestOptions = new RequestOptions { StripeAccount = "{{CONNECTEDACCOUNT_ID}}", }; var client = new StripeClient("<>"); var service = client.V1.Terminal.Readers; Stripe.Terminal.Reader reader = service.Create(options, requestOptions); ``` #### Verbindungstoken erstellen (Serverseitig) > Wenn Sie die [Connect OAuth](https://docs.stripe.com/connect/oauth-reference.md)-Authentifizierung verwenden, müssen Sie das verbundene Konto separat für Live-Modus und Sandboxes mit der jeweiligen Anwendungs-Client-ID jedes Modus autorisieren. Bei der Erstellung eines [ConnectionToken](https://docs.stripe.com/api/terminal/connection_tokens.md) für das Terminal-SDK setzen Sie den `Stripe-Account`-Header auf das verbundene Konto, dass die Zahlungen akzeptiert. Sie können auch einen `location`-Parameter angeben, um den Zugriff auf Lesegeräte einzuschränken. Wenn Sie einen Standort angeben, kann das `ConnectionToken` nur mit Lesegeräten verwendet werden, die diesem Standort zugeordnet sind. Wenn Sie keinen Standort angeben, kann das `ConnectionToken` mit allen Lesegeräten verwendet werden. ```curl curl https://api.stripe.com/v1/terminal/connection_tokens \ -u "<>:" \ -H "Stripe-Account: {{CONNECTEDACCOUNT_ID}}" \ -d location="{{TERMINALLOCATION_ID}}" ``` ```cli stripe terminal connection_tokens create \ --stripe-account {{CONNECTEDACCOUNT_ID}} \ --location="{{TERMINALLOCATION_ID}}" ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") connection_token = client.v1.terminal.connection_tokens.create( {location: '{{TERMINALLOCATION_ID}}'}, {stripe_account: '{{CONNECTEDACCOUNT_ID}}'}, ) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. connection_token = client.v1.terminal.connection_tokens.create( {"location": "{{TERMINALLOCATION_ID}}"}, {"stripe_account": "{{CONNECTEDACCOUNT_ID}}"}, ) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $connectionToken = $stripe->terminal->connectionTokens->create( ['location' => '{{TERMINALLOCATION_ID}}'], ['stripe_account' => '{{CONNECTEDACCOUNT_ID}}'] ); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); ConnectionTokenCreateParams params = ConnectionTokenCreateParams.builder() .setLocation("{{TERMINALLOCATION_ID}}") .build(); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("{{CONNECTEDACCOUNT_ID}}").build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. ConnectionToken connectionToken = client.v1().terminal().connectionTokens().create(params, requestOptions); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const connectionToken = await stripe.terminal.connectionTokens.create( { location: '{{TERMINALLOCATION_ID}}', }, { stripeAccount: '{{CONNECTEDACCOUNT_ID}}', } ); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.TerminalConnectionTokenCreateParams{ Location: stripe.String("{{TERMINALLOCATION_ID}}"), } params.SetStripeAccount("{{CONNECTEDACCOUNT_ID}}") result, err := sc.V1TerminalConnectionTokens.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.Terminal.ConnectionTokenCreateOptions { Location = "{{TERMINALLOCATION_ID}}", }; var requestOptions = new RequestOptions { StripeAccount = "{{CONNECTEDACCOUNT_ID}}", }; var client = new StripeClient("<>"); var service = client.V1.Terminal.ConnectionTokens; Stripe.Terminal.ConnectionToken connectionToken = service.Create(options, requestOptions); ``` #### PaymentIntents erstellen (Client-side) (Server-side) Mit dem iOS, Android und React Native SDK können Sie einen `PaymentIntent` auf dem Client oder auf dem Server erstellen. Das JavaScript SDK unterstützt nur die Erstellung auf dem Server. ##### Clientseitig Wenn Sie auf der Client-Seite einen `PaymentIntent` für Direct Charges erstellen, geben Sie keine zusätzlichen Parameter für den `PaymentIntent` an. Erstellen Sie stattdessen ein `ConnectionToken` mit dem `Stripe-Account`-Header für das verbundene Konto, das Zahlungen akzeptiert. Die Client-SDKs erstellen den `PaymentIntent` auf demselben verbundenen Konto, zu dem das `ConnectionToken` gehört. Weitere Informationen finden Sie unter [PaymentIntents clientseitig erstellen](https://docs.stripe.com/terminal/payments/collect-card-payment.md#create-client-side). ##### Serverseitig Für das JavaScript SDK müssen Sie den `PaymentIntent` auf Ihrem Server erstellen. Für die anderen Client-SDKs können Sie den `PaymentIntent` auf Ihrem Server erstellen, wenn die zum Starten einer Zahlung erforderlichen Informationen in Ihrer App nicht ohne weiteres verfügbar sind. Weitere Informationen finden Sie unter [Payment Intents serverseitig erstellen](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=js#create-payment). Wenn Sie einen `PaymentIntent` auf der Server-Seite für Direct Charges erstellen, setzen Sie den `Stripe-Account`-Header auf das verbundene Konto. ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -H "Stripe-Account: {{CONNECTEDACCOUNT_ID}}" \ -d amount=1000 \ -d currency=usd \ -d "payment_method_types[]"=card_present \ -d capture_method=manual ``` ```cli stripe payment_intents create \ --stripe-account {{CONNECTEDACCOUNT_ID}} \ --amount=1000 \ --currency=usd \ -d "payment_method_types[0]"=card_present \ --capture-method=manual ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") payment_intent = client.v1.payment_intents.create( { amount: 1000, currency: 'usd', payment_method_types: ['card_present'], capture_method: 'manual', }, {stripe_account: '{{CONNECTEDACCOUNT_ID}}'}, ) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. payment_intent = client.v1.payment_intents.create( { "amount": 1000, "currency": "usd", "payment_method_types": ["card_present"], "capture_method": "manual", }, {"stripe_account": "{{CONNECTEDACCOUNT_ID}}"}, ) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $paymentIntent = $stripe->paymentIntents->create( [ 'amount' => 1000, 'currency' => 'usd', 'payment_method_types' => ['card_present'], 'capture_method' => 'manual', ], ['stripe_account' => '{{CONNECTEDACCOUNT_ID}}'] ); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .addPaymentMethodType("card_present") .setCaptureMethod(PaymentIntentCreateParams.CaptureMethod.MANUAL) .build(); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("{{CONNECTEDACCOUNT_ID}}").build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. PaymentIntent paymentIntent = client.v1().paymentIntents().create(params, requestOptions); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const paymentIntent = await stripe.paymentIntents.create( { amount: 1000, currency: 'usd', payment_method_types: ['card_present'], capture_method: 'manual', }, { stripeAccount: '{{CONNECTEDACCOUNT_ID}}', } ); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.PaymentIntentCreateParams{ Amount: stripe.Int64(1000), Currency: stripe.String(stripe.CurrencyUSD), PaymentMethodTypes: []*string{stripe.String("card_present")}, CaptureMethod: stripe.String(stripe.PaymentIntentCaptureMethodManual), } params.SetStripeAccount("{{CONNECTEDACCOUNT_ID}}") result, err := sc.V1PaymentIntents.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new PaymentIntentCreateOptions { Amount = 1000, Currency = "usd", PaymentMethodTypes = new List { "card_present" }, CaptureMethod = "manual", }; var requestOptions = new RequestOptions { StripeAccount = "{{CONNECTEDACCOUNT_ID}}", }; var client = new StripeClient("<>"); var service = client.V1.PaymentIntents; PaymentIntent paymentIntent = service.Create(options, requestOptions); ``` Befolgen Sie dann die Schritte, um [eine Zahlung einzuziehen](https://docs.stripe.com/terminal/payments/collect-card-payment.md), um den PaymentIntent abzuwickeln. ### Plattformeigene Lesegeräte (Private Vorschau) > [Kontaktieren Sie uns](mailto:stripe-terminal-betas@stripe.com), wenn Sie daran interessiert sind, dass die Plattform Lesegeräte mit Direct Charges besitzt und verwaltet. Diese private Vorschaufunktion ist derzeit für [intelligente Lesegeräte](https://docs.stripe.com/terminal/smart-readers.md) verfügbar, die eine [servergestützte Integration](https://docs.stripe.com/terminal/payments/setup-integration.md?terminal-sdk-platform=server-driven) nutzen. Diese Integration funktioniert nur mit verbundenen Konten, die Sie über eine einzelne Plattform steuern. Bei dieser Integration besitzt Ihre Plattform Geräteressourcen wie [Standorte](https://docs.stripe.com/api/terminal/locations.md) und [Lesegeräte](https://docs.stripe.com/api/terminal/readers.md) und Ihre verbundenen Konten besitzen Zahlungsressourcen wie [PaymentIntents](https://docs.stripe.com/api/payment_intents.md). Auf diese Weise kann Ihre Plattform ein einziges Lesegerät verwalten, das Zahlungen für mehrere verbundene Konten verarbeitet. Die verbundenen Konten sind für die Zahlungsbeträge der Stripe-Gebühren, -Rückerstattungen und -Rückbuchungen verantwortlich. Im Dashboard können Sie Ihre Terminal-Geräteverwaltungsdaten direkt anzeigen, wenn Sie bei Ihrem Plattformkonto angemeldet sind. Sie können Zahlungsdaten anzeigen, indem Sie sich als verbundenes Konto anmelden. #### Standorte und Lesegeräte erstellen Reader-Objekte lassen sich am besten nach verbundenem Konto gruppieren, indem sie `Locations` zugewiesen werden. Erstellen Sie in Ihrem Plattformkonto [einen Ort](https://docs.stripe.com/terminal/fleet/locations-and-zones.md?dashboard-or-api=dashboard#create-locations-and-zones) für ein verbundenes Konto mit einem Anzeigenamen, der das Konto kennzeichnet. ```curl curl https://api.stripe.com/v1/terminal/locations \ -u "<>:" \ -d display_name=HQ \ -d "address[line1]"="1272 Valencia Street" \ -d "address[city]"="San Francisco" \ -d "address[state]"=CA \ -d "address[country]"=US \ -d "address[postal_code]"=94110 ``` ```cli stripe terminal locations create \ --display-name=HQ \ -d "address[line1]"="1272 Valencia Street" \ -d "address[city]"="San Francisco" \ -d "address[state]"=CA \ -d "address[country]"=US \ -d "address[postal_code]"=94110 ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") location = client.v1.terminal.locations.create({ display_name: 'HQ', address: { line1: '1272 Valencia Street', city: 'San Francisco', state: 'CA', country: 'US', postal_code: '94110', }, }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. location = client.v1.terminal.locations.create({ "display_name": "HQ", "address": { "line1": "1272 Valencia Street", "city": "San Francisco", "state": "CA", "country": "US", "postal_code": "94110", }, }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $location = $stripe->terminal->locations->create([ 'display_name' => 'HQ', 'address' => [ 'line1' => '1272 Valencia Street', 'city' => 'San Francisco', 'state' => 'CA', 'country' => 'US', 'postal_code' => '94110', ], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); LocationCreateParams params = LocationCreateParams.builder() .setDisplayName("HQ") .setAddress( LocationCreateParams.Address.builder() .setLine1("1272 Valencia Street") .setCity("San Francisco") .setState("CA") .setCountry("US") .setPostalCode("94110") .build() ) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Location location = client.v1().terminal().locations().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const location = await stripe.terminal.locations.create({ display_name: 'HQ', address: { line1: '1272 Valencia Street', city: 'San Francisco', state: 'CA', country: 'US', postal_code: '94110', }, }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.TerminalLocationCreateParams{ DisplayName: stripe.String("HQ"), Address: &stripe.AddressParams{ Line1: stripe.String("1272 Valencia Street"), City: stripe.String("San Francisco"), State: stripe.String("CA"), Country: stripe.String("US"), PostalCode: stripe.String("94110"), }, } result, err := sc.V1TerminalLocations.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.Terminal.LocationCreateOptions { DisplayName = "HQ", Address = new AddressOptions { Line1 = "1272 Valencia Street", City = "San Francisco", State = "CA", Country = "US", PostalCode = "94110", }, }; var client = new StripeClient("<>"); var service = client.V1.Terminal.Locations; Stripe.Terminal.Location location = service.Create(options); ``` Bevor Sie Ihre Anwendung mit einem [intelligenten Lesegerät](https://docs.stripe.com/terminal/payments/connect-reader.md?reader-type=internet) verbinden können, müssen Sie das Lesegerät bei Ihrem Plattformkonto registrieren. ```curl curl https://api.stripe.com/v1/terminal/readers \ -u "<>:" \ -d registration_code={{READER_REGISTRATION_CODE}} \ --data-urlencode label="Alice's reader" \ -d location="{{TERMINALLOCATION_ID}}" ``` ```cli stripe terminal readers create \ --registration-code={{READER_REGISTRATION_CODE}} \ --label="Alice's reader" \ --location="{{TERMINALLOCATION_ID}}" ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") reader = client.v1.terminal.readers.create({ registration_code: '{{READER_REGISTRATION_CODE}}', label: 'Alice\'s reader', location: '{{TERMINALLOCATION_ID}}', }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. reader = client.v1.terminal.readers.create({ "registration_code": "{{READER_REGISTRATION_CODE}}", "label": "Alice's reader", "location": "{{TERMINALLOCATION_ID}}", }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $reader = $stripe->terminal->readers->create([ 'registration_code' => '{{READER_REGISTRATION_CODE}}', 'label' => 'Alice\'s reader', 'location' => '{{TERMINALLOCATION_ID}}', ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); ReaderCreateParams params = ReaderCreateParams.builder() .setRegistrationCode("{{READER_REGISTRATION_CODE}}") .setLabel("Alice's reader") .setLocation("{{TERMINALLOCATION_ID}}") .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Reader reader = client.v1().terminal().readers().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const reader = await stripe.terminal.readers.create({ registration_code: '{{READER_REGISTRATION_CODE}}', label: 'Alice\'s reader', location: '{{TERMINALLOCATION_ID}}', }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.TerminalReaderCreateParams{ RegistrationCode: stripe.String("{{READER_REGISTRATION_CODE}}"), Label: stripe.String("Alice's reader"), Location: stripe.String("{{TERMINALLOCATION_ID}}"), } result, err := sc.V1TerminalReaders.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.Terminal.ReaderCreateOptions { RegistrationCode = "{{READER_REGISTRATION_CODE}}", Label = "Alice's reader", Location = "{{TERMINALLOCATION_ID}}", }; var client = new StripeClient("<>"); var service = client.V1.Terminal.Readers; Stripe.Terminal.Reader reader = service.Create(options); ``` #### PaymentIntents erstellen Wenn Sie einen `PaymentIntent` für Direct Charges erstellen, setzen Sie den `Stripe-Account`-Header auf das verbundene Konto. > Die Plattform kann PaymentIntents später nur verarbeiten, wenn Sie diese für verbundene Konten erstellen, die Sie über eine einzelne Plattform steuern. ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -H "Stripe-Account: {{CONNECTEDACCOUNT_ID}}" \ -d amount=1000 \ -d currency=usd \ -d "payment_method_types[]"=card_present \ -d capture_method=manual ``` ```cli stripe payment_intents create \ --stripe-account {{CONNECTEDACCOUNT_ID}} \ --amount=1000 \ --currency=usd \ -d "payment_method_types[0]"=card_present \ --capture-method=manual ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") payment_intent = client.v1.payment_intents.create( { amount: 1000, currency: 'usd', payment_method_types: ['card_present'], capture_method: 'manual', }, {stripe_account: '{{CONNECTEDACCOUNT_ID}}'}, ) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. payment_intent = client.v1.payment_intents.create( { "amount": 1000, "currency": "usd", "payment_method_types": ["card_present"], "capture_method": "manual", }, {"stripe_account": "{{CONNECTEDACCOUNT_ID}}"}, ) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $paymentIntent = $stripe->paymentIntents->create( [ 'amount' => 1000, 'currency' => 'usd', 'payment_method_types' => ['card_present'], 'capture_method' => 'manual', ], ['stripe_account' => '{{CONNECTEDACCOUNT_ID}}'] ); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .addPaymentMethodType("card_present") .setCaptureMethod(PaymentIntentCreateParams.CaptureMethod.MANUAL) .build(); RequestOptions requestOptions = RequestOptions.builder().setStripeAccount("{{CONNECTEDACCOUNT_ID}}").build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. PaymentIntent paymentIntent = client.v1().paymentIntents().create(params, requestOptions); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const paymentIntent = await stripe.paymentIntents.create( { amount: 1000, currency: 'usd', payment_method_types: ['card_present'], capture_method: 'manual', }, { stripeAccount: '{{CONNECTEDACCOUNT_ID}}', } ); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.PaymentIntentCreateParams{ Amount: stripe.Int64(1000), Currency: stripe.String(stripe.CurrencyUSD), PaymentMethodTypes: []*string{stripe.String("card_present")}, CaptureMethod: stripe.String(stripe.PaymentIntentCaptureMethodManual), } params.SetStripeAccount("{{CONNECTEDACCOUNT_ID}}") result, err := sc.V1PaymentIntents.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new PaymentIntentCreateOptions { Amount = 1000, Currency = "usd", PaymentMethodTypes = new List { "card_present" }, CaptureMethod = "manual", }; var requestOptions = new RequestOptions { StripeAccount = "{{CONNECTEDACCOUNT_ID}}", }; var client = new StripeClient("<>"); var service = client.V1.PaymentIntents; PaymentIntent paymentIntent = service.Create(options, requestOptions); ``` #### PaymentIntents verarbeiten Die Plattform kann den `PaymentIntent` des verbundenen Kontos mit einem Lesegerät verarbeiten, das der Plattform gehört. > Der PaymentIntent kann nur verarbeitet werden, wenn Sie ihn mit dem `Stripe-Account`-Header erstellen. ```curl curl https://api.stripe.com/v1/terminal/readers/{{TERMINALREADER_ID}}/process_payment_intent \ -u "<>:" \ -d payment_intent="{{PAYMENTINTENT_ID}}" ``` ```cli stripe terminal readers process_payment_intent {{TERMINALREADER_ID}} \ --payment-intent="{{PAYMENTINTENT_ID}}" ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") reader = client.v1.terminal.readers.process_payment_intent( '{{TERMINALREADER_ID}}', {payment_intent: '{{PAYMENTINTENT_ID}}'}, ) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. reader = client.v1.terminal.readers.process_payment_intent( "{{TERMINALREADER_ID}}", {"payment_intent": "{{PAYMENTINTENT_ID}}"}, ) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $reader = $stripe->terminal->readers->processPaymentIntent( '{{TERMINALREADER_ID}}', ['payment_intent' => '{{PAYMENTINTENT_ID}}'] ); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); ReaderProcessPaymentIntentParams params = ReaderProcessPaymentIntentParams.builder() .setPaymentIntent("{{PAYMENTINTENT_ID}}") .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Reader reader = client.v1().terminal().readers().processPaymentIntent( "{{TERMINALREADER_ID}}", params ); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const reader = await stripe.terminal.readers.processPaymentIntent( '{{TERMINALREADER_ID}}', { payment_intent: '{{PAYMENTINTENT_ID}}', } ); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.TerminalReaderProcessPaymentIntentParams{ PaymentIntent: stripe.String("{{PAYMENTINTENT_ID}}"), } result, err := sc.V1TerminalReaders.ProcessPaymentIntent( context.TODO(), "{{TERMINALREADER_ID}}", params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.Terminal.ReaderProcessPaymentIntentOptions { PaymentIntent = "{{PAYMENTINTENT_ID}}", }; var client = new StripeClient("<>"); var service = client.V1.Terminal.Readers; Stripe.Terminal.Reader reader = service.ProcessPaymentIntent( "{{TERMINALREADER_ID}}", options); ``` ## Destination Charges Wenn Sie [Destination Charges](https://docs.stripe.com/connect/destination-charges.md) verwenden, besitzt Ihre Plattform API-Ressourcen wie [PaymentIntents](https://docs.stripe.com/api/payment_intents.md) und [Standorte](https://docs.stripe.com/api/terminal/locations.md). Bei jeder Zahlung wird automatisch eine Übertragung auf ein verbundenes Konto erstellt. Im Dashboard können Sie Ihre Terminal-Daten direkt anzeigen, wenn Sie bei Ihrem Plattformkonto angemeldet sind. ### Standorte und Lesegeräte erstellen (Serverseitig) Lesegeräte-Objekte lassen sich nach verbundenem Konto gruppieren, indem sie `Locations` zugewiesen werden. [Erstellen Sie einen Standort](https://docs.stripe.com/terminal/fleet/locations-and-zones.md?dashboard-or-api=dashboard#create-locations-and-zones) für ein verbundenes Konto in Ihrem Plattformkonto mit einem Anzeigenamen, der das Konto kennzeichnet. ```curl curl https://api.stripe.com/v1/terminal/locations \ -u "<>:" \ -d display_name=HQ \ -d "address[line1]"="1272 Valencia Street" \ -d "address[city]"="San Francisco" \ -d "address[state]"=CA \ -d "address[country]"=US \ -d "address[postal_code]"=94110 ``` ```cli stripe terminal locations create \ --display-name=HQ \ -d "address[line1]"="1272 Valencia Street" \ -d "address[city]"="San Francisco" \ -d "address[state]"=CA \ -d "address[country]"=US \ -d "address[postal_code]"=94110 ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") location = client.v1.terminal.locations.create({ display_name: 'HQ', address: { line1: '1272 Valencia Street', city: 'San Francisco', state: 'CA', country: 'US', postal_code: '94110', }, }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. location = client.v1.terminal.locations.create({ "display_name": "HQ", "address": { "line1": "1272 Valencia Street", "city": "San Francisco", "state": "CA", "country": "US", "postal_code": "94110", }, }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $location = $stripe->terminal->locations->create([ 'display_name' => 'HQ', 'address' => [ 'line1' => '1272 Valencia Street', 'city' => 'San Francisco', 'state' => 'CA', 'country' => 'US', 'postal_code' => '94110', ], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); LocationCreateParams params = LocationCreateParams.builder() .setDisplayName("HQ") .setAddress( LocationCreateParams.Address.builder() .setLine1("1272 Valencia Street") .setCity("San Francisco") .setState("CA") .setCountry("US") .setPostalCode("94110") .build() ) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Location location = client.v1().terminal().locations().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const location = await stripe.terminal.locations.create({ display_name: 'HQ', address: { line1: '1272 Valencia Street', city: 'San Francisco', state: 'CA', country: 'US', postal_code: '94110', }, }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.TerminalLocationCreateParams{ DisplayName: stripe.String("HQ"), Address: &stripe.AddressParams{ Line1: stripe.String("1272 Valencia Street"), City: stripe.String("San Francisco"), State: stripe.String("CA"), Country: stripe.String("US"), PostalCode: stripe.String("94110"), }, } result, err := sc.V1TerminalLocations.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.Terminal.LocationCreateOptions { DisplayName = "HQ", Address = new AddressOptions { Line1 = "1272 Valencia Street", City = "San Francisco", State = "CA", Country = "US", PostalCode = "94110", }, }; var client = new StripeClient("<>"); var service = client.V1.Terminal.Locations; Stripe.Terminal.Location location = service.Create(options); ``` Bevor Sie Ihre Anwendung mit einem [intelligenten Lesegerät](https://docs.stripe.com/terminal/payments/connect-reader.md?reader-type=internet) verbinden können, müssen Sie das Lesegerät bei Ihrem Plattformkonto registrieren. ```curl curl https://api.stripe.com/v1/terminal/readers \ -u "<>:" \ -d registration_code={{READER_REGISTRATION_CODE}} \ --data-urlencode label="Alice's reader" \ -d location="{{TERMINALLOCATION_ID}}" ``` ```cli stripe terminal readers create \ --registration-code={{READER_REGISTRATION_CODE}} \ --label="Alice's reader" \ --location="{{TERMINALLOCATION_ID}}" ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") reader = client.v1.terminal.readers.create({ registration_code: '{{READER_REGISTRATION_CODE}}', label: 'Alice\'s reader', location: '{{TERMINALLOCATION_ID}}', }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. reader = client.v1.terminal.readers.create({ "registration_code": "{{READER_REGISTRATION_CODE}}", "label": "Alice's reader", "location": "{{TERMINALLOCATION_ID}}", }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $reader = $stripe->terminal->readers->create([ 'registration_code' => '{{READER_REGISTRATION_CODE}}', 'label' => 'Alice\'s reader', 'location' => '{{TERMINALLOCATION_ID}}', ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); ReaderCreateParams params = ReaderCreateParams.builder() .setRegistrationCode("{{READER_REGISTRATION_CODE}}") .setLabel("Alice's reader") .setLocation("{{TERMINALLOCATION_ID}}") .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Reader reader = client.v1().terminal().readers().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const reader = await stripe.terminal.readers.create({ registration_code: '{{READER_REGISTRATION_CODE}}', label: 'Alice\'s reader', location: '{{TERMINALLOCATION_ID}}', }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.TerminalReaderCreateParams{ RegistrationCode: stripe.String("{{READER_REGISTRATION_CODE}}"), Label: stripe.String("Alice's reader"), Location: stripe.String("{{TERMINALLOCATION_ID}}"), } result, err := sc.V1TerminalReaders.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.Terminal.ReaderCreateOptions { RegistrationCode = "{{READER_REGISTRATION_CODE}}", Label = "Alice's reader", Location = "{{TERMINALLOCATION_ID}}", }; var client = new StripeClient("<>"); var service = client.V1.Terminal.Readers; Stripe.Terminal.Reader reader = service.Create(options); ``` ### Verbindungstoken erstellen (Serverseitig) Verwenden Sie den geheimen Schlüssel Ihres Plattformkontos, wenn Sie einen `ConnectionToken` für das Terminal SDK erstellen. Legen Sie den `Stripe-Account`-Header nicht fest. Geben Sie einen `location`-Parameter an, um den Zugriff auf Lesegeräte zu steuern. Wenn Sie einen Ort angeben, kann der `ConnectionToken` nur mit Lesegeräten verwendet werden, die diesem Ort zugewiesen sind. Wenn Sie keinen Ort angeben, kann der `ConnectionToken` mit allen Lesegeräten verwendet werden. ```curl curl https://api.stripe.com/v1/terminal/connection_tokens \ -u "<>:" \ -d location="{{TERMINALLOCATION_ID}}" ``` ```cli stripe terminal connection_tokens create \ --location="{{TERMINALLOCATION_ID}}" ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") connection_token = client.v1.terminal.connection_tokens.create({ location: '{{TERMINALLOCATION_ID}}', }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. connection_token = client.v1.terminal.connection_tokens.create({ "location": "{{TERMINALLOCATION_ID}}", }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $connectionToken = $stripe->terminal->connectionTokens->create([ 'location' => '{{TERMINALLOCATION_ID}}', ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); ConnectionTokenCreateParams params = ConnectionTokenCreateParams.builder() .setLocation("{{TERMINALLOCATION_ID}}") .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. ConnectionToken connectionToken = client.v1().terminal().connectionTokens().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const connectionToken = await stripe.terminal.connectionTokens.create({ location: '{{TERMINALLOCATION_ID}}', }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.TerminalConnectionTokenCreateParams{ Location: stripe.String("{{TERMINALLOCATION_ID}}"), } result, err := sc.V1TerminalConnectionTokens.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.Terminal.ConnectionTokenCreateOptions { Location = "{{TERMINALLOCATION_ID}}", }; var client = new StripeClient("<>"); var service = client.V1.Terminal.ConnectionTokens; Stripe.Terminal.ConnectionToken connectionToken = service.Create(options); ``` ### PaymentIntents erstellen (Client-side) (Server-side) Wenn Sie einen `PaymentIntent` mit Destination Charges erstellen, geben Sie die Parameter [on_behalf_of](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-on_behalf_of) und [transfer_data[destination]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-transfer_data-destination) und [application_fee_amount](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-application_fee_amount) an. Der Parameter `on_behalf_of` ist die ID des verbundenen Kontos, das zum Abwicklungshändler für die Zahlung wird. Bei Terminal-Transaktionen müssen Sie diesen Parameter in Fällen festlegen, bei denen das Land der Plattform nicht mit dem Land des verbundenen Kontos übereinstimmt. Wenn `on_behalf_of` festgelegt ist, führt Stripe automatisch Folgendes durch: - Stripe wickelt die Zahlungen im Land des angegebenen Kontos ab. Dadurch werden Ablehnungen minimiert und Währungsumrechnungen vermieden. - Verwendet die Gebührenstruktur für das Land des verbundenen Kontos. - Listet die Adresse und die Telefonnummer des verbundenen Kontos auf der Kreditkartenabrechnung des Kunden/der Kundin auf, und nicht die Adresse und die Telefonnummer Ihrer Plattform (nur, wenn sich das Konto und die Plattform in verschiedenen Ländern befinden). Legen Sie für `transfer_data[destination]` die ID des verbundenen Kontos fest, an das der Betrag gesendet wird. Abschließend können Sie eine Plattformgebühr für Ihre Plattform einbehalten, indem Sie den Parameter [application_fee_amount](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-application_fee_amount) angeben. #### Clientseitig Mit den SDKs für iOS, Android und React Native können Sie einen `PaymentIntent` auf dem Client erstellen und die Parameter `onBehalfOf`, `transferDataDestination` und `applicationFeeAmount` angeben. #### JavaScript > Die clientseitige Erstellung des `PaymentIntent` ist mit den anderen SDKs möglich. Wenn Sie das JavaScript SDK für Stripe Terminal verwenden, erstellen Sie einen `PaymentIntent` auf dem Server. #### iOS - [PaymentIntentParameters (iOS)](https://stripe.dev/stripe-terminal-ios/docs/Classes/SCPPaymentIntentParameters.html) > Wenn Ihre App mit dem Verifone P400 verbunden ist, können Sie keinen `PaymentIntent` über das iOS SDK erstellen. > > Stattdessen müssen Sie den [PaymentIntent auf dem Server erstellen](https://docs.stripe.com/terminal/payments/collect-card-payment.md#create-server-side) und den `PaymentIntent` in Ihrer App mithilfe der Methode `Terminal.retrievePaymentIntent` im SDK abrufen. #### Swift ```swift import UIKit import StripeTerminal class PaymentViewController: UIViewController { // ... // Action for a "Checkout" button func checkoutAction() throws { let params = try PaymentIntentParametersBuilder(amount: 1000, currency: "eur") .setOnBehalfOf(""{{CONNECTED_ACCOUNT_ID}}"") .setTransferDataDestination(""{{CONNECTED_ACCOUNT_ID}}"") .setApplicationFeeAmount(200) .build() Terminal.shared.createPaymentIntent(params) { createResult, createError in if let error = createError { print("createPaymentIntent failed: \(error)") } else if let paymentIntent = createResult { print("createPaymentIntent succeeded") // ... } } } // ... } ``` #### Objective-C ```objc #import "APPPaymentViewController.h" #import // ... @implementation APPPaymentViewController // Action for a "Checkout" button - (void)checkoutAction { NSError *paramError = nil; SCPPaymentIntentParameters *params = [[[[[[SCPPaymentIntentParametersBuilder alloc] initWithAmount:1000 currency:@"eur"] setOnBehalfOf:@"{CONNECTED_ACCONT_ID}"] setTransferDataDestination:@"{CONNECTED_ACCONT_ID}"] setApplicationFeeAmount:@(200)] build:¶mError]; if (paramError) { NSLog(@"Error building PaymentIntent parameters"); return; } [[SCPTerminal shared] createPaymentIntent:params completion:^(SCPPaymentIntent *createResult, NSError *createError) { if (createError) { NSLog(@"createPaymentIntent failed: %@", createError); } else { NSLog(@"createPaymentIntent succeeded"); // ... } }]; } // ... @end ``` #### Android - [PaymentIntentParameters (Android)](https://stripe.dev/stripe-terminal-android/external/com.stripe.stripeterminal.external.models/-payment-intent-parameters/index.html) > Wenn Ihre App mit dem Verifone P400 verbunden ist, können Sie keinen `PaymentIntent` über das Android SDK erstellen. > > Stattdessen müssen Sie den [PaymentIntent auf dem Server erstellen](https://docs.stripe.com/terminal/payments/collect-card-payment.md#create-server-side) und den `PaymentIntent` in Ihrer App mithilfe der Methode `Terminal.retrievePaymentIntent` im SDK abrufen. #### Kotlin ```kotlin val params = PaymentIntentParameters.Builder() .setAmount(1000) .setCurrency("eur") .setOnBehalfOf(""{{CONNECTED_ACCOUNT_ID}}"") .setTransferDataDestination(""{{CONNECTED_ACCOUNT_ID}}"") .setApplicationFeeAmount(200) .build() Terminal.getInstance().createPaymentIntent( params, object : PaymentIntentCallback { override fun onSuccess(paymentIntent: PaymentIntent) { // Placeholder for handling successful operation } override fun onFailure(e: TerminalException) { // Placeholder for handling exception } } ) ``` #### Java ```java PaymentIntentParameters params = new PaymentIntentParameters.Builder() .setAmount(1000L) .setCurrency("eur") .setOnBehalfOf(""{{CONNECTED_ACCOUNT_ID}}"") .setTransferDataDestination(""{{CONNECTED_ACCOUNT_ID}}"") .setApplicationFeeAmount(200L) .build(); Terminal.getInstance().createPaymentIntent( params, new PaymentIntentCallback() { @Override public void onSuccess(@NotNull PaymentIntent paymentIntent) { // Placeholder for handling successful operation } @Override public void onFailure(@NotNull TerminalException exception) { // Placeholder for handling exception } } ); ``` #### React Native - [CreatePaymentIntentParams (React Native)](https://stripe.dev/stripe-terminal-react-native/api-reference/index.html#CreatePaymentIntentParams) > Wenn Ihre App mit dem Verifone P400 verbunden ist, können Sie keinen `PaymentIntent` über das React Native SDK erstellen. > > Stattdessen müssen Sie den [PaymentIntent auf dem Server erstellen](https://docs.stripe.com/terminal/payments/collect-card-payment.md#create-server-side) und den `PaymentIntent` in Ihrer App mithilfe der Methode `retrievePaymentIntent` im SDK abrufen. ```js const {paymentIntent, error} = await createPaymentIntent({ amount: 1000, currency: "eur", onBehalfOf: "{{CONNECTED_ACCOUNT_ID}}" , transferDataDestination: "{{CONNECTED_ACCOUNT_ID}}", applicationFeeAmount: 200, }); if (error) { // Placeholder for handling exception return; } // Placeholder for collecting a payment method with PaymentIntent ``` #### Serverseitig Für das JavaScript SDK müssen Sie den `PaymentIntent` auf Ihrem Server erstellen. Für die anderen Client-SDKs können Sie den `PaymentIntent` auf Ihrem Server erstellen, wenn die zum Starten einer Zahlung erforderlichen Informationen in Ihrer App nicht ohne weiteres verfügbar sind. Weitere Informationen finden Sie unter [Payment Intents serverseitig erstellen](https://docs.stripe.com/terminal/payments/collect-card-payment.md?terminal-sdk-platform=js#create-payment). ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1000 \ -d currency=usd \ -d "payment_method_types[]"=card_present \ -d capture_method=manual \ -d application_fee_amount=200 \ -d on_behalf_of="{{CONNECTEDACCOUNT_ID}}" \ -d "transfer_data[destination]"="{{CONNECTEDACCOUNT_ID}}" ``` ```cli stripe payment_intents create \ --amount=1000 \ --currency=usd \ -d "payment_method_types[0]"=card_present \ --capture-method=manual \ --application-fee-amount=200 \ --on-behalf-of="{{CONNECTEDACCOUNT_ID}}" \ -d "transfer_data[destination]"="{{CONNECTEDACCOUNT_ID}}" ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") payment_intent = client.v1.payment_intents.create({ amount: 1000, currency: 'usd', payment_method_types: ['card_present'], capture_method: 'manual', application_fee_amount: 200, on_behalf_of: '{{CONNECTEDACCOUNT_ID}}', transfer_data: {destination: '{{CONNECTEDACCOUNT_ID}}'}, }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. payment_intent = client.v1.payment_intents.create({ "amount": 1000, "currency": "usd", "payment_method_types": ["card_present"], "capture_method": "manual", "application_fee_amount": 200, "on_behalf_of": "{{CONNECTEDACCOUNT_ID}}", "transfer_data": {"destination": "{{CONNECTEDACCOUNT_ID}}"}, }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $paymentIntent = $stripe->paymentIntents->create([ 'amount' => 1000, 'currency' => 'usd', 'payment_method_types' => ['card_present'], 'capture_method' => 'manual', 'application_fee_amount' => 200, 'on_behalf_of' => '{{CONNECTEDACCOUNT_ID}}', 'transfer_data' => ['destination' => '{{CONNECTEDACCOUNT_ID}}'], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); PaymentIntentCreateParams params = PaymentIntentCreateParams.builder() .setAmount(1000L) .setCurrency("usd") .addPaymentMethodType("card_present") .setCaptureMethod(PaymentIntentCreateParams.CaptureMethod.MANUAL) .setApplicationFeeAmount(200L) .setOnBehalfOf("{{CONNECTEDACCOUNT_ID}}") .setTransferData( PaymentIntentCreateParams.TransferData.builder() .setDestination("{{CONNECTEDACCOUNT_ID}}") .build() ) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. PaymentIntent paymentIntent = client.v1().paymentIntents().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const paymentIntent = await stripe.paymentIntents.create({ amount: 1000, currency: 'usd', payment_method_types: ['card_present'], capture_method: 'manual', application_fee_amount: 200, on_behalf_of: '{{CONNECTEDACCOUNT_ID}}', transfer_data: { destination: '{{CONNECTEDACCOUNT_ID}}', }, }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.PaymentIntentCreateParams{ Amount: stripe.Int64(1000), Currency: stripe.String(stripe.CurrencyUSD), PaymentMethodTypes: []*string{stripe.String("card_present")}, CaptureMethod: stripe.String(stripe.PaymentIntentCaptureMethodManual), ApplicationFeeAmount: stripe.Int64(200), OnBehalfOf: stripe.String("{{CONNECTEDACCOUNT_ID}}"), TransferData: &stripe.PaymentIntentCreateTransferDataParams{ Destination: stripe.String("{{CONNECTEDACCOUNT_ID}}"), }, } result, err := sc.V1PaymentIntents.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new PaymentIntentCreateOptions { Amount = 1000, Currency = "usd", PaymentMethodTypes = new List { "card_present" }, CaptureMethod = "manual", ApplicationFeeAmount = 200, OnBehalfOf = "{{CONNECTEDACCOUNT_ID}}", TransferData = new PaymentIntentTransferDataOptions { Destination = "{{CONNECTEDACCOUNT_ID}}", }, }; var client = new StripeClient("<>"); var service = client.V1.PaymentIntents; PaymentIntent paymentIntent = service.Create(options); ``` Befolgen Sie dann die Schritte, um [eine Zahlung einzuziehen](https://docs.stripe.com/terminal/payments/collect-card-payment.md), um den PaymentIntent abzuwickeln. ## See also - [Anzeige des Warenkorbs](https://docs.stripe.com/terminal/features/display.md) - [Belege](https://docs.stripe.com/terminal/features/receipts.md)