Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 7.4 compatibility with Stripe 7.0.0 #95

Closed
smcyr opened this issue Dec 18, 2019 · 22 comments
Closed

PHP 7.4 compatibility with Stripe 7.0.0 #95

smcyr opened this issue Dec 18, 2019 · 22 comments
Assignees

Comments

@smcyr
Copy link

smcyr commented Dec 18, 2019

Right now, the plugin gives this error on the checkout page:
array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead
The library stripe-php fixed a couple of errors on version 7.0.0:
stripe/stripe-php#725
So, the plugin should be updated for this version:
https://github.com/stripe/stripe-php/wiki/Migration-guide-for-v7
Thanks!

@princeflight
Copy link

princeflight commented Feb 24, 2020

I to now suffer from this error.
Craft: 3.4.8
Commerce: 3.0.10
Stripe for Craft Commerce: 2.2.3
PHP: 7.4.2

array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead

Above error is displayed also in the CP when adding new subscription plan.

@sebschaefer
Copy link

Another problem when trying to open an active subscription in CP:

Trying to access array offset on value of type int
vendor/stripe/stripe-php/lib/Util/Util.php:45

Latest craft commerce & commerce-stripe plugin versions.

@andrelopez
Copy link

Stripe Payments v2.5.0 has added stripe/stripe-php requirement to ^7.0.0 (Upvote anyone who has Craft Commerce and Stripe Payments installed and need support for php 7.4)

@23d1
Copy link

23d1 commented Apr 1, 2020

Any movement on this?

@AndrewMac
Copy link

There also seems to be a stripe/stripe-php issue with craftcms/commerce-stripe and the latest version of Solspace Freeform :-(

@chadcrowell
Copy link

+1 on AndrewMac's report above. Freeform has updated Stripe-php to v7+ and there is a composer dependency crash between Freeform and this plugin. Please update it to stripe-php v7+ so we can upgrade plugins. The current Freeform dependency version is "stripe/stripe-php": "^7.27.3"

@lukeholder
Copy link
Member

Looking into upgrading this now.

nfourtythree added a commit that referenced this issue Apr 9, 2020
@nfourtythree
Copy link
Contributor

nfourtythree commented Apr 9, 2020

Hi All

Have just pushed up the updated composer.json with the new requirement. Have been testing payments/refunds on different PHP versions and instances and everything seems to look good.

If anyone wants to install this on a local/staging environment and let us know any feedback or issues you spot. You can do using the composer requirement below.

"require": {
  "craftcms/commerce-stripe": "dev-develop#6945f0fb6de46b669c144299a2c5c9b13189b29e as 2.2.3",
  "...": "..."
}

Then run composer update craftcms/commerce-stripe.

We will look to get a release out asap, taking into account any feedback we get.

Thanks.

@chadcrowell
Copy link

I made the update to composer.json on local but my composer update command is just spinning for minutes on end with no output.

Loading composer repositories with package information
Updating dependencies (including require-dev)

I can't seem to get it to fully run. I do have a lot of plugins on this site but never have seen this happen. Replacing the original "craftcms/commerce-stripe": "2.2.3", composer update does run.

@nfourtythree
Copy link
Contributor

Hi @chadcrowell

You will likely need to add the following lines to your composer.json

  ...
  "minimum-stability": "dev",
  "prefer-stable": true,
  ...

I would suggest that this is only recommended when testing locally or in a staging environment.

@chadcrowell
Copy link

No change. The only way composer doesn't stall on either update or install is putting it back to "craftcms/commerce-stripe": "2.2.3",

@angrybrad
Copy link
Member

@chadcrowell try composer clear-cache and/or composer self-update and see if that helps

@chadcrowell
Copy link

chadcrowell commented Apr 10, 2020 via email

@nfourtythree
Copy link
Contributor

Version 2.3.0 has been released with this update.

You should be able to update as you would normally (ignoring develop branch etc).

Thanks!

@focalinteractive
Copy link

@nfourtythree Same issue with @chadcrowell
Updating from 2.2.3 to 2.3.0 is stuck at "Perform update with composer..."

@nfourtythree
Copy link
Contributor

Hey @focalinteractive

What is your requirement for this package in your composer.json?

Thanks

@chadcrowell
Copy link

Getting same issue as @focalinteractive above, which is the same thing I was getting above that. Fans spinning and Composer stuck.

@nfourtythree
Copy link
Contributor

Hey @focalinteractive & @chadcrowell

Have you tried removing your vendor directory and composer.lock and then running composer install?

@focalinteractive
Copy link

@nfourtythree Yes, ultimately that's what I did to resolve the issue days ago. However, re-installing all dependencies takes a while so it's something that we want to avoid doing on production environments.

@chadcrowell
Copy link

Hi Nate - I finally got it to work later yesterday after 3 or 4 repeats of the same issue described above. Each time I removed vendor and composer.lock and re-ran composer install, then tried the upgrade either through the Control Panel or through editing composer.json and running composer update.

After walking away for a bit, I came back and got it to work. I had upgraded everything else on this site, Craft 3.4.x, Commerce 3.x, and all other plugins - the only 2 remaining were the 2 that depend on stripe-php... Freeform and Commerce Stripe. I used the Update All button in the Control Panel and both updated without issue. I haven't tested the upgraded versions yet but will today. So, I don't know why it worked that time but it was the only time I tried updating both plugins together rather than one or the other first.

@antcooper
Copy link

Have run into this one too. Tried all above suggestions to clear cache and vendor folder etc.

@antcooper
Copy link

Have run into this one too. Tried all above suggestions to clear cache and vendor folder etc.

I managed to get this to work by uninstalling Freeform, run Stripe update, and then reinstall Freeform.

Make sure you backup any Freeform submissions first as uninstalling will remove them all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests