#mindsetinmeta
1 messages · Page 1 of 1 (latest)
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.
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_Uk5775hzllQ0kN
As the error message explains, you have passed in a unknown parameter "session_id" and that's why the request is unsuccessful.
If you want attach custom data, you can use metadata https://stripe.com/docs/api/metadata#metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
how can I pass it in as part of the success_url and cancel_url?
Is your objective to retrieve the checkout session ID in the success_url?
the project ID, not the checkout session ID
we would like to pass in the project ID
And how do you intent to retrieve it?
so when the customer returns, we know what to show on teh return page.
from the page URL
Then you just append your custom data as a query param of the URL
For example: 'https://www.youdomain.com?projectid=foo'
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
Request iD?
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' }
I just did a quick test and I'm able to include & in the success url.
@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.
@sterile dagger do you have the request ID so that I can take a look?
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?
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
I'm passing that as part of the success_url
but Stripe did not parse it correctly
The problem is not with the success_url
The problem is that you are passing unknown parameter
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?
As long as it's a valid URL, something like https://www.youdomain.com/?projectid=foo&productid=bar
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.
No, Stripe doesn't parse the success_url to retrieve the query params.
Can you share with me your code?
I think you may need to replace & with %26 when making a request
It really depends on how you create the request, if you are willing to share the code, I'm happy to help you.
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?
https://stripe.com/docs/development/checklist here's a go-live checklist