stripe / stripe-php

PHP library for the Stripe API.
https://stripe.com
MIT License
3.74k stars 849 forks source link

Received unknown parameter: client_id when creating account link #1641

Closed DevShaded closed 8 months ago

DevShaded commented 8 months ago

Describe the bug

I was testing Stripe connect OAuth flow. In the documentation on Test the OAuth flow When I try to create the accountLink with this library I get this error back Received unknown parameter: client_id

To Reproduce

Create an account link

Expected behavior

I belive the account link should return a testing OAuth link.

Code snippets

$stripe->accountLinks->create([
  "client_id" => "ca_PSmgoIiep8bNgEY6JZJlPXgQW2aI6Gtn", // Unknown parameter
  "account" => "acct_1O...",
  "refresh_url" => "https://example.com/reauth",
  "return_url" => "https://example.com/return",
  "type" => "account_onboarding"
]);

OS

macOs

PHP version

PHP 8.3.0

Library version

stripe/stripe-php v13.10.0

API version

2023-10-16

Additional context

No response

remi-stripe commented 8 months ago

Hey @DevShaded Github issues are limited to bugs or feature requests with the stripe-php SDK itself. Your ask is more an integration support question better handled by our support team: https://support.stripe.com/contact

To unblock you though, the problem is that you're mixing up our APIs. The Create AccountLink API is used to link an existing connected account to onboard via our Connect Onboarding product that we offer. On the other hand the OAuth flow (which we consider legacy) is used when you want a user with an existing Stripe account to connect to your own platform. This requires a custom URL that you can generate via our OAuth package and you can see a basic example app here for example.