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

ActiveLibrary[Payment Processing](/categories/payments)

descom/omnipay-paypal
=====================

PayPal Orders v2 (REST) driver for Omnipay

v1.0.1(1mo ago)099MITPHPPHP ^8.4CI passing

Since Jul 8Pushed 1mo agoCompare

[ Source](https://github.com/descom-es/omnipay-paypal)[ Packagist](https://packagist.org/packages/descom/omnipay-paypal)[ RSS](/packages/descom-omnipay-paypal/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (2)Dependencies (8)Versions (3)Used By (0)

Omnipay: PayPal
===============

[](#omnipay-paypal)

PayPal Orders v2 (REST) driver for [Omnipay](https://github.com/thephpleague/omnipay).

[![Tests](https://github.com/descom-es/omnipay-paypal/actions/workflows/tests.yml/badge.svg)](https://github.com/descom-es/omnipay-paypal/actions/workflows/tests.yml/badge.svg)[![Analyse](https://github.com/descom-es/omnipay-paypal/actions/workflows/analyse.yml/badge.svg)](https://github.com/descom-es/omnipay-paypal/actions/workflows/analyse.yml/badge.svg)[![Style fix](https://github.com/descom-es/omnipay-paypal/actions/workflows/style-fix.yml/badge.svg)](https://github.com/descom-es/omnipay-paypal/actions/workflows/style-fix.yml/badge.svg)

Implements the current PayPal **Orders v2** API (`/v2/checkout/orders`) with the redirect approval flow: create an order, redirect the buyer to PayPal, capture on return.

Instalation
-----------

[](#instalation)

```
composer require descom/omnipay-paypal
```

Basic Usage
-----------

[](#basic-usage)

### Create purchase request

[](#create-purchase-request)

```
use Omnipay\Omnipay;

$gateway = Omnipay::create('PayPal');

$gateway->initialize([
    'clientId' => 'YOUR_CLIENT_ID',
    'secret'   => 'YOUR_SECRET',
    'testMode' => true, // sandbox
    'currency' => 'EUR',
]);

$response = $gateway->purchase([
    'amount'         => '12.00',
    'currency'       => 'EUR',
    'transactionId'  => 'ORDER-42',
    'description'    => 'My order',
    'returnUrl'      => 'https://shop.test/paypal/return',
    'cancelUrl'      => 'https://shop.test/paypal/cancel',
])->send();

// Redirect the buyer (GET) to the PayPal approval page.
$response->redirect();
```

### Complete purchase request

[](#complete-purchase-request)

On buyer return PayPal appends `?token={orderId}` to your `returnUrl`. Capture the order:

```
$response = $gateway->completePurchase([
    'token' => $_GET['token'],
])->send();

if ($response->isSuccessful()) {
    // $response->getTransactionReference() -> capture id
}
```

Framework integration
---------------------

[](#framework-integration)

This is a framework-agnostic Omnipay driver: it has no Laravel dependency and ships no routes or service providers. The buyer-return endpoint (the URL you set as `returnUrl`) is the host application's responsibility — it should call `completePurchase()` to capture the order and then redirect the buyer back to the storefront.

On the descom platform this return route is provided generically by [`descom/payment-gateway`](https://github.com/descom-es/payment-gateway), so no PayPal-specific glue is required here.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance90

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

49d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/172386961?v=4)[descom](/maintainers/descom)[@Descom](https://github.com/Descom)

---

Top Contributors

[![llorensjj](https://avatars.githubusercontent.com/u/7073372?v=4)](https://github.com/llorensjj "llorensjj (3 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k555.0M2.8k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k832.6k56](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.3M49](/packages/tencentcloud-tencentcloud-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

353.6k](/packages/eslazarev-wildberries-sdk)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.7M10](/packages/chargebee-chargebee-php)[buckaroo/sdk

Buckaroo payment SDK

12247.9k19](/packages/buckaroo-sdk)

PHPackages © 2026

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