PHPackages                             paypal/paypalhttp - 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. paypal/paypalhttp

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

paypal/paypalhttp
=================

1.0.1(4y ago)519.8M↓17.3%25[1 issues](https://github.com/paypal/paypalhttp_php/issues)10MITPHPCI failing

Since Sep 13Pushed 8mo ago10 watchersCompare

[ Source](https://github.com/paypal/paypalhttp_php)[ Packagist](https://packagist.org/packages/paypal/paypalhttp)[ RSS](/packages/paypal-paypalhttp/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (16)Used By (10)

Deprecation Notice:
===================

[](#deprecation-notice)

This SDK is deprecated; you can continue to use it, but no new features or support requests will be accepted. An integration with [the new Server SDK](https://github.com/paypal/PayPal-Server-SDKs) is recommended. Review the [docs](https://developer.paypal.com/serversdk/http/getting-started/how-to-get-started/) for details.

PayPal HttpClient
-----------------

[](#paypal-httpclient)

PayPalHttp is a generic HTTP Client.

In it's simplest form, an [`HttpClient`](lib/PayPalHttp/HttpClient.php) exposes an `execute` method which takes an [HTTP request](lib/PayPalHttp/HttpRequest.php), executes it against the domain described in an [Environment](lib/PayPalHttp/Environment.php), and returns an [HTTP response](lib/PayPalHttp/HttpResponse.php).

### Environment

[](#environment)

An [`Environment`](./lib/PayPalHttp/environment.rb) describes a domain that hosts a REST API, against which an `HttpClient` will make requests. `Environment` is a simple interface that wraps one method, `baseUrl`.

```
$env = new Environment('https://example.com');
```

### Requests

[](#requests)

HTTP requests contain all the information needed to make an HTTP request against the REST API. Specifically, one request describes a path, a verb, any path/query/form parameters, headers, attached files for upload, and body data.

### Responses

[](#responses)

HTTP responses contain information returned by a server in response to a request as described above. They are simple objects which contain a status code, headers, and any data returned by the server.

```
$request = new HttpRequest("/path", "GET");
$request->body[] = "some data";

$response = $client->execute($req);

$statusCode = $response->statusCode;
$headers = $response->headers;
$data = $response->result;
```

### Injectors

[](#injectors)

Injectors are blocks that can be used for executing arbitrary pre-flight logic, such as modifying a request or logging data. Injectors are attached to an `HttpClient` using the `addInjector` method.

The `HttpClient` executes its injectors in a first-in, first-out order, before each request.

```
class LogInjector implements Injector
{
    public function inject($httpRequest)
    {
        // Do some logging here
    }
}

$logInjector = new LogInjector();
$client = new HttpClient($environment);
$client->addInjector($logInjector);
...
```

### Error Handling

[](#error-handling)

`HttpClient#execute` may throw an `Exception` if something went wrong during the course of execution. If the server returned a non-200 response, [IOException](lib/PayPalHttp/IOException.php) will be thrown, that will contain a status code and headers you can use for debugging.

```
try
{
    $client->execute($req);
}
catch (HttpException $e)
{
    $statusCode = $e->response->statusCode;
    $headers = $e->response->headers;
    $body = $e->response->result;
}
```

License
-------

[](#license)

PayPalHttp-PHP is open source and available under the MIT license. See the [LICENSE](./LICENSE) file for more information.

Contributing
------------

[](#contributing)

Pull requests and issues are welcome. Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for more details.

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance41

Moderate activity, may be stable

Popularity59

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 75% 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 ~146 days

Recently: every ~332 days

Total

11

Last Release

1707d ago

Major Versions

0.3.0 → 1.0.02019-11-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/dcc8e719eed09b6c6b9c4763a8410175af723aa2049a3e65d8015e200649b571?d=identicon)[paypal](/maintainers/paypal)

---

Top Contributors

[![braintreeps](https://avatars.githubusercontent.com/u/200407?v=4)](https://github.com/braintreeps "braintreeps (24 commits)")[![ganeshramc](https://avatars.githubusercontent.com/u/15274817?v=4)](https://github.com/ganeshramc "ganeshramc (2 commits)")[![demerino](https://avatars.githubusercontent.com/u/7817434?v=4)](https://github.com/demerino "demerino (1 commits)")[![franmomu](https://avatars.githubusercontent.com/u/720690?v=4)](https://github.com/franmomu "franmomu (1 commits)")[![Dani-Kirby](https://avatars.githubusercontent.com/u/58542682?v=4)](https://github.com/Dani-Kirby "Dani-Kirby (1 commits)")[![HDLahlou](https://avatars.githubusercontent.com/u/30755392?v=4)](https://github.com/HDLahlou "HDLahlou (1 commits)")[![senenh](https://avatars.githubusercontent.com/u/5528076?v=4)](https://github.com/senenh "senenh (1 commits)")[![tiffanyrzhou](https://avatars.githubusercontent.com/u/13946076?v=4)](https://github.com/tiffanyrzhou "tiffanyrzhou (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paypal-paypalhttp/health.svg)

```
[![Health](https://phpackages.com/badges/paypal-paypalhttp/health.svg)](https://phpackages.com/packages/paypal-paypalhttp)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78026.4M414](/packages/react-http)[php-http/curl-client

PSR-18 and HTTPlug Async client with cURL

48347.0M384](/packages/php-http-curl-client)[smi2/phpclickhouse

PHP ClickHouse Client

84310.1M71](/packages/smi2-phpclickhouse)

PHPackages © 2026

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