#mindsetinmeta

1 messages · Page 1 of 1 (latest)

trail scaffoldBOT
sterile dagger
#

I'm creating a checkout session and setting up the success_url and cancel_url

#

can I pass in additional parameters in these two urls?

#

when I pass in the project id in the URL, I receive the following error.

strong pewter
sterile dagger
#

req_Uk5775hzllQ0kN

strong pewter
#

As the error message explains, you have passed in a unknown parameter "session_id" and that's why the request is unsuccessful.

sterile dagger
#

how can I pass it in as part of the success_url and cancel_url?

strong pewter
#

Is your objective to retrieve the checkout session ID in the success_url?

sterile dagger
#

the project ID, not the checkout session ID

#

we would like to pass in the project ID

strong pewter
#

And how do you intent to retrieve it?

sterile dagger
#

so when the customer returns, we know what to show on teh return page.

#

from the page URL

strong pewter
#

Then you just append your custom data as a query param of the URL

sterile dagger
#

how can I append multiple parameters and the & sign to Stripe?

#

as part of success_url?

#

Stripe is not recognizing the & and thinks it's an additional parameter

strong pewter
#

Request iD?

balmy eagle
#

sorry to bud in but what i do @sterile dagger is pass a single ID in the return url and on the success page I retrieve that ID from the database. in the db i store the data i want with that ID so i can get it later

#

and in the db: 77: { customer: 'john', project: 'foo' }

strong pewter
#

I just did a quick test and I'm able to include & in the success url.

sterile dagger
#

@balmy eaglethat's what I did man.

#

but when I pass in multiple parameters, Stripe does not recognize & and thinks I'm passing in the parameter after & as an additional parameter.

strong pewter
#

@sterile dagger do you have the request ID so that I can take a look?

sterile dagger
#

req_Uk5775hzllQ0kN

#

req_PbSmp9FzYXnxFC

#

in these two, I tried passing in session_id and project_id as part of the success_url following an "&" but Stripe thinks I'm trying to pass in the parameter as part of the request and thus throw an error.

#

can you share your example?

strong pewter
#

If you read the error message, the request was failed because you added in an unknown param session_id: "",

#

You should remove it and try again

sterile dagger
#

I'm passing that as part of the success_url

#

but Stripe did not parse it correctly

strong pewter
#

The problem is not with the success_url

#

The problem is that you are passing unknown parameter

sterile dagger
#

what should be the format of success_url if we would like to pass in additional parameters?

#

should we wrap the url with '...' or "..."

#

so Stripe will recognize it's a whole URL?

strong pewter
sterile dagger
#

if you pass this in, Stripe will parse productid as part of the API request and consider it as a parameter and throw an error.

strong pewter
#

No, Stripe doesn't parse the success_url to retrieve the query params.

#

Can you share with me your code?

sterile dagger
#

I think you may need to replace & with %26 when making a request

strong pewter
#

It really depends on how you create the request, if you are willing to share the code, I'm happy to help you.

sterile dagger
#

I think it's solved. thanks.

#

we are ready to launch one of the other projects. do you have a manual on how to switch from test mode to live?

strong pewter