#vivien_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1324662681457786941
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
It was a bit complicated to describe the problem with the provided form, tell me if you need more information
๐
Java is a strong typed prog language, so each Stripe version is pinned to the Java SDK version.
You need to create a Jar for each Stripe Version
๐
That's what we planned to do, a gateway containing every jars, for every versions, and route the request on the good jar depending of the API version, unfortunately we can't get the API version from the api itself, there is no endpoint returning it
Yes, but you in your gateway you should able to surface that information
Like a mapping jar -> Stripe Version
the mapping would not be a problem I think
Let's say a company in the group creates its Stripe account. It will send me its API key and its webhook key. I wouldn't necessarily have access to the Stripe dashboard. How am I supposed to know which API version is used by the account, and therefore which JAR to use?
It will send me its API key and its webhook key
They should send you their desired API version too.
You don't think we should be able to get the API version through a request on the API itself
No, because they can use multiple API version at the same time. They are not obliged to use their default API version.
Each Stripe Accoutn can use any API version they want.
yeah I know but if I don't have access to the account, and I only have stripe api key & webhook key I can't do anything. I mean you tell me each account can chose his api version but that mean if a company tell me "We are using
2024-12-18.acacia" So we're going to write it in hard copy on our side "this company -> this api version -> this jar"
If they update, we will have to edit the code to change the API version manually.
Whereas if we could retrieve the api version directly by making a request, it could be transparent.
if a company tell me "We are using
2024-12-18.acacia" So we're going to write it in hard copy on our side "this company -> this api version -> this jar"
You hardcode just the mapping api version -> Jar
You need to route the request based on the version send in the API and not hard code it
If you want to support multiple Stripe Version, you'll need to expose an API for multiple Versions and not encapsulate the API version hardcoded (e.g. by jar).
Whereas if we could retrieve the api version directly by making a request, it could be transparent.
Currently this is not supported, because each Stripe Account can use multiple Stripe version at the same time and even within the same integration. If you want to have this limitation by your integration (each Stripe Account must use only one Stripe API version) then you need to track this by your integration/database.
you mean the Stripe-version header does force an API version on the account ?
Yes for example, or the same Stripe account may have a bunch of Java microservices which each one uses a different Stripe Java SDK version.
mhhh okay
So if I set only one JAR version, and I do force the Stripe-Version header in every API calls with the version corresponding to my JAR, I should be fine ?
No, with Java you don't need to set the Stripe-Version header because Java is a strong typed prog lang. In other words, each Stripe version is pinned to the Java SDK and you can't override it, unless you want to create your own http client and call Stripe API directly without using the Java sdk
Which is not recommended (you should use Stripe SDK)
Does this mean that the header is added/abstracted in the call made through the java sdk ? or there is no header at all specifying the api version through sdk calls ?
Yes it's specified in the header, and you can't override it (there is no public method for this when calling the SDK.)
okay, so correct me if I'm wrong, if the stripe account is set up with a more recent version of the API, but the SDK sends an older version, it should work, right?
Yes
The default API version at the Stripe Account level is used when there is no API version specified in the API call (Stripe-Version Header)
then we should not have any problem then ๐ค but we had some at some point
What is the issue ? can you share a request Id ?
it was a while ago
but on the newly created accounts the version of the API was really new, and it was not working with our old sdk
What you mean by it's "not working" ? do you have a concrete example ?
Is it with webhooks ?
We use a JAR in two distinct project, one which allow us to generate a payment link depending of an API key, and the other one is receiving a webhook request verify the signature, and log the payment complete in a database
I think it was a problem on the signature verification, I don't remember exactly
Yes that's possible, because the webhook endpoint APi version must match exacly the Stripe APi version pinned in the SDK
Next time, make sure to create the webhook endpoint with the correct API version
but we can't create webhooks with older api version so
You can via API.
This is the creation api call.
Okay so I can choose any version with the API call ? Through the developper dashboard I can choose between two
Yes with APi you can choose any version