PHPackages                             cinghie/yii2-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. cinghie/yii2-paypal

ActiveYii2-extension[Payment Processing](/categories/payments)

cinghie/yii2-paypal
===================

Yii2 Paypal to manage Paypal Payments on your Yii 2 project

0.2.4(6y ago)32.4k↓66.7%6[1 issues](https://github.com/cinghie/yii2-paypal/issues)BSD-3-ClausePHPPHP &gt;=5.5.0

Since Jul 8Pushed 2y ago2 watchersCompare

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

READMEChangelog (5)Dependencies (7)Versions (6)Used By (0)

Yii2 PayPal
===========

[](#yii2-paypal)

[![License](https://camo.githubusercontent.com/000d0075a2a84176bfee7fd10c3e7d30a96f3d5bd242a0b825be3373b1cd67f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63696e676869652f796969322d70617970616c2e737667)](https://camo.githubusercontent.com/000d0075a2a84176bfee7fd10c3e7d30a96f3d5bd242a0b825be3373b1cd67f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63696e676869652f796969322d70617970616c2e737667)[![Latest Stable Version](https://camo.githubusercontent.com/8a4cc1600aed0c642a8ebee51c50d66109caf583dafcf38841be55c3e006ae26/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f63696e676869652f796969322d70617970616c2e737667)](https://camo.githubusercontent.com/8a4cc1600aed0c642a8ebee51c50d66109caf583dafcf38841be55c3e006ae26/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f63696e676869652f796969322d70617970616c2e737667)[![Latest Release Date](https://camo.githubusercontent.com/deeba0a515b0450c640c5bead6b10b78d992e88394c582bb70da96a4278f8f58/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f63696e676869652f796969322d70617970616c2e737667)](https://camo.githubusercontent.com/deeba0a515b0450c640c5bead6b10b78d992e88394c582bb70da96a4278f8f58/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f63696e676869652f796969322d70617970616c2e737667)[![Latest Commit](https://camo.githubusercontent.com/38b33f34de7556f4c0359feea75c61984f547a34600856a27f3c1b89978e606b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f63696e676869652f796969322d70617970616c2e737667)](https://camo.githubusercontent.com/38b33f34de7556f4c0359feea75c61984f547a34600856a27f3c1b89978e606b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f63696e676869652f796969322d70617970616c2e737667)[![Total Downloads](https://camo.githubusercontent.com/2e3e05d6f41768e999a28fa1b61d0fd90cbdf51499fdeef62d74f1c0affee4df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63696e676869652f796969322d70617970616c2e737667)](https://packagist.org/packages/cinghie/yii2-paypal)

Yii2 PayPal Extension to manage:

- PayPal Payments:
- BrainTree Payments (PayPal Service):
- HyperWallet Payments (PayPal Service):

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require cinghie/yii2-paypal "@dev"

```

or add this line to the require section of your `composer.json` file.

```
"cinghie/yii2-paypal": "@dev"

```

PayPal
------

[](#paypal)

### Get credentials

[](#get-credentials)

1. Log into Dashboard and type your PayPal business account email and password.
2. In the REST API apps section, click Create App. The purpose of this app is to generate your credentials.
3. Type a name for your app and click Create App. The page shows your sandbox app information, which includes your credentials.
    Note: To show your live app information, toggle to Live.
4. Copy and save the client ID and secret for your sandbox app.
5. Review your app details and save your app.

### Create sandbox accounts

[](#create-sandbox-accounts)

1. Log into Dashboard and type your PayPal business account email and password.
    Note: If you do not have a business account, click Sign Up.
2. Under Sandbox, click Accounts and click Create Account.
3. To create the buyer account, select the personal account type.
    Type these required and any optional fields and click Create Account:

    - Email Address: A fake or valid email address.
        If you use a valid address, you receive email notifications when you run test transactions
    - Password: An easy-to-remember password, such as 12345678
    - PayPal Balance: A high amount, such as 5000
4. To create the merchant account, select the business account type, type account information, and click Create Account

### Documentation

[](#documentation)

Documentation:
Sample:
Sandbox:
SDK PHP:
Support:
Wiki:

Configuration
-------------

[](#configuration)

Add in your common configuration file:

```
use cinghie\paypal\components\Paypal as PaypalComponent;
use cinghie\paypal\Paypal as PaypalModule;

'components' => [

    'paypal' => [
    	'class'        => 'cinghie\paypal\components\Paypal',
    	'clientId'     => 'YOUR_CLIENT_ID',
    	'clientSecret' => 'YOUR_CLIENT_SECRET',
    	'isProduction' => false,
    	'config' => [
    		'mode' => 'sandbox', // 'sandbox' (development mode) or 'live' (production mode)
    	]
    ]

],

'modules' => [

    'paypal' => [
    	'class' => PaypalModule::class,
    	'paypalRoles' => ['admin'],
    	'showTitles' => false,
    ]

]

```

- clientid =&gt; your PayPal clientId
- clientSecret =&gt; your PayPal clientSecret
- isProduction =&gt; set yes if your site is on Production Mode, false otherwise
- mode =&gt; set 'sandbox' if your site is on Development Mode, or 'live' on Production Mode

You can set advanced settings in config array:

```
'config' => [
	'mode' => 'sandbox', // 'sandbox' (development mode) or 'live' (production mode)
	'http.ConnectionTimeOut' => 30,
	'http.Retry' => 1,
	'log.LogEnabled' => YII_DEBUG ? 1 : 0,
	'log.FileName' => '@runtime/logs/paypal.log',
	'log.LogLevel' => 'ERROR',
],

```

Add in your configuration file, in module section:

```
'paypal' => [
	'class' => 'cinghie\paypal\Paypal',
	'paypalRoles' => ['admin'],
	'showTitles' => false,
],

```

Add in your backend configuration file:

```
use cinghie\paypal\filters\BackendFilter as PaypalBackendFilter;

'modules' => [

    'paypal' => [
        'as backend' => PaypalBackendFilter::class,
    ],

]

```

Add in your frontend configuration file:

```
use cinghie\paypal\filters\FrontendFilter as PaypalFrontendFilter;

'modules' => [

    'paypal' => [
        'as backend' => PaypalBackendFilter::class,
    ],

]

```

BrainTreee Configuration
------------------------

[](#braintreee-configuration)

Add in your common configuration file:

```
use cinghie\paypal\components\Braintree as BraintreeComponent;

'braintree' => [
	'class' => BraintreeComponent::class,
	'environment' => 'sandbox',
	'merchantId' => 'your_merchant_id',
	'publicKey' => 'your_public_key',
	'privateKey' => 'your_private_key'
],

```

HyperWallet Configuration
-------------------------

[](#hyperwallet-configuration)

Add in your common configuration file:

```
use cinghie\paypal\components\Hyperwallet as HyperwalletComponent;

'hyperwallet' => [
	'class' => HyperwalletComponent::class,
	'username' => 'HYPERWALLET_SERVER',
	'password' => 'HYPERWALLET_PASSWORD',
	'token' => 'HYPERWALLET_PROGRAM_TOKEN',
	'server' => 'https://sandbox.hyperwallet.com'
],

```

Create database schema
----------------------

[](#create-database-schema)

Run the following command:

```
$ php yii migrate/up --migrationPath=@vendor/cinghie/yii2-paypal/migrations

```

Use Component
-------------

[](#use-component)

```
\Yii::$app->braintree;
\Yii::$app->hyperwallet;
\Yii::$app->paypal;

```

Use Demo (Only in Sandbox mode)
-------------------------------

[](#use-demo-only-in-sandbox-mode)

```
$demo = new \cinghie\paypal\models\Demo();
$demo->payByCreditCardDemo();
$demo->payByPaypalDemo();

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.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 ~355 days

Total

5

Last Release

2541d ago

PHP version history (2 changes)v0.0.1PHP &gt;=5.3.0

0.2.2PHP &gt;=5.5.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/cfedb99c8fcbaf668c4f9779d341997b84029673eda224241b11732981cbc8b2?d=identicon)[cinghie](/maintainers/cinghie)

---

Top Contributors

[![cinghie](https://avatars.githubusercontent.com/u/2445152?v=4)](https://github.com/cinghie "cinghie (111 commits)")[![valexus1](https://avatars.githubusercontent.com/u/7592441?v=4)](https://github.com/valexus1 "valexus1 (7 commits)")

---

Tags

paymentspaypalyii2 paypalyii2 paymentsyii2 paypal payments

### Embed Badge

![Health badge](/badges/cinghie-yii2-paypal/health.svg)

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

###  Alternatives

[aktive_merchant/aktive_merchant

Aktive-Merchant provides a common interface to process payments using multiple gateways.

15036.8k](/packages/aktive-merchant-aktive-merchant)[tomatophp/filament-payments

Manage your payments inside FilamentPHP app with multi payment gateway integration

542.3k](/packages/tomatophp-filament-payments)

PHPackages © 2026

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