PHPackages                             alofoxx/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. [Payment Processing](/categories/payments)
4. /
5. alofoxx/paypalhttp

ActiveLibrary[Payment Processing](/categories/payments)

alofoxx/paypalhttp
==================

v1.0.2(2y ago)06471MITPHP

Since Mar 17Pushed 2y agoCompare

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

READMEChangelog (1)Dependencies (2)Versions (3)Used By (1)

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

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.6% 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

Unknown

Total

1

Last Release

784d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fff6fcbe78d50d86da6eea0e8d4fa5e2450f5e556790347ca8bf5015febbfb4?d=identicon)[alofoxx](/maintainers/alofoxx)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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