Include Stripe PHP library via Composer and use 7.105.0 version to support PHP 8.1

Created on 27 February 2024, over 1 year ago

Problem/Motivation

Hi there.

The Stripe PHP library includes via hook_libraries_info (from the Libraries module β†’ ).
If we have some errors in the DB Log (Watchdog) from the Stripe PHP library, we get an error, because related expectations cannot be loaded correctly.

The second thing is using the old 6x version of the Stripe PHP library which does not have compatibility with PHP 8.1, but this has been fixed since the 7.105.0 version (changelog)

Proposed resolution

  1. Include the Stripe PHP library as composer dependency (via Composer Manger β†’ contributed module or by hook_libraries_info as a composer dependency)
  2. Use 7.105.0 version of the Stripe PHP library which supports PHP 8.1.
πŸ“Œ Task
Status

RTBC

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine tibezh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @tibezh
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine tibezh

    Here a patch

  • Status changed to RTBC over 1 year ago
  • πŸ‡¦πŸ‡ΉAustria klausi πŸ‡¦πŸ‡Ή Vienna

    Thanks, looks good to me!

  • πŸ‡ΊπŸ‡¦Ukraine tibezh

    Here the same patch as above, but without changes in the .info file (for patch via .make files).

  • πŸ‡¬πŸ‡§United Kingdom freelylw

    After I install the "Use 7.105.0 version of the Stripe PHP library which supports PHP 8.1." .I got the error during the checkout I got this from the log :

    Error: Interface 'Stripe\Util\LoggerInterface' not found in require() (line 9 of /home/artjobsdotcom/public_html/sites/all/libraries/stripe-php/lib/Util/DefaultLogger.php).

  • πŸ‡ΊπŸ‡¦Ukraine tibezh

    Hi @freelylw.

    The 7.105.0 version should work here.

    Probably, autoloading doesn't work correctly on your side. Could you check the file: /home/artjobsdotcom/public_html/sites/all/libraries/stripe-php/lib/Util/LoggerInterface.php? Do you have it?

    If so, then there are issues with autoloading (probably due to a library being installed incorrectly).

Production build 0.71.5 2024