Migrate to StripeClient for stripe-php 7.33.0

Created on 14 October 2020, about 4 years ago
Updated 30 May 2024, 7 months ago

Problem/Motivation

Stripe has an ongoing release of 7.x in the stripe-php wrapper. They also have instructions on how to migrate to the new Stripe Client and services: https://github.com/stripe/stripe-php/wiki/Migration-to-StripeClient-and-...

I noticed you already bumped the composer dependency of stripe-php to ^7.36, but this module's StripeApiService would need some changes to use this new approach. This would make room for a more intuitive use of the Stripe integration as opposed to ie. #2837949: Add new argument $options in stripe_api_call β†’ to making a call like:

// Before:
$class = $this->stripeApiService->call('PaymentIntent');	
$intent = call_user_func([$class, 'create'], $params, $options);

// After: 
$stripe = $this->stripeApiService->getStripeClient();
$intent = $stripe->paymentIntents->create($params, $options);

I have forked this repository to https://github.com/baikho/drupal-stripe_api with a 2.x release and relevant changes, and also rolled a patch out of a diff on HEAD against this module's 8.x-2.x branch.

Steps to reproduce

N/A

Proposed resolution

Shift the StripeApiService to the new StripeClient solution.

Remaining tasks

It would be good if we could merge the fork or apply the patch to this module and tag a 2.x-dev (semver) branch / alpha release.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

✨ Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium baikho Antwerp, BE

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024