#mmunir_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/1409970787711979642
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! you can upgrade the API version for your whole account from the dashboard workbench, or depending on which SDK you're using you can change the API version while initializing the SDK or even on request level
https://docs.stripe.com/upgrades#how-can-i-upgrade-my-api
it sounds like you just want to upgrade the dashboard API version?
I need those old api 2020-08-27 as in that it shows payment intent when created by customer and even though if they cancel the checkout we use to see in payments section of dashboard but now i am not as my checkout is using the latest 2023-08-16
All though from my dashboard i see i am on default api but when my website creates checkout it uses 2023-08-16 api
My default is set as 2020-08-27
can you share an example checkout session ID?
wait sorry, i just noticed you already shared a request ID
and you want these to also be created with version 2020-08-27?
Yup
it looks like your code is explicity setting the version somewhere to 2023-08-16
My main purpose is when a customer use to abound the check out i was able to see the payment intent on my payment section of dashboard
the way this is done is documented here:
https://docs.stripe.com/api/versioning?lang=php
i would just search your codebase for 2023-08-16 and find where exactly you're setting that. removing that will change these requests to use your default account version
Just to jump in here, it's likely that the version of stripe-php you are using is pinned to that api version
I am using php 8.4. Using slim/php stripe vendor
I should be looking for api stripe_version" => "2025-07-30.basil
In my codes to change this right?
I don't know what slim php stripe vendor is
Based on that request id you are using stripe-php 12.8.0
Which is pinned to use 2023-08-16 on every request
Unless you override it
Just to confirm once again like reverting back will solve my main purpose right now as customer opens checkout on my website and cancels it i be sewing it on my dashboardof payment section right
Before it was easy i used to check the payment section of my dashboard of stripe app and use to know what product and who is trying to purchase it.
Now using the latest one i have to go in developer tab using my computer and scroll towards logs to see this
Reverting what back? I don't follow
Reverting back to 2020-08-16 api version where payment intent was saved in payment section of dashboard
I mean yeah if that's what you want
You either have to set that version on a per request basis or downgrade your stripe-php package
Do we have any other better way to track cancelled payment. If any that i am not aware of. Where i can use the stripe app to see all the cancelled transactions and its meta data
I don't really follow how api version influences what you see on the dashboard though
That shouldn't affect things at all
Can you give a specific example
Like before this api version upgrade i use to see on my payment section cancelled transactions
Since the api has been upgraded i dont get this
Not sure how an api upgrade could affect that
Canceled payment intents are still a thing in later versions
I was told by stripe support team
This is talking about something completely different though?
That's about checkout session payment intent creation
Not canceled payment intents?
Oh I think i understand what you're getting at
If you use an older api version, checkout sessions create a payment intent on creation and if the customer doesn't complete the session you get cancelled payment intents
Do I understand your issue correctly?
Yes
And by that i ise to know what product and who is trying it so i could get them back
We are tour company sometime abounded customer they just feel not right but want to go on the tour some other day so we approach them when they cancelled checkout
If the requirement is to see this in your stripe dashboard app, then you need the older api version
But i recommend you use the newer api version and just listen for checkout.session.expired events: https://docs.stripe.com/api/events/types#event_types-checkout.session.expired
You get that event when a session has expired and you know customer didn't complete payment
Events are saved but are only shown in computer not in app
App dosent have any feature to see ligs or events in ot and its really hard to open computer everytime to track this up
Yeah again
If the requirement is to see this in the app then you need to use older version
With app we can have them handy and easy to handover to our team promptly
never share secret keys in here
even if they're test keys
i had to delete the message
Recommend you rotate it now: https://docs.stripe.com/keys#rolling-keys
This is a public server
Its not mine its from doc i guess
If you copied from the api spec or something it uses your account's secret key
Oh i see
Not a huge deal since it's a test key
Ok
But still someone can use it to run requests and control your account's test mode
I still recommend you rotate it
Other than that this code will help be pasted in backend file right were we have api calls for intent creation
You said you were using checkout sessions
so you shouldn't be creating intents directly
This is the way i create checkout session
That's 500 lines of code...
Please just share the exact snippet where you do this
And also ask a clear question
I'm not sure what you need me to do for you right now
$app->post('/checkout_sessions', function (Request $request, Response $response, $args) {
$params = json_decode($request->getBody()->getContents());
$session = Session::create([
'success_url' => 'http://localhost:4242/success.html?session_id={CHECKOUT_SESSION_ID}',
'cancel_url' => $cancelurl[$params->package],
'mode' => 'payment',
'payment_intent_data' => [
'metadata' => [
'package' => $params->package,
'date' => $params->datepicker,
'adults' => $params->adults,
'children' => $params->children,
'infant' => $params->infant,
'occupancy' => $params->occupancy,
'tour' => $params->tour,
'product_image' => $params->pic,
'ref' => $params->refcode,
'promo' => $params->promoCode,
'add_on' => $params->addOns,
]
],
'metadata' => [
'package' => $params->package,
'date' => $params->datepicker,
'adults' => $params->adults,
'children' => $params->children,
'infant' => $params->infant,
'occupancy' => $params->occupancy,
'tour' => $params->tour,
'product_image' => $params->pic,
'ref' => $params->refcode,
'promo' => $params->promoCode,
'add_on' => $params->addOns,
],
'submit_type' => 'book',
'line_items' => [[
'price_data' => [
'currency' => 'aed',
'product' => $products[$params->package],
'unit_amount' => $params->amount,
],
'quantity' => 1,
]],
'phone_number_collection' => [
'enabled' => true,
],
]);
return jsonResponse($response, ['id' => $session->id]);
In this set of codes i need to mention api version where intent?
yep
Thanks