API connector Stripe.checkout.sessions init error

bubble UI seems buggy, im following examples…
Curl CLI works fine ( stdout below ) and should translate to the bubble UI

api.connector’s initialize throws error

note 1 success_url parm is there in the dialog config
note 2 the value in the success_url can be connected to via api connector AND returns a 200 onInitialize in the dashboard

dashboard configs :

Curl stdout on same Post action :

POST /v1/checkout/sessions HTTP/2
Host: api.stripe.com
authorization: Basic gxUGFWeXZTbWE0SkhPYjZyOEN0c3YycDAwODhua24xc0E6
user-agent: curl/7.68.0
accept: /
content-length: 197
content-type: application/x-www-form-urlencoded

  • Connection state changed (MAX_CONCURRENT_STREAMS == 128)!
  • We are completely uploaded and fine
    < HTTP/2 200
    < server: nginx
    < date: Thu, 12 Aug 2021 22:26:21 GMT
    < content-type: application/json
    < content-length: 1361
    < access-control-allow-credentials: true
    < access-control-allow-methods: GET, POST, HEAD, OPTIONS, DELETE
    < access-control-allow-origin: *
    < access-control-expose-headers: Request-Id, Stripe-Manage-Version, X-Stripe-External-Auth-Required, X-Stripe-Privileged-Session-Required
    < access-control-max-age: 300
    < cache-control: no-cache, no-store
    < request-id: req_p7iSjFeJ3uPNPk
    < stripe-version: 2020-08-27

discussion: if i Remove the empty json body ** {} ** as post body in the dash board, i get a diff result :

“error”: {
“message”: “Invalid request (check that your POST content type is application/x-www-form-urlencoded). If you have any questions, we can help at Stripe: Help & Support”,
“type”: “invalid_request_error”

BUGGY ! the header is there as you can see above

expect result after running a POST in Curl, i expect to be able to use the dashboard as tool to translate the Curl expression into whatever Bubble’s idiom/syntax/protocol is. devTools dont help me debug the network tab when “initialize” is clicked.

–RESOLVED–
remove all on key values in “params” section
put all those params into a queryString type expression ?k1=v1&k2=v2&kn=vn
insert the qryString expression into the json body without a real json string

Check all of them as Queryst.

2 Likes

wow fast / thx / diff error on syntax of subsequent parm …

stripe api docs for curl list the follow parms

-d “line_items[0][price]”=price_H5ggYwtDq4fbrJ
-d “line_items[0][quantity]”=2 \

i tried using bubble api connect link copy curl and got bad result…

how to translate the 2 Curl parms above for the bubbl.connectors parm list ???

that value " price_H5ggYwtDq4fbrJ " is not being encoded / transmitted correctly by the connector.initialize action in the UI

Header will not apply in this case.
You should move your parameters to the body json place (even if this will not be a json) and use
line_items[0][price]=price_H5ggYwtDq4fbrJ&line_items[0][quantity]=2 for example. Keep your header and it should work.

I’ve already make a topic here about different API Connector (strange) behavior.
You can also consider using “raw” body type.

1 Like

that worked . thank u for prompt solution

1 Like

main issue was how to use the json body field to capture the query-string like concatenation of all the KV pairs… hokey , some bugs but it works AND then becomes logical Action back in the workspace!