PHPackages                             p16/paypal-rest-api-client - 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. [API Development](/categories/api)
4. /
5. p16/paypal-rest-api-client

ActiveLibrary[API Development](/categories/api)

p16/paypal-rest-api-client
==========================

PHP Library for accessing PayPal Rest API.

v1.0.0(10y ago)2682MITPHPPHP &gt;=5.6CI failing

Since Aug 13Pushed 10y ago1 watchersCompare

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

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

PHP PayPal REST API Client
==========================

[](#php-paypal-rest-api-client)

[![Build Status](https://camo.githubusercontent.com/7c2a773c6ec32545294cfd26cdf85c01c7d2e84c470b19fe5521368e824ddf41/68747470733a2f2f7472617669732d63692e6f72672f7031362f70617970616c2d726573742d6170692d636c69656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/p16/paypal-rest-api-client) [![Latest Stable Version](https://camo.githubusercontent.com/e7883794f795ccc75c89f985afe79a8fd6aa0925fdba54dfe02d87cfa69b1301/68747470733a2f2f706f7365722e707567782e6f72672f7031362f70617970616c2d726573742d6170692d636c69656e742f762f737461626c652e737667)](https://packagist.org/packages/p16/paypal-rest-api-client) [![Total Downloads](https://camo.githubusercontent.com/0455c1ac5632a0024da18c38af44dc3a9ca1137b9de47afec70974bf4e3fffbc/68747470733a2f2f706f7365722e707567782e6f72672f7031362f70617970616c2d726573742d6170692d636c69656e742f646f776e6c6f6164732e737667)](https://packagist.org/packages/p16/paypal-rest-api-client) [![Latest Unstable Version](https://camo.githubusercontent.com/aa18cdc64d5474d1c95266952893f0c7f07a88a678ac7b44006c46d981f89ffe/68747470733a2f2f706f7365722e707567782e6f72672f7031362f70617970616c2d726573742d6170692d636c69656e742f762f756e737461626c652e737667)](https://packagist.org/packages/p16/paypal-rest-api-client) [![License](https://camo.githubusercontent.com/a3b461b8e1de1a51b9b94f449742d293ea1b0150f44ae8d42e587e45cdf6eb4e/68747470733a2f2f706f7365722e707567782e6f72672f7031362f70617970616c2d726573742d6170692d636c69656e742f6c6963656e73652e737667)](https://packagist.org/packages/p16/paypal-rest-api-client)

This library wants to be a PHP client for the [PayPal REST API](https://developer.paypal.com/docs/api/).

There is an official SDK and you can find it [here](https://github.com/paypal/rest-api-sdk-php).

I tried it and I tried to [contribute on it](https://github.com/p16/rest-api-sdk-php) (the tests were calling the actual paypal sandbox). But I needed a simpler and OOP library, and I did not have the time to contribute as much as I think is needed on the official one, therefore I did this one.

I'm working on a first stable realease that should be out before August 15th.

Feedback, PR and contribution are welcome.

Features
--------

[](#features)

At the moment the only [PayPal REST API](https://developer.paypal.com/docs/api/) calls implemented are:

- Require an access token:
- Create a payment (only with "paypal" and "credit\_card" payment methods):
- Execute a payment:
- Authorize and capture a payment:
- Validation of json schema for payment request body: [Json Schema](http://json-schema.org/), [PHP Json Schema validator](https://github.com/justinrainbow/json-schema), [PayPal REST API objects](https://developer.paypal.com/docs/api/)

Installation
------------

[](#installation)

Run

```
composer require p16/paypal-rest-api-client:1.0.0

```

or edit your composer.json as follow

```
...
    "require": {
        "p16/paypal-rest-api-client": "1.0.0"
        ...
    }
...

```

and then run

```
composer update p16/paypal-rest-api-client

```

Running tests
-------------

[](#running-tests)

Donwload the repository

Run

```
composer install

```

From the root folder run

```
./vendor/bin/phpunit -c .

```

Documentation
-------------

[](#documentation)

**Using the library**

- [Direct payment with paypal method](examples/directPaymentPaypalMethod.md)
- [Direct payment with credit card method](examples/directPaymentCreditCardMethod.md)
- [Payment authorization and capture with paypal method](examples/paymentAuthorizationAndCapturePaypalMethod.md)
- [Payment authorization and capture with credit card method](examples/paymentAuthorizationAndCaptureCreditCardMethod.md)

**PayPal Json schema validation**

A [Json Schema validator](https://github.com/justinrainbow/json-schema) is used to validate a call request body. You can find all the available schema definition [here](src/PayPalRestApiClient/Validator/schema).

**TO-DO for release 1.1.0**

- Move PayPalJsonSchemaValidator into a standalone repo (?)
- Make the builder aware of the PayPalJsonSchemaValidator, so that they can validate what they are building when building from/to json
- Add strict validation to model classes (?)

**TO-DO for release 1.2.0**

- Add ["billing plans"](https://developer.paypal.com/docs/api/#billing-plans-and-agreements) feature

License
-------

[](#license)

Licensed under the [MIT license](http://opensource.org/licenses/MIT)

Read [LICENSE](LICENSE) for more information

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 98.7% 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 ~158 days

Total

4

Last Release

3817d ago

Major Versions

v0.1.2 → v1.0.02015-12-01

PHP version history (3 changes)v0.1.0PHP &gt;=5.4

v0.1.2PHP &gt;=5.5

v1.0.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/202a4fce1e65366ce5e8578cf72fcf74d4764317797ea1348c923b1830c2590e?d=identicon)[p16](/maintainers/p16)

---

Top Contributors

[![p16](https://avatars.githubusercontent.com/u/272483?v=4)](https://github.com/p16 "p16 (74 commits)")[![SamanShafigh](https://avatars.githubusercontent.com/u/5440537?v=4)](https://github.com/SamanShafigh "SamanShafigh (1 commits)")

---

Tags

paypal rest api client

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/p16-paypal-rest-api-client/health.svg)

```
[![Health](https://phpackages.com/badges/p16-paypal-rest-api-client/health.svg)](https://phpackages.com/packages/p16-paypal-rest-api-client)
```

###  Alternatives

[cebe/php-openapi

Read and write OpenAPI yaml/json files and make the content accessable in PHP objects.

49815.4M86](/packages/cebe-php-openapi)[rackspace/php-opencloud

PHP SDK for Rackspace/OpenStack APIs

4495.9M38](/packages/rackspace-php-opencloud)[php-opencloud/openstack

PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi

2292.2M24](/packages/php-opencloud-openstack)[cdaguerre/php-trello-api

Trello API v2 client

255666.7k3](/packages/cdaguerre-php-trello-api)[devizzent/cebe-php-openapi

Read and write OpenAPI yaml/json files and make the content accessable in PHP objects.

379.0M49](/packages/devizzent-cebe-php-openapi)[nfephp-org/sped-cte

API para geração e comunicação da CTe com as SEFAZ autorizadoras.

113227.7k1](/packages/nfephp-org-sped-cte)

PHPackages © 2026

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