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)5110.3M↓53.5%25[1 issues](https://github.com/paypal/paypalhttp_php/issues)10MITPHPCI failing

Since Sep 13Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/paypal/paypalhttp_php)[ Packagist](https://packagist.org/packages/paypal/paypalhttp)[ RSS](/packages/paypal-paypalhttp/feed)WikiDiscussions master Synced 2d 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

53

—

FairBetter than 96% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity60

Solid adoption and visibility

Community28

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

1753d 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

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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