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

ActiveLibrary[Payment Processing](/categories/payments)

emirazaiez/paypal
=================

Simple script which use paypal api svn on php

3111PHP

Since Nov 6Pushed 10y ago1 watchersCompare

[ Source](https://github.com/EmirAzaiez/paypal-api-nvp-php)[ Packagist](https://packagist.org/packages/emirazaiez/paypal)[ RSS](/packages/emirazaiez-paypal/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Paypal NVP Api
==============

[](#paypal-nvp-api)

This php class will simply consume the paypal NVP Api for make a simple payment.

### Installation

[](#installation)

Add this line into require in your composer.json:

```
composer require emirazaiez/paypal
```

then add this line to your php file (Or not if you use a framework)

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

You can get all informations about the paypal API and the paypal Configuration in this page : [Paypal Developer](https://developer.paypal.com/)

### A few examples: (You can also check sample.php)

[](#a-few-examples-you-can-also-check-samplephp)

This is just an exemple, it's better if for each "function" you do a route

Simple make a call request to the API for get a paypal payment URL : (route can be something like : /paypal/checkout)

```
 'sandbox', // You can provide 'prod' for use the real paypal service
    'user' => '', // You can get it from paypal service
    'password' => '', // You can get it from paypal service
    'signature' => '', // You can get it from paypal service
    'lang' => 'EN'
);

$productConfig = array(
    'price' => 5,
    'currency' => 'USD',
    'description' => 'My app subscription for 1 month', //Which will be show on the paypal payment page
    'logo' => 'http://creativebits.org/files/500px-Apple_Computer_Logo.svg_.png', //Logo of your company
    'returnURL' => 'http://myweb.com/paypal/return', //The return url will be passed to paypal, this url will be call by paypal when the transfere will be done
    'cancelURL' => 'http://myweb.com/paypal/cancel', //The return url will be passed to paypal, this url will be call when the user cancel the payment
    'transferData' => array('productID' => '1', 'quantity' => '1month') //Those data arn't used by paypal, you can put whatever you want. Those data will be avaible on success of the "return url" called by paypal (You can only use this if you start the session)
);

$paypal = new CheckoutManager($paypalConfig['mode'], $paypalConfig['user'], $paypalConfig['password'], $paypalConfig['signature'], $paypalConfig['lang']);

$paypal->requestExpressCheckout($productConfig['price'], $productConfig['currency'], $productConfig['description'], $productConfig['logo'], $productConfig['returnURL'], $productConfig['cancelURL'])
       ->setTransferData($productConfig['transferData'])
       ->execute(
        function($paypalCheckoutURL,$success) {
            //Put your own logic here
            //You can redirect the user directly to paypal checkout shop :
            header("Location: " . $paypalCheckoutURL);
        },
        function($errors) {
            //Put your own logic here
        });
```

Simple return of paypal API : (route can be something like : /paypal/return)

```
requestExpressCheckoutPayment($_GET['token'], $_GET['PayerID'])
       ->execute(
        function($transferedData, $paypalUser, $success) {
            //Put your own logic here (Will be some db call for save everything)
        },
        function($errors) {
            //Put your own logic here
        });
```

Cancel payment : (route can be something like : /paypal/cancel)

```
requestExpressCheckoutDetails($_GET['token'])
       ->execute(
        function($transferedData, $paypalUser) {
            //Put your own logic here
        },
        function($errors) {
            //Put your own logic here
        });
```

### Authors

[](#authors)

[Emir Azaiez](https://github.com/EmirAzaiez/)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

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/17df525ccc44f22cfa0f5629ba2322223337c4fda8a95bb30fbc778fb1d2de3b?d=identicon)[EmirAzaiez](/maintainers/EmirAzaiez)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.2k](/packages/msilabs-bkash)[patryqhyper/polish_payments_api

Library for polish payment providers

141.6k](/packages/patryqhyper-polish-payments-api)

PHPackages © 2026

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