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

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

srmklive/paypal
===============

Laravel plugin For Processing Payments Through Paypal Express Checkout. Can Be Used Independently With Other Applications.

3.0.40(1y ago)1.1k3.8M—5.3%339[11 issues](https://github.com/srmklive/laravel-paypal/issues)[3 PRs](https://github.com/srmklive/laravel-paypal/pulls)20MITPHPPHP &gt;=7.2|^8.0CI failing

Since Oct 16Pushed 1mo ago30 watchersCompare

[ Source](https://github.com/srmklive/laravel-paypal)[ Packagist](https://packagist.org/packages/srmklive/paypal)[ RSS](/packages/srmklive-paypal/feed)WikiDiscussions v3.0 Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (116)Used By (20)

Laravel PayPal
==============

[](#laravel-paypal)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Latest Version on Packagist](https://camo.githubusercontent.com/bfc7fca56181506d35cd8a3baf56b33cc582902b2569352df2feb5d23d800b9f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73726d6b6c6976652f70617970616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/srmklive/paypal)[![Total Downloads](https://camo.githubusercontent.com/6705eddfcf635cd96619af42af565919114226345da076278894cb4a52c0ab75/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73726d6b6c6976652f70617970616c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/srmklive/paypal)[![StyleCI](https://camo.githubusercontent.com/8a5e62babb7ea5db53b430ac433264871cef8879231ee4120ca36f9fb8a3ec24/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f34333637313533332f736869656c643f6272616e63683d76322e30)](https://github.styleci.io/repos/43671533?branch=v2.0)[![Tests](https://github.com/srmklive/laravel-paypal/workflows/TestsV3/badge.svg)](https://github.com/srmklive/laravel-paypal/workflows/TestsV3/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/00cb34904acb2a61ce19f52b3021bcf990ea7d9277a4250b13a229fe896414a6/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f73726d6b6c6976652f6c61726176656c2d70617970616c2f62616467652e7376673f6272616e63683d76332e30)](https://coveralls.io/github/srmklive/laravel-paypal?branch=v3.0)[![Code Quality](https://camo.githubusercontent.com/88d7876bb6bf8f7b686a4e92d9a0ee3b0a8daf0e1751224c51c74193d72209a8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73726d6b6c6976652f6c61726176656c2d70617970616c2f6261646765732f7175616c6974792d73636f72652e706e673f623d76332e30)](https://scrutinizer-ci.com/g/srmklive/laravel-paypal/?branch=v3.0)

- [Documentation](#introduction)
- [Usage](#usage)
- [Support](#support)

Important

Laravel 12 will be the last version supported for v3.0, and package will not be actively maintained moving forward. For Laravel 13+ or PHP 8.2+, you must use the following fork:

Documentation
-------------

[](#documentation)

The documentation for the package can be viewed by clicking the following link:

The old documentation can be found at the following link:

Usage
-----

[](#usage)

Following are some ways through which you can access the paypal provider:

```
// Import the class namespaces first, before using it directly
use Srmklive\PayPal\Services\PayPal as PayPalClient;

$provider = new PayPalClient;

// Through facade. No need to import namespaces
$provider = \PayPal::setProvider();
```

Configuration File
------------------

[](#configuration-file)

The configuration file **paypal.php** is located in the **config** folder. Following are its contents when published:

```
return [
    'mode'    => env('PAYPAL_MODE', 'sandbox'), // Can only be 'sandbox' Or 'live'. If empty or invalid, 'live' will be used.
    'sandbox' => [
        'client_id'         => env('PAYPAL_SANDBOX_CLIENT_ID', ''),
        'client_secret'     => env('PAYPAL_SANDBOX_CLIENT_SECRET', ''),
        'app_id'            => 'APP-80W284485P519543T',
    ],
    'live' => [
        'client_id'         => env('PAYPAL_LIVE_CLIENT_ID', ''),
        'client_secret'     => env('PAYPAL_LIVE_CLIENT_SECRET', ''),
        'app_id'            => env('PAYPAL_LIVE_APP_ID', ''),
    ],

    'payment_action' => env('PAYPAL_PAYMENT_ACTION', 'Sale'), // Can only be 'Sale', 'Authorization' or 'Order'
    'currency'       => env('PAYPAL_CURRENCY', 'USD'),
    'notify_url'     => env('PAYPAL_NOTIFY_URL', ''), // Change this accordingly for your application.
    'locale'         => env('PAYPAL_LOCALE', 'en_US'), // force gateway language  i.e. it_IT, es_ES, en_US ... (for express checkout only)
    'validate_ssl'   => env('PAYPAL_VALIDATE_SSL', true), // Validate SSL when creating api client.
];
```

Override PayPal API Configuration
---------------------------------

[](#override-paypal-api-configuration)

You can override PayPal API configuration by calling `setApiCredentials` method:

```
$config = [
    'mode'    => 'live',
    'live' => [
        'client_id'         => 'PAYPAL_LIVE_CLIENT_ID',
        'client_secret'     => 'PAYPAL_LIVE_CLIENT_SECRET',
        'app_id'            => 'PAYPAL_LIVE_APP_ID',
    ],

    'payment_action' => 'Sale',
    'currency'       => 'USD',
    'notify_url'     => 'https://your-site.com/paypal/notify',
    'locale'         => 'en_US',
    'validate_ssl'   => true,
];
$provider->setApiCredentials($config);
```

Get Access Token
----------------

[](#get-access-token)

After setting the PayPal API configuration by calling `setApiCredentials` method. You need to get access token before performing any API calls

```
$provider->getAccessToken();
```

Set Currency
------------

[](#set-currency)

By default, the currency used is `USD`. If you wish to change it, you may call `setCurrency` method to set a different currency before calling any respective API methods:

```
$provider->setCurrency('EUR');
```

Helper Methods
--------------

[](#helper-methods)

> Please note that in the examples below, the call to `addPlanTrialPricing` is optional and it can be omitted when you are creating subscriptions without trial period.

> `setReturnAndCancelUrl()` is optional. If you set urls you have to use real domains. e.g. localhost, project.test does not work.

### Create Recurring Daily Subscription

[](#create-recurring-daily-subscription)

```
$response = $provider->addProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE')
            ->addPlanTrialPricing('DAY', 7)
            ->addDailyPlan('Demo Plan', 'Demo Plan', 1.50)
            ->setReturnAndCancelUrl('https://example.com/paypal-success', 'https://example.com/paypal-cancel')
            ->setupSubscription('John Doe', 'john@example.com', '2021-12-10');
```

### Create Recurring Weekly Subscription

[](#create-recurring-weekly-subscription)

```
$response = $provider->addProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE')
            ->addPlanTrialPricing('DAY', 7)
            ->addWeeklyPlan('Demo Plan', 'Demo Plan', 30)
            ->setReturnAndCancelUrl('https://example.com/paypal-success', 'https://example.com/paypal-cancel')
            ->setupSubscription('John Doe', 'john@example.com', '2021-12-10');
```

### Create Recurring Monthly Subscription

[](#create-recurring-monthly-subscription)

```
$response = $provider->addProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE')
            ->addPlanTrialPricing('DAY', 7)
            ->addMonthlyPlan('Demo Plan', 'Demo Plan', 100)
            ->setReturnAndCancelUrl('https://example.com/paypal-success', 'https://example.com/paypal-cancel')
            ->setupSubscription('John Doe', 'john@example.com', '2021-12-10');
```

### Create Recurring Annual Subscription

[](#create-recurring-annual-subscription)

```
$response = $provider->addProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE')
            ->addPlanTrialPricing('DAY', 7)
            ->addAnnualPlan('Demo Plan', 'Demo Plan', 600)
            ->setReturnAndCancelUrl('https://example.com/paypal-success', 'https://example.com/paypal-cancel')
            ->setupSubscription('John Doe', 'john@example.com', '2021-12-10');
```

### Create Recurring Subscription with Custom Intervals

[](#create-recurring-subscription-with-custom-intervals)

```
$response = $provider->addProduct('Demo Product', 'Demo Product', 'SERVICE', 'SOFTWARE')
            ->addCustomPlan('Demo Plan', 'Demo Plan', 150, 'MONTH', 3)
            ->setReturnAndCancelUrl('https://example.com/paypal-success', 'https://example.com/paypal-cancel')
            ->setupSubscription('John Doe', 'john@example.com', '2021-12-10');
```

### Create Subscription by Existing Product &amp; Billing Plan

[](#create-subscription-by-existing-product--billing-plan)

```
$response = $this->client->addProductById('PROD-XYAB12ABSB7868434')
    ->addBillingPlanById('P-5ML4271244454362WXNWU5NQ')
    ->setReturnAndCancelUrl('https://example.com/paypal-success', 'https://example.com/paypal-cancel')
    ->setupSubscription('John Doe', 'john@example.com', $start_date);
```

Support
-------

[](#support)

This version supports Laravel 6 or greater.

- In case of any issues, kindly create one on the [Issues](https://github.com/srmklive/laravel-paypal/issues) section.
- If you would like to contribute:
    - Fork this repository.
    - Implement your features.
    - Generate pull request.

###  Health Score

70

—

ExcellentBetter than 100% of packages

Maintenance69

Regular maintenance activity

Popularity69

Solid adoption and visibility

Community44

Growing community involvement

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 87.2% 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 ~33 days

Recently: every ~160 days

Total

115

Last Release

54d ago

Major Versions

1.11.10 → 3.0.312024-05-29

1.11.11 → 2.0.302024-06-19

v2.0.x-dev → 3.0.322024-06-24

3.0.32 → v4.0.x-dev2024-06-24

1.11.12 → v3.0.x-dev2026-03-25

PHP version history (5 changes)v3.0PHP &gt;=7.2

v2.0.0PHP &lt;7.2

3.0.1PHP &gt;=7.2|^8.0

2.0.30PHP ^7.0

v4.0.x-devPHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![srmklive](https://avatars.githubusercontent.com/u/839335?v=4)](https://github.com/srmklive "srmklive (211 commits)")[![matheo-2001](https://avatars.githubusercontent.com/u/62428974?v=4)](https://github.com/matheo-2001 "matheo-2001 (7 commits)")[![otnansirk](https://avatars.githubusercontent.com/u/30102523?v=4)](https://github.com/otnansirk "otnansirk (3 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![jtolj](https://avatars.githubusercontent.com/u/845525?v=4)](https://github.com/jtolj "jtolj (2 commits)")[![ericdowell](https://avatars.githubusercontent.com/u/525506?v=4)](https://github.com/ericdowell "ericdowell (1 commits)")[![ilsyaa](https://avatars.githubusercontent.com/u/76580335?v=4)](https://github.com/ilsyaa "ilsyaa (1 commits)")[![iskandervdh](https://avatars.githubusercontent.com/u/59149083?v=4)](https://github.com/iskandervdh "iskandervdh (1 commits)")[![matheusbenedet](https://avatars.githubusercontent.com/u/55722495?v=4)](https://github.com/matheusbenedet "matheusbenedet (1 commits)")[![Raja-Omer-Mustafa](https://avatars.githubusercontent.com/u/53174353?v=4)](https://github.com/Raja-Omer-Mustafa "Raja-Omer-Mustafa (1 commits)")[![risteacatalin](https://avatars.githubusercontent.com/u/74351332?v=4)](https://github.com/risteacatalin "risteacatalin (1 commits)")[![ronheywood](https://avatars.githubusercontent.com/u/1688121?v=4)](https://github.com/ronheywood "ronheywood (1 commits)")[![sajjadhossainshohag](https://avatars.githubusercontent.com/u/63788037?v=4)](https://github.com/sajjadhossainshohag "sajjadhossainshohag (1 commits)")[![shekenz](https://avatars.githubusercontent.com/u/2657910?v=4)](https://github.com/shekenz "shekenz (1 commits)")[![tomshaw](https://avatars.githubusercontent.com/u/32818?v=4)](https://github.com/tomshaw "tomshaw (1 commits)")[![willcurry](https://avatars.githubusercontent.com/u/11460313?v=4)](https://github.com/willcurry "willcurry (1 commits)")[![btwlouis](https://avatars.githubusercontent.com/u/56355239?v=4)](https://github.com/btwlouis "btwlouis (1 commits)")[![yob-yob](https://avatars.githubusercontent.com/u/25021150?v=4)](https://github.com/yob-yob "yob-yob (1 commits)")[![buzzclue](https://avatars.githubusercontent.com/u/43321373?v=4)](https://github.com/buzzclue "buzzclue (1 commits)")[![dasundev](https://avatars.githubusercontent.com/u/54996800?v=4)](https://github.com/dasundev "dasundev (1 commits)")

---

Tags

ipnlaravel-paypallaravel-pluginpaypalphpprocess-paymentshttprestweb servicepaypallaravel paypal

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[zoonman/pixabay-php-api

PixabayClient is a PHP HTTP client library to access Pixabay's API

3354.7k](/packages/zoonman-pixabay-php-api)[e-moe/guzzle6-bundle

Integrates Guzzle 6 into your Symfony application

11259.2k](/packages/e-moe-guzzle6-bundle)[apoca/laravel-sibs-payments

Laravel library to communicate with SIBS - Open Payment Platform.

342.3k](/packages/apoca-laravel-sibs-payments)

PHPackages © 2026

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