PHPackages                             redfro/verify-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. redfro/verify-paypal

ActiveLibrary

redfro/verify-paypal
====================

PHP class to verify Paypal SDK payments, it verifies both credit card and paypal account transactions using the REST API and Adaptive Payments.

564PHP

Since Jul 31Pushed 11y ago3 watchersCompare

[ Source](https://github.com/redfro/VerifyPaypal)[ Packagist](https://packagist.org/packages/redfro/verify-paypal)[ RSS](/packages/redfro-verify-paypal/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

VerifyPaypal
============

[](#verifypaypal)

*VerifyPaypal is a PHP class to verify Paypal SDK payments, it verifies both credit card and paypal account transactions using the REST API and Adaptive Payments.*

Known Issues
------------

[](#known-issues)

Paypal is currently having an issue with the Rest API in sandbox mode. Testing a credit card will result in an Invalid Resourse ID error. Hopefully this gets fixed soon.

Getting Started
---------------

[](#getting-started)

- Start by cloning VerifyPaypal into your project:

```
git clone https://github.com/redfro/VerifyPaypal.git

```

- Next, provided you have [composer](http://getcomposer.org) installed, run the following command:

```
$ php composer.phar install
```

- This will install the library into a vendor folder. Now add the autoloader to your php files where applicable.

```
require 'VerifyPaypal/vendor/autoload.php';
```

- You need to `use` the PaypalPayment class, so add this directly under the autoloader.

```
use VerifyPaypal\Classes\PaypalPayment;
```

- Now update VerifyPaypalConfig.php `(src/VerifyPaypal/Config/VerifyPaypalConfig.php)` with your paypal information:

```
/*==========  Live Credentials  ==========*/

define('CLIENT_ID', '');
define('SECRET_KEY', '');
define('PAYPAL_ID', '');
define('PAYPAL_PW', '');
define('PAYPAL_SIG', '');
define('RECEIVER_EMAIL', '');

/*==========  Sandbox Credentials  ==========*/

define('CLIENT_ID_SANDBOX', '');
define('SECRET_KEY_SANDBOX', '');
define('PAYPAL_ID_SANDBOX', '');
define('PAYPAL_PW_SANDBOX', '');
define('PAYPAL_SIG_SANDBOX', '');
define('RECEIVER_EMAIL_SANDBOX', '');
```

- Create a new PaypalPayment() and set the environment to either `"sandbox"` or `"live"`:

```
$payment = new PaypalPayment("sandbox");
```

- Pass the JSON sent from the Paypal SDK into verify():

```
$payment->verify($json);
```

The verify() method returns true if the payment is valid, false if not.

- You can check the status returned from Paypal using:

```
$payment->getStatus();
```

Example
-------

[](#example)

```
require 'vendor/autoload.php';
use VerifyPaypal\Classes\PaypalPayment;

$payment = new PaypalPayment("sandbox");
$validPayment = $payment->verify($json);

if ($validPayment)
{
	// do something with valid payment
}

echo $payment->getStatus();  // check status message from paypal
```

Testing
-------

[](#testing)

You can test if VerifyPaypal is installed correctly by running the following command.

```
$ php tests/test.php
```

This should return "VerifyPaypal was installed correctly!".

License
-------

[](#license)

VerifyPaypal is licensed under the MIT license. See the LICENSE file for more details.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/085084e03e947fbeedaf876af5994af1bfabedd7e6359b3b5861cf72c3a256bf?d=identicon)[redfro](/maintainers/redfro)

---

Top Contributors

[![hustmandotcom](https://avatars.githubusercontent.com/u/33296214?v=4)](https://github.com/hustmandotcom "hustmandotcom (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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