#mmunir_api

1 messages ยท Page 1 of 1 (latest)

finite groveBOT
#

๐Ÿ‘‹ 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.

dusky vine
#

it sounds like you just want to upgrade the dashboard API version?

still wharf
#

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

finite groveBOT
still wharf
#

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

dusky vine
#

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?

still wharf
#

Yup

dusky vine
#

it looks like your code is explicity setting the version somewhere to 2023-08-16

still wharf
#

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

dusky vine
#

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

novel ferry
#

Just to jump in here, it's likely that the version of stripe-php you are using is pinned to that api version

still wharf
#

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?

novel ferry
#

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

still wharf
#

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

novel ferry
#

Reverting what back? I don't follow

still wharf
#

Reverting back to 2020-08-16 api version where payment intent was saved in payment section of dashboard

novel ferry
#

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

still wharf
#

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

novel ferry
#

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

still wharf
#

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

novel ferry
#

Not sure how an api upgrade could affect that

#

Canceled payment intents are still a thing in later versions

still wharf
#

I was told by stripe support team

novel ferry
#

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?

still wharf
#

Yes

novel ferry
#

Ok then yeah

#

You just need to use an older api version

still wharf
#

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

novel ferry
#

If the requirement is to see this in your stripe dashboard app, then you need the older api version

#

You get that event when a session has expired and you know customer didn't complete payment

still wharf
#

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

novel ferry
#

Yeah again

#

If the requirement is to see this in the app then you need to use older version

still wharf
#

With app we can have them handy and easy to handover to our team promptly

novel ferry
#

never share secret keys in here

#

even if they're test keys

#

i had to delete the message

#

This is a public server

still wharf
#

Its not mine its from doc i guess

novel ferry
#

If you copied from the api spec or something it uses your account's secret key

still wharf
#

Oh i see

novel ferry
#

Not a huge deal since it's a test key

still wharf
#

Ok

novel ferry
#

But still someone can use it to run requests and control your account's test mode

#

I still recommend you rotate it

still wharf
#

Other than that this code will help be pasted in backend file right were we have api calls for intent creation

novel ferry
#

You said you were using checkout sessions

#

so you shouldn't be creating intents directly

still wharf
novel ferry
#

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

still wharf
#

$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?

novel ferry
#

yep

still wharf
#

Thanks