PHPackages                             tanatoss/merchant-sdk-php - 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. tanatoss/merchant-sdk-php

ActiveLibrary[Payment Processing](/categories/payments)

tanatoss/merchant-sdk-php
=========================

PayPal Merchant SDK for PHP

v3.6.106(12y ago)06Apache2PHPPHP &gt;=5.3.0

Since Feb 25Pushed 11y ago1 watchersCompare

[ Source](https://github.com/tanatoss/merchant-sdk-php)[ Packagist](https://packagist.org/packages/tanatoss/merchant-sdk-php)[ Docs](https://developer.paypal.com)[ RSS](/packages/tanatoss-merchant-sdk-php/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (18)Used By (0)

PayPal PHP Merchant SDK
=======================

[](#paypal-php-merchant-sdk)

The merchant SDK can be used for integrating with the Express Checkout, Mass Pay, Web Payments Pro APIs.

#### This SDK is deprecated. It is strongly recommended that new implementations use the [PHP Rest SDK](https://github.com/paypal/rest-api-sdk-php)

[](#this-sdk-is-deprecated-it-is-strongly-recommended-that-new-implementations-use-the-php-rest-sdk)

Prerequisites
-------------

[](#prerequisites)

PayPal's PHP Merchant SDK requires

- PHP 5.2 and above
- curl/openssl PHP extensions

Running the sample
------------------

[](#running-the-sample)

To run the bundled sample, first copy the samples folder to your web server root. You will then need to install the SDK as a dependency using either composer (PHP V5.3+ only) or by running a custom installation script provided with the SDK.

If using composer, run `composer update` from the samples folder. Otherwise, run install.php from merchant-sdk-php/samples directory

```

    cd samples
    curl  https://raw.github.com/paypal/merchant-sdk-php/stable/samples/install.php | php
        OR
    php install.php
```

Using the SDK
-------------

[](#using-the-sdk)

To use the SDK,

- Create a composer.json file with the following contents.

```
{
    "name": "me/shopping-cart-app",
    "require": {
        "paypal/merchant-sdk-php":"v2.*"
    }
}
```

- Install the SDK as a dependency using composer or the install.php script.
- Require `vendor/autoload.php` OR `PPBootStrap.php` in your application depending on whether you used composer or the custom installer.
- Choose how you would like to configure the SDK - You can either
    - Create a hashmap containing configuration parameters and pass it to the service object OR
    - Create a `sdk_config.ini` file and set the PP\_CONFIG\_PATH constant to point to the directory where this file exists.
- Instantiate a service wrapper object and a request object as per your project's needs.
- Invoke the appropriate method on the service object.

For example,

```
	// Sets config file path(if config file is used) and registers the classloader
    require("PPBootStrap.php");

	// Array containing credentials and confiuration parameters. (not required if config file is used)
	$config = array(
       'mode' => 'sandbox',
       'acct1.UserName' => 'jb-us-seller_api1.paypal.com',
       'acct1.Password' => 'WX4WTU3S8MY44S7F'
       .....
    );

    // Create request details
    $itemAmount = new BasicAmountType($currencyId, $amount);
	$setECReqType = new SetExpressCheckoutRequestType();
	$setECReqType->SetExpressCheckoutRequestDetails = $setECReqDetails;

    // Create request
	$setECReq = new SetExpressCheckoutReq();
	$setECReq->SetExpressCheckoutRequest = $setECReqType;
	......

    // Perform request
	$paypalService = new PayPalAPIInterfaceServiceService($config);
	$setECResponse = $paypalService->SetExpressCheckout($setECReq);

    // Check results
	if(strtoupper($setECResponse->Ack) == 'SUCCESS') {
		// Success
	}
```

Authentication
--------------

[](#authentication)

The SDK provides multiple ways to authenticate your API call.

```
	$paypalService = new PayPalAPIInterfaceServiceService($config);

	// Use the default account (the first account) configured in sdk_config.ini
	$response = $paypalService->SetExpressCheckout($setECReq);

	// Use a specific account configured in sdk_config.ini
	$response = $paypalService->SetExpressCheckout($setECReq, 'jb-us-seller_api1.paypal.com');

	// Pass in a dynamically created API credential object
    $cred = new PPCertificateCredential("username", "password", "path-to-pem-file");
    $cred->setThirdPartyAuthorization(new PPTokenAuthorization("accessToken", "tokenSecret"));
	$response = $paypalService->SetExpressCheckout($setECReq, $cred);
```

SDK Configuration
-----------------

[](#sdk-configuration)

The SDK allows you to configure the following parameters-

- Integration mode (sandbox / live)
- (Multiple) API account credentials.
- HTTP connection parameters
- Logging

Dynamic configuration values can be set by passing a map of credential and config values (if config map is passed the config file is ignored)

```
    $config = array(
       'mode' => 'sandbox',
       'acct1.UserName' => 'jb-us-seller_api1.paypal.com',
       'acct1.Password' => 'WX4WTU3S8MY44S7F'
       .....
    );
	$service  = new PayPalAPIInterfaceServiceService($config);
```

Alternatively, credential and configuration can be loaded from a file.

```
    define('PP_CONFIG_PATH', '/directory/that/contains/sdk_config.ini');
    $service  = new PayPalAPIInterfaceServiceService();
```

You can refer full list of configuration parameters in [wiki](https://github.com/paypal/sdk-core-php/wiki/Configuring-the-SDK) page.

Please refer to the sample config file provided with this bundle for more.

Instant Payment Notification (IPN)
----------------------------------

[](#instant-payment-notification-ipn)

Please refer to the IPN-README in 'samples/IPN' directory.

Troubleshooting
---------------

[](#troubleshooting)

- [Issue with running samples](https://github.com/paypal/merchant-sdk-php/issues/68)

Links
-----

[](#links)

- API Reference -
- If you need help using the SDK, a new feature that you need or have a issue to report, please visit

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~41 days

Recently: every ~29 days

Total

14

Last Release

4282d ago

Major Versions

v2.3.101 → v3.4.1022013-05-28

v2.4.103 → v3.5.1032013-06-11

v2.5.106 → v3.6.1062013-08-22

PHP version history (2 changes)v2.2.98PHP &gt;=5.2.0

v3.4.102PHP &gt;=5.3.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/166b990092208e0ecd5986c4c02738201fa249a19d9dd51132ed2492ea15f39b?d=identicon)[tanatoss](/maintainers/tanatoss)

---

Top Contributors

[![ganeshx](https://avatars.githubusercontent.com/u/644158?v=4)](https://github.com/ganeshx "ganeshx (101 commits)")[![aydiv](https://avatars.githubusercontent.com/u/531806?v=4)](https://github.com/aydiv "aydiv (31 commits)")[![tkanta](https://avatars.githubusercontent.com/u/654936?v=4)](https://github.com/tkanta "tkanta (31 commits)")[![lvairamani](https://avatars.githubusercontent.com/u/1984252?v=4)](https://github.com/lvairamani "lvairamani (25 commits)")[![avidas](https://avatars.githubusercontent.com/u/873597?v=4)](https://github.com/avidas "avidas (17 commits)")[![lathavairamani](https://avatars.githubusercontent.com/u/644422?v=4)](https://github.com/lathavairamani "lathavairamani (14 commits)")[![kumaravel-jayakumar](https://avatars.githubusercontent.com/u/1195567?v=4)](https://github.com/kumaravel-jayakumar "kumaravel-jayakumar (5 commits)")[![diemuzi](https://avatars.githubusercontent.com/u/1476204?v=4)](https://github.com/diemuzi "diemuzi (4 commits)")[![tomwhipple](https://avatars.githubusercontent.com/u/635272?v=4)](https://github.com/tomwhipple "tomwhipple (4 commits)")[![siddick](https://avatars.githubusercontent.com/u/159859?v=4)](https://github.com/siddick "siddick (3 commits)")[![prannamalai](https://avatars.githubusercontent.com/u/1575082?v=4)](https://github.com/prannamalai "prannamalai (2 commits)")[![j0k3r](https://avatars.githubusercontent.com/u/62333?v=4)](https://github.com/j0k3r "j0k3r (1 commits)")[![ppalavilli](https://avatars.githubusercontent.com/u/354338?v=4)](https://github.com/ppalavilli "ppalavilli (1 commits)")[![johnj](https://avatars.githubusercontent.com/u/42193?v=4)](https://github.com/johnj "johnj (1 commits)")[![rglastra](https://avatars.githubusercontent.com/u/497813?v=4)](https://github.com/rglastra "rglastra (1 commits)")[![rodsouto](https://avatars.githubusercontent.com/u/1918738?v=4)](https://github.com/rodsouto "rodsouto (1 commits)")[![jamesrwhite](https://avatars.githubusercontent.com/u/640960?v=4)](https://github.com/jamesrwhite "jamesrwhite (1 commits)")[![carsongregory](https://avatars.githubusercontent.com/u/1385764?v=4)](https://github.com/carsongregory "carsongregory (1 commits)")[![KoichiWada](https://avatars.githubusercontent.com/u/1043491?v=4)](https://github.com/KoichiWada "KoichiWada (1 commits)")

---

Tags

phpsdkpaypal

### Embed Badge

![Health badge](/badges/tanatoss-merchant-sdk-php/health.svg)

```
[![Health](https://phpackages.com/badges/tanatoss-merchant-sdk-php/health.svg)](https://phpackages.com/packages/tanatoss-merchant-sdk-php)
```

###  Alternatives

[cryptonator/merchant-php-sdk

Cryptonator.com Merchant API SDK for PHP

2713.7k](/packages/cryptonator-merchant-php-sdk)

PHPackages © 2026

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