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

ActiveLibrary[Payment Processing](/categories/payments)

cloudcogsio/paypal-rest
=======================

PHP SDK for PayPal's REST API with Omnipay compatible Gateway

053PHP

Since Jan 31Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

PayPal REST API
===============

[](#paypal-rest-api)

This package aims implements the [PayPal REST API](https://developer.paypal.com/api/rest/) as an [Omnipay](https://omnipay.thephpleague.com/) compatible gateway. Omnipay's basic gateway operations will be supported, but PayPal endpoints can also be used directly.

### PayPal REST API Coverage

[](#paypal-rest-api-coverage)

##### Only the following APIs are planned.

[](#only-the-following-apis-are-planned)

Checked APIs are completed. Unchecked are under development.

- Add Tracking
- Catalog Products
- Disputes
- Invoicing
- Orders
- Payments
- Payouts
- Subscriptions
- Webhooks

### Installation via Composer

[](#installation-via-composer)

```
$ composer require cloudcogsio/paypal-rest
```

### Usage

[](#usage)

##### 1. Instantiate the gateway class

[](#1-instantiate-the-gateway-class)

The main gateway class is instantiated the same as an Omnipay gateway.

```
use Omnipay\Omnipay;

$gateway = Omnipay::create(\Cloudcogs\PayPal\RestGateway::class);
$gateway
    ->setTestMode(true)
    ->setClientId(#YOUR PAYPAL CLIENT ID)
    ->setSecret(#YOUR PAYPAL SECRET);
```

##### 2. Generate an Access Token.

[](#2-generate-an-access-token)

```
$accessToken = $gateway->GenerateAccessToken()->send();
```

Note, the Access Token is stored in the gateway at this point.

- Management of the Access Token is not *(yet)* included in this library.
- You should implement your own method for saving and reusing the Access Token until expired to avoid hitting PayPal query limits by generating a token for each API call.

You can set a previously retrieved Access Token in the gateway as follows:

```
$gateway->setAccessToken($accessToken);
```

##### 3. Begin making API calls

[](#3-begin-making-api-calls)

```
/**
 * List products
 * https://developer.paypal.com/docs/api/catalog-products/v1/#products_list
 */

// You can pass API parameters directly
$ListProducts = $gateway->ListProducts(['pageNumber' => 1, 'pageSize' => 5]);

// Alternatively, use the API methods (preferred)
$ListProducts = $gateway->ListProducts();
$ListProducts
    ->setPageNumber(1)
    ->setPageSize(5);

$APIResponse = $ListProducts->send();

// Check for a successful response
if($APIResponse->isSuccessful())
{
    $productList = $APIResponse->getProductList();

    // You can iterate over collections
    while(($product = $productList->current()) != null)
    {
        print_r($product);
        $productList->next();
    }
}

// Handle errors
else {
    $error = $APIResponse->getPayPalError();
    print_r($error);
}
```

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/cloudcogsio/paypal-rest/issues), or better yet, fork the library and submit a pull request.

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1d2ff1bf8c9106dd0a4a8962cfc90c3450e288f5bc7abe69f0aa44d8e0761022?d=identicon)[cloudcogs](/maintainers/cloudcogs)

---

Top Contributors

[![cloudcogsio](https://avatars.githubusercontent.com/u/66295280?v=4)](https://github.com/cloudcogsio "cloudcogsio (10 commits)")

### Embed Badge

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

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

###  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)
