Jeremy S.
Jeremy S.

Reputation: 4639

Correct syntax to pre-fill fields on Stripe Connect's oauth/authorize signup

I am having difficulty getting fields to pre-fill on Stripe Connect's user authorization signup page based on the optional query string params listed on https://stripe.com/docs/connect/reference. This page identifies optional fields such as stripe_user[product_description].

The default signup process works properly for me so the required params such as client_id and response_type are being set properly based on the url params.

But when I add an optional param like stripe_user[production_description] to the end, such as in the following, it is getting ignored:

https://connect.stripe.com/oauth/authorize&scope=read_only&stripe_landing=register&response_type=code&client_id=ca_MyClientId&stripe_user[product_description]=My%20Product%20description.

If, however, while on a test user's new account signup page I simply add the query string to the end of the url params, e.g. by just appending &stripe_user[product_description]=My%20Product%20description. to the browser address bar, the product description field is hidden by Stripe, which I take to mean it is being received and recognized properly.

I have a feeling my syntax is off slightly somewhere so any help is appreciated.

Upvotes: 3

Views: 1242

Answers (2)

W. Matthew Wilson
W. Matthew Wilson

Reputation: 166

I struggled with this same thing, until I encoded the the "stripe_user[product_description]" part. In your case,

stripe_user[product_description]=My%20Product%20description

should be

stripe_user%5Bproduct_description%5D=My%20Product%20description

Upvotes: 0

elena
elena

Reputation: 4178

I think you could just have it, for instance, in a href like so :

<a href="https://connect.stripe.com/oauth/authorize&scope=read_only&stripe_landing=register&response_type=code&client_id=ca_MyClientId&stripe_user[product_description]=My Product description&stripe_user[url]=https://somesite.come">Connect to stripe</a>

Upvotes: 1

Related Questions