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

Abandoned → [https://github.com/thephpleague/omnipay-paypal](/?search=https%3A%2F%2Fgithub.com%2Fthephpleague%2Fomnipay-paypal)ArchivedLibrary[Payment Processing](/categories/payments)

clippings/omnipay-paypal
========================

Rest API paypal processor for Omnipay

0.2.0(11y ago)565.3k2[1 issues](https://github.com/clippings/omnipay-paypal/issues)BSD-3-ClausePHP

Since Oct 17Pushed 7y ago26 watchersCompare

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

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

Omnipay: Paypal
===============

[](#omnipay-paypal)

**Paypal REST driver for the Omnipay PHP payment processing library**

[![Build Status](https://camo.githubusercontent.com/9d5f2c339c8abcb162b4bc419551ff94a681397d15ad616198bce2b0cbb55213/68747470733a2f2f7472617669732d63692e6f72672f636c697070696e67732f6f6d6e697061792d70617970616c2e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/clippings/omnipay-paypal)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/3f30be9f640f57f4aac1950d2a67872d2e60a47049024b019e31776f2d147934/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636c697070696e67732f6f6d6e697061792d70617970616c2f6261646765732f7175616c6974792d73636f72652e706e67)](https://scrutinizer-ci.com/g/clippings/omnipay-paypal/)[![Code Coverage](https://camo.githubusercontent.com/6b430c8cecf29f8dc96c31bab75d8d47cb944e643b73cf4dcebe619d2451888c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636c697070696e67732f6f6d6e697061792d70617970616c2f6261646765732f636f7665726167652e706e67)](https://scrutinizer-ci.com/g/clippings/omnipay-paypal/)[![Latest Stable Version](https://camo.githubusercontent.com/2b177b2ca364e7a6f69c702fec3d31e6875cee55a9d3ea315dbeb483eb057f0c/68747470733a2f2f706f7365722e707567782e6f72672f636c697070696e67732f6f6d6e697061792d70617970616c2f762f737461626c652e706e67)](https://packagist.org/packages/clippings/omnipay-paypal)

[Omnipay](https://github.com/omnipay/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements eMerchantPay support for Omnipay.

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

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file:

```
{
    "require": {
        "clippings/omnipay-paypal": "~0.1"
    }
}
```

And run composer to update your dependencies:

```
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

```

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

[](#basic-usage)

The following gateways are provided by this package:

- PaypalRest

For general usage instructions, please see the main [Omnipay](https://github.com/omnipay/omnipay)repository.

In order to use this gateway, you need to provide apiKey and clientId.

```
$gateway = Omnipay::create('PaypalRest');
$gateway->setClientId('abc123');
$gateway->setSecret('abc123');
```

For a successful purchase you need to provide `amount`,`currency`:

```
$purchase = $gateway->purchase(array(
    'currency' => 'GBP',
    'amount' => '15.00',
    'description' => 'This is a purchase',
));
```

Funding methods
---------------

[](#funding-methods)

You can use 3 different methods for paying for purchases

**Paypal Redirect**

If you do not provide any payment methods, purchase() method will generate a redirect response.

```
$purchase = $gateway->purchase(array(
    'currency' => 'GBP',
    'amount' => '15.00',
    'description' => 'This is a purchase',
    'redirectUrl' => 'http://example.com/completed',
    'cancelUrl' => 'http://example.com/cancel',
));

$response = $purchase->send();

// redirect to $response->getRedirectUrl()
$response->redirect();
$key = $response->getTransactionReference();

// You'll need to pass $key as well as "payerid" query parameter that you'll get from paypal redirecting back to your site

$completePurchase = $gateway->completePurchase(array(
    'transactionReference' => $key,
    'payerId' => $_GET['PAYERID'],
));

$response2 = $completePurchase->send();
```

**Credit card reference**

You can store user's credit cards within paypal's vault, and use a reference to that for purchases.

```
$createCard = $gateway->createCard(array(
    'card' => ...,
    'payerId' => 'payer id',
));

$response = $createCard->send();
$cardId = $response->getTransactionReference();

$purchase = $gateway->purchase(array(
    'currency' => 'GBP',
    'amount' => '15.00',
    'cardReference' => $cardId,
));

$response = $purchase->send();
```

**Directly with a credit card**

```
$purchase = $gateway->purchase(array(
    'currency' => 'GBP',
    'amount' => '15.00',
    'card' => ...,
));

$response = $purchase->send();
```

Authorization
-------------

[](#authorization)

Authorisation, capture and void are supported too. It works the same way as purchase, but you'll need to "capture" or "void" afterwords

```
$authorise = $gateway->authorise(array(
    'currency' => 'GBP',
    'amount' => '15.00',
    'card' => ...,
));

$response = $authorise->send();
$id = $response->getTransactionReference();

$capture = $gateway->capture(array(
    'transactionReference' => $id,
    'amount' => '15.00',
));

$capture->send();

// Or

$capture = $gateway->void(array(
    'transactionReference' => $id,
));

$capture->send();
```

Refund
------

[](#refund)

```
$refund = $gateway->refund(array(
    'transactionReference' => $id,
));

$refund->send();

// If you are refunding a capture
$refund = $gateway->refund(array(
    'transactionReference' => $id,
    'type' => 'capture'
));

$refund->send();

// Partial refund
$refund = $gateway->refund(array(
    'transactionReference' => $id,
    'amount' => '10.00'
    'currency' => 'GBP'
));

$refund->send();

```

Credit Card Vault
-----------------

[](#credit-card-vault)

createCard, updateCard and deleteCard are supported too.

```
$createCard = $gateway->createCard(array(
    'card' => ...,
    'payerId' => '123123' // Optional, if set, will be required when referencing for a purchase later
));

$response = $createCard->send();
$cardReference = $response->getTransactionReference();

$updateCard = $gateway->updateCard(array(
    'card' => ...,
));

$deleteCard = $gateway->deleteCard(array(
    'card' => ...,
));
```

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 want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

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

License
-------

[](#license)

Copyright (c) 2014, Clippings Ltd. Developed by Ivan Kerin

Under BSD-3-Clause license, read LICENSE file.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% 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 ~17 days

Total

2

Last Release

4207d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/506129?v=4)[Harry Dobrev](/maintainers/hkdobrev)[@hkdobrev](https://github.com/hkdobrev)

![](https://avatars.githubusercontent.com/u/4113307?v=4)[Danail Kyosev](/maintainers/dkyosev)[@dkyosev](https://github.com/dkyosev)

![](https://avatars.githubusercontent.com/u/7592650?v=4)[Evstati Zarkov](/maintainers/EZarkov)[@EZarkov](https://github.com/EZarkov)

![](https://avatars.githubusercontent.com/u/745771?v=4)[Filip Georgiev](/maintainers/phgeorgiev)[@phgeorgiev](https://github.com/phgeorgiev)

![](https://avatars.githubusercontent.com/u/490439?v=4)[Zdravko Evstatiev](/maintainers/zedevs)[@zedevs](https://github.com/zedevs)

---

Top Contributors

[![ivank](https://avatars.githubusercontent.com/u/4976?v=4)](https://github.com/ivank "ivank (12 commits)")[![hkdobrev](https://avatars.githubusercontent.com/u/506129?v=4)](https://github.com/hkdobrev "hkdobrev (5 commits)")[![dkyosev](https://avatars.githubusercontent.com/u/4113307?v=4)](https://github.com/dkyosev "dkyosev (2 commits)")[![benrolfe](https://avatars.githubusercontent.com/u/474175?v=4)](https://github.com/benrolfe "benrolfe (1 commits)")[![orthographic-pedant](https://avatars.githubusercontent.com/u/14522744?v=4)](https://github.com/orthographic-pedant "orthographic-pedant (1 commits)")

### Embed Badge

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

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

###  Alternatives

[league/omnipay

Omnipay payment processing library

6.1k9.7M166](/packages/league-omnipay)[silverstripe/silverstripe-omnipay

SilverStripe Omnipay Payment Module

38106.0k15](/packages/silverstripe-silverstripe-omnipay)

PHPackages © 2026

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