PHPackages                             psr18-adapter/stripe-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. psr18-adapter/stripe-php

ActiveLibrary[HTTP &amp; Networking](/categories/http)

psr18-adapter/stripe-php
========================

1.1(2mo ago)0684MITPHPPHP &gt;=7.4

Since Aug 8Pushed 2mo agoCompare

[ Source](https://github.com/psr18-adapter/stripe-php)[ Packagist](https://packagist.org/packages/psr18-adapter/stripe-php)[ Docs](https://github.com/psr18-adapter/stripe-php)[ RSS](/packages/psr18-adapter-stripe-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (13)Versions (3)Used By (0)

psr18-adapter/stripe-php
========================

[](#psr18-adapterstripe-php)

Install
-------

[](#install)

Via [Composer](https://getcomposer.org/doc/00-intro.md)

```
composer require psr18-adapter/stripe-php
```

Usage
-----

[](#usage)

`stripe-php` library uses singleton for setting the http client, so you will have to call it at some point before you start calling Stripe itself, like so

```
\Stripe\ApiRequestor::setHttpClient(
    new \Psr18Adapter\Stripe\StripePsr18Client($psr18Client, $psr7UriFactory, $psr7RequestFactory)
);
```

### How to set up for dependency injection containers

[](#how-to-set-up-for-dependency-injection-containers)

Singletons like ApiRequestor cannot really be configured for dependency injection containers like `symfony/dependency-injection` without writing extra layer as well. This is why I'm shipping such layer within this package too, in case you are also finding that you need to write such layer, but don't really want to.

It's used like following, if you use YAML and `symfony/dependency-injection`

```
services:
    Stripe\StripeClient:
      factory: ['Psr18Adapter\Stripe\StripeClientAccessor', 'access']
      arguments:
        - !service
          class: Stripe\StripeClient
          arguments:
              $config:
                api_key: '%stripe_secret_key%'
        - !service
          class: Psr18Adapter\Stripe\StripePsr18Client
          autowire: true
```

This should be a replacement of definition of `Stripe\StripeClient` service itself.

Advantage of this approach is that it ensures http client is set in singleton before retrieving `\Stripe\StripeClient` service. This means you can be confident any time StripeClient is fetched from container, it's already configured with your PSR-18 HTTP client.

Licensing
---------

[](#licensing)

MIT license. Please see [License File](LICENSE) for more information.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance88

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2049 days

Total

2

Last Release

60d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.1

1.1PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f56471f595636876f95264fa5c455d611329a4820193f88d22e83a5bd900292?d=identicon)[ostrolucky](/maintainers/ostrolucky)

---

Top Contributors

[![ostrolucky](https://avatars.githubusercontent.com/u/496233?v=4)](https://github.com/ostrolucky "ostrolucky (11 commits)")

---

Tags

psr-18psr-18stripe

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/psr18-adapter-stripe-php/health.svg)

```
[![Health](https://phpackages.com/badges/psr18-adapter-stripe-php/health.svg)](https://phpackages.com/packages/psr18-adapter-stripe-php)
```

###  Alternatives

[elastic/transport

HTTP transport PHP library for Elastic products

2020.6M7](/packages/elastic-transport)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[claude-php/claude-php-sdk

A universal, framework-agnostic PHP SDK for the Anthropic Claude API with PSR compliance

13920.7k2](/packages/claude-php-claude-php-sdk)[art4/requests-psr18-adapter

Use WordPress/Requests as a PSR-18 HTTP client

153.3k](/packages/art4-requests-psr18-adapter)[vultr/vultr-php

The Official Vultr API PHP Wrapper.

2243.9k1](/packages/vultr-vultr-php)[amphp/http-client-psr7

PSR-7 adapter for Amp's HTTP client.

1454.7k4](/packages/amphp-http-client-psr7)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
