#Damien Haas-PHP-Error

1 messages ยท Page 1 of 1 (latest)

vital rose
#

Hi there ๐Ÿ‘‹ do you know what line of code is executing when you encounter that error?

inner pecan
#

it looks super basic I know..

#

(sorry, discord transforms ' into %27 for the "return_url")

#

It fails at the 2nd line: $stripe = new \Stripe....

vital rose
#

Thank you, was just comparing to some playground PHP code that I have. Can you confirm that the Stripe SDK folder is located where indicated by the require_once line, and that the folder contains the init.php file?

inner pecan
#

yes, confirmed

#

the error is not with the "required_once", but the next line

#

I did install it a long time ago... is it possible that the "StripeClient" is not part of it?

vital rose
#

Hm, I'm not sure. Mine starts with the require line followed by:
$stripe = new \Stripe\StripeClient('sk_test_

Do you know what version of the library you have installed?

inner pecan
#

Sorry, I do not know. I installed it around April-May 2020

vital rose
#

Sorry, I've been scouring looking for what could be the cause. It doesn't seem Stripe specific though. What is the very first line of your script? I'm seeing mentions that some environments are very picking about the opening tags.

kindred kite
#

I'm not immediately aware of how to do it for accountlinks specifically but it sounds like your code will look more like this ```\Stripe\Stripe::setApiKey('sk_test_xxx');

// Retrieve the customer and then delete it
$customer = \Stripe\Customer::retrieve('cus_xxx');
$customer->delete();

// Create a Coupon
$coupon = \Stripe\Coupon::create([
'percent_off' => 25,
'duration' => 'repeating',
'duration_in_months' => 3,
]);```

inner pecan
#

my code looks like this too...

#

$stripe = new \Stripe\StripeClient('sk_live_etc....');

#

I just deactivated the whole code before (was basically to check if user is logged in / if user page exists)

#

I get the same error

brisk tendon
#

Definitely weird as we aren't able to reproduce it on our end ๐Ÿค”

kindred kite
#

Was this working before with creating the StripeClient?