Stripe - creating API using Bubble API plugin

I am stumped! I am attempting to create an API connector to Stripe. (Yes Bubble has a plugin, and yes there is a Stripe.js plugin. However: the Bubble plugin does not offer all the functionality we need. The Stripe.js plugin keeps stalling on Chrome when it does a m.stripe.com cookie request at initialization. (Note: this is NOT the author of the Stripe.js plugin’s issue… rather Stripe does this action by default in their JS.) So back to the issue…

I have tested the POST API connection using Postman and it works using the Content-Type application/x-www-form-urlencoded as required by stripe. But… the Bubble API does not have this option - but does have Form-data which I am not sure if it is compatible - since it does not work. Here is a pic of the API as it stands… (Yes… I have entered the authorization in the header and GETs work fine so it is not a auth issue).

Any inspiration would be greatly appreciated.
John

1 Like

try with body type JSON (do not add a body payload) add the data as parameters and tick the box “querystring”.

Cheers
Mariano

Genius :slight_smile:

I would have never have guessed it… if you were close I would buy you a beer, or any other beverage of your choice. It’s 3:00am here… so thanks to you I get to go to bed now.

John

1 Like

Sleep well and rest :slight_smile:

Thanks Mariano…
A tip (maybe this is common knowlege):
Stripe uses nested JSON objects for the address data.
“address”: {
“city”: “Chelmsford”,
“country”: null,
“line1”: null,
“line2”: null,
“postal_code”: null,
“state”: null
},
They need to be treated as arrays. To make this work in Bubble put the array name as the key. Eg. address[city]

2 Likes

Yes, you can use the square bracket notation. For example it’s address[city] for {"address": {"city": 123}}, and address[0][city] for {"address": [{"city": 123}]}

1 Like