Drupal is a registered trademark of Dries Buytaert
drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). eca 3.1.1 Minor update available for module eca (3.1.1). layout_paragraphs 2.1.3 Minor update available for module layout_paragraphs (2.1.3). ai 1.3.3 Minor update available for module ai (1.3.3). ai 1.2.14 Minor update available for module ai (1.2.14). node_revision_delete 2.0.3 Minor update available for module node_revision_delete (2.0.3). moderated_content_bulk_publish 2.0.52 Minor update available for module moderated_content_bulk_publish (2.0.52). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8).

stripe_api

128 sites Security covered
View on drupal.org

4.0.x

This module provides the Stripe PHP library as a service. It provides:

  • API key storage via Key.
  • A "@stripe_api.stripe_api" service that can be injected into your PHP classes
  • A web hook route at /stripe/webhook, which will validate incoming webhooks and dispatch a stripe_api.webhook event that can be subscribed to

Once you've enabled the module and set your API keys, you are free to use the Stripe API library in your custom module. Simply injecting the "@stripe_api.stripe_api" into your class is sufficient to open a connection. For example:

use Drupal\stripe_api\StripeApiService;
use Stripe\Subscription;

class MySpecialClass {
  public function __construct(StripeApiService $stripe_api) {
    $this->stripeApi = $stripe_api;
  }
  public function loadSubscriptionsMultiple($args = []) {
    $stripe_client = $this->stripeApi->getStripeClient();
    $subscriptions = $stripe_client->subscriptions->all();
    if (!count($subscriptions->data)) {
      return FALSE;
    }

    return $subscriptions;
  }
}

Requirements

In order to use this module, you must manage your Drupal site dependencies using Composer. See Using Composer to manage Drupal site dependencies for instructions.

Related Modules

7.x-1.x

This module provides a simple abstraction of the Stripe PHP SDK. It does not (and will not) provide any additional functionality. This module is designed to be required by other contrib/custom modules.

See project README.md for more information.

πŸ‡ΊπŸ‡¦

This module is maintained by Ukrainian developers.
Please consider supporting Ukraine in a fight for their freedom and safety of Europe.

Activity

Total releases
4
First release
Oct 2025
Latest release
5 months ago
Release cadence
8 days
Stability
75% stable

Release Timeline

Releases

Version Type Release date
4.0.2 Stable Nov 6, 2025
4.0.1 Stable Oct 15, 2025
4.0.0 Stable Oct 13, 2025
4.0.x-dev Dev Oct 13, 2025