PHPackages                             mrpck/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. [HTTP &amp; Networking](/categories/http)
4. /
5. mrpck/paypal

ActiveLibrary[HTTP &amp; Networking](/categories/http)

mrpck/paypal
============

This package uses the new paypal rest api.

1.0.0(5y ago)07MITPHPPHP &gt;=5.4.0

Since Feb 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mrpck/paypal)[ Packagist](https://packagist.org/packages/mrpck/paypal)[ Docs](https://packagist.org/packages/mrpck/paypal)[ RSS](/packages/mrpck-paypal/feed)WikiDiscussions main Synced 6d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

paypal
======

[](#paypal)

The PayPal Class Library is a high level wrapper around the PayPal REST API.

Install
-------

[](#install)

Copy the files under `src/` to your program

OR

```
composer require mrpck/paypal 1.0.0
```

Usage
-----

[](#usage)

```
use Mrpck\PayPal\PayPal;

$PAYPAL_CLIENT_ID='AW7a1Xvdfkdfpdprkspq7mJZwDRNNFxYSRxRTApuiuiuiuitT0Gq5';
$PAYPAL_SECRET='Eghgh4h2MiSGghghgh7DCviixQ7WMrbBfE7cRfo4KLqghghgUJKWYghghgh8HpK5eGK';
$sandbox = false;

$p = new PayPal($PAYPAL_CLIENT_ID, $PAYPAL_SECRET, $sandbox);

echo 'IsConnected: '.$p->IsConnected().'';

$data = array(
	"name" => "Video Streaming",
	"description" => "Video streaming service",
	"type" => "DIGITAL",
	"category" => "ONLINE_SERVICES",
	"image_url" => "https://packagist.org/streaming.jpg",
	"home_url"  => "https://packagist.org/home"
);

// 1. Create a product
$productId = $p->CreateProduct($data);
echo 'Product: '.$productId.'';

$data = array(
	"product_id" => $productId,
	"name"   => "Affiliazione DAY",
	"status" => "ACTIVE",
	"description" => "Video streaming service",
	"billing_cycles" => array(
		array(
			"pricing_scheme"  => array(
				"fixed_price" => array(
					"currency_code" => "EUR",
					"value" => "10.90"
				)
			),
			"frequency" => array(
				"interval_unit"  => "DAY",
				"interval_count" => 1
			),
			"tenure_type" => "REGULAR",
			"sequence"    => 1,
			"total_cycles" => 0
		)
	),
	"payment_preferences" => array(
		"auto_bill_outstanding" => false,
		"payment_failure_threshold" => 0
	),
	"quantity_supported" => false
);

// 2. Create a plan
$planId = $p->CreatePlan($data);
echo 'Plan: '.$planId.'';

$data = array(
	'plan_id'  => $planId,
	'quantity' => '1',
	'application_context' => array(
	  'brand_name' => 'Packagist',
	  'shipping_preference' => 'NO_SHIPPING',
	  'return_url' => 'https://packagist.org/account/myads',
	  'cancel_url' => 'https://packagist.org/premium'
	)
);

// 3. Create a subscription
$subId = $p->CreateSubscription($data);
echo 'Subscription: '.$subId.'';

// ...
echo 'GetProductById: '.$p->GetProductById($productId).'';

echo 'GetPlanById: '.$p->GetPlanById($planId).'';

echo 'GetPlanBySubId: '.$p->GetPlanBySubId($subId).'';

echo 'GetSubscription: '.$p->GetSubscription($subId).'';

echo 'Status: '.$p->GetStatus($subId).'';

echo 'IsActive: '.$p->IsActive($subId).'';
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Unknown

Total

1

Last Release

1911d ago

### Community

Maintainers

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

---

Top Contributors

[![mrpck-dev](https://avatars.githubusercontent.com/u/200479216?v=4)](https://github.com/mrpck-dev "mrpck-dev (7 commits)")

---

Tags

apirestpaymentpaypal

### Embed Badge

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

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

###  Alternatives

[angelleye/paypal-php-library

PHP wrapper for PayPal APIs

243440.9k](/packages/angelleye-paypal-php-library)[andrewnovikof/omnipay-sberbank

Omnipay driver for Sberbank

3214.9k1](/packages/andrewnovikof-omnipay-sberbank)

PHPackages © 2026

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