#joekneeland

1 messages · Page 1 of 1 (latest)

vast notchBOT
full swan
#

Hi 👋

Did you recently upgrade the PHP library you are using?

unkempt rock
#

Hi Snufkin

#

We did not

#

Actually getting this; PHP Fatal error: Cannot declare class Stripe\Util\RequestOptions, because the name is already in use in /var/web/site/public_html/wp-content/plugins/stripe-builder/includes/stripe-library/stripe-php-7.38.0/lib/Util/RequestOptions.php on line 5

full swan
#

And what line of your PHP code is throwing this error?

unkempt rock
#

not sure. actually on development everything works fine, on production site found this error in the logs. I'll turn on reporting on production to find the answer, brb

gleaming nexus
#

Hello! I'm taking over and catching up. I think I know what the issue is. Did you recently install a new Stripe plugin or upgrade an existing one on this WordPress install?

#

Is the stripe-builder plugin your plugin or one from a third party?

unkempt rock
#

Hi Rubeus, I hope you're well. stripe-builder is a wordpress plugin I built for them a couple years ago. Have not added another Stripe plugin, though I see now I may have accidentally uploaded the library in two locations of the plugin.

gleaming nexus
#

Ah, that could also do it.

unkempt rock
#

strange though because all was well with zero changes from me or client until fri eve

gleaming nexus
#

Maybe this error is only happening in an obscure/low use code path?

unkempt rock
#

right on main dashboard actually

#

it's a connect 'get account link' call

#

also checked another page that uses Stripe and also there. I'll try removing one of the instances of Stripe library and see if that solves.

unkempt rock
#

same results

gleaming nexus
#

Can you share the code that's throwing the error?

unkempt rock
#

other clue, it's working on my localhost, but not on live

#

sure 1sec

#

pretty sure this is it;

#

require(STRIPE_BUILDER_PATH_TO_STRIPE_INIT);
\Stripe\Stripe::setApiKey(TCC_STRIPE_SK);
$stripe_sellers_dashboard_link = \Stripe\Account::createLoginLink($provider_stripe_subacct_id);

gleaming nexus
#

Is that the first time you're calling \Stripe\Stripe::setApiKey?

unkempt rock
#

ah, I'll check

#

nope...

gleaming nexus
#

So that's probably the issue. The static class approach that you're using doesn't support being initialized with different API keys. Are you using a different API key here or the same one you've already used earlier?

unkempt rock
#

gotcha. same key

gleaming nexus
#

If it's the same key you should be able to skip calling \Stripe\Stripe::setApiKey again.

#

Like if you comment out the \Stripe\Stripe::setApiKey(TCC_STRIPE_SK); line does it work?

unkempt rock
#

yep does work now

#

thanks so much. I'll run through and make sure all the other calls are working

gleaming nexus
#

Awesome!

unkempt rock
#

you're the best Rubeus, I know you've helped me many times over the years and I super appreciate

gleaming nexus
#

Always happy to help!