#Serge
1 messages ยท Page 1 of 1 (latest)
Hi there!
Pasting your other message here:
\Stripe\Stripe::setApiKey($stripe_api_key);
$retrieve_stripe_subscription = \Stripe\Subscription::retrieve
What's the error message you see?
I have no error message, nothing
My full code (that was working well before) is the next :
try {
\Stripe\Stripe::setApiKey($stripe_api_key);
$retrieve_stripe_subscription = \Stripe\Subscription::retrieve($pp_profile_id);
}
catch (\Stripe\Error\ApiConnection $e) {}
catch (\Stripe\Error\InvalidRequest $e) {}
catch (\Stripe\Error\Api $e) {}
catch (\Stripe\Error\ApiConnection $e) {}
catch (\Stripe\Subscription $e) {}
My PHP code stops there
When I see Stripe Documentation, to test how to retrieve a subcription in PHP, I read the following PHP code :
$stripe = new \Stripe\StripeClient($stripe_api_key);
$stripe->subscriptions->retrieve($pp_profile_id,[]);
But this code doesn't work in PHP 5.3
If your code doesn't work, there must be some error message. Can you add some logs to your code, or check your server logs? Without an error message it's hard to help.
no problem detected on server logs
no messages from catch
I don't understand why this code that was working well during years is not working any more
I guess this is a Stripe update that makes it deprecated or something like that
the problem is : I don't see anything in stripe documentation managing his
What version of our PHP library are you on? We should still support them unless we have something about it in those docs
Can you try logging your request ID and send it to me? (req_123)
stripe php 5.9.2
Still supported as far as I can see. Can you try logging that request ID and sending it to me?
What do your mean by logging request ID ?
Apologies thought I already sent the link https://stripe.com/docs/api/request_ids
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So, your expectation that I put this code in my page to see what it gets ?
Yes, if you put that code on your server that can help us get insight in to what is happening here
[23-Jan-2023 15:31:15 Europe/Paris] PHP Fatal error: Class 'Stripe\StripeClient' not found in subscription.php on line 293
meaning that this code doesn't go on $stripe = new \Stripe\StripeClient($stripe_api_key);
Gotcha, thank you for that error, that is helpful to know where this is failing.
When you say "this code doesn't go on", do you mean it isn't being run at all?
Can you double check that the init.php code is being called?
Or at least specifically that StripeClient line?
how can I do that ?
Can you print out the Stripe Client just after setting it and see if that shows that the client is actually being set up?
can you give me a code example ? I don' t see how to do it specifically ?
line above is : require_once("../stripe/init.php");
which is where the file is
I am not that familiar with php unfortunatley. Can you add print statements to init.php itself?
If not, can you see if you can access anything else that is set up in that file?\
i m gonna try
The access to the file is ok
if (require_once($fichier_init))
{echo ('require once done');}
exit;
i got the message
so it seems to read the init.php file
Can you access the StripeClient object in any way?
I can access to ini.php file so I guess Yes, how can I be sure to acces to StripClient object ?
Where is the Stripe\StripeClient object stored in the lib ?
Hello ๐
Taking over as Pompey needs to step away soon
Are you using composer OR the manual installation option?
https://dashboard.stripe.com/logs/req_ZIKzMiX4CA5uGn
I think the Stripe Lib for PHP 5.3 is not working anymore
And I cannot updrade the PHP Version as all the application is done with this version
So, How Can I do ? Is this a Lib supporting PHP 5.3 up to date ?
I still dont understand why it is not working anymore, As I havent touch this part of code since years and one day, this is not working
It can't just stop working on its own unless some changes were made. Did you update the library by any chance?
Tell me Library I need to intergrate because when I use the on for PHP 5.3 this is not working, and when I use the latest one online this is causing PHP errors in my app
So I m lost with the ressources posted by Stripe
I m not able to make some transactions
this is causing bugs and troubles in my app
We have instructions for PHP 5.3 here
https://github.com/stripe/stripe-php#php-53
I have already read it and download the library before contacting you
this is not working
v5.9.2 is the library that supports PHP 5.3
All you need is to download it and require init.php
Depending on how your files are nested, it is possible that the StripeClient instance isn't getting passed to your other files. Its really hard to know whats breaking your code without actually looking at your project structure.
the structure of the files in each folder is OK,
the code that is posted in the instructions :
$customer = $stripe->customers->create([
'description' => 'example customer',
]);
echo $customer->getLastResponse()->headers['Request-Id'];
this code is not working for PHP 5.3
Well the code won't work if the library isn't setup correctly. And "code is not working" is quite vague.
You need to provide exact error messages, logs etc in order for us to help you.