Laravel Paypal Integration: Access Paypal API using a Laravel service provider

Recommend this page to a friend!
  Info   Documentation   View files (8)   Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 57 All time: 9,780 This week: 251
Version License PHP version Categories
laravel-paypal 1.0.0Custom (specified...5PHP 5, Web services, Finances
Description Author

This package can access Paypal API using a Laravel service provider.

It can send HTTP requests to the Paypal API to perform several types of operations.

Currently it can retrieve the balance of a given Paypal account, as well the details transactions that were performed with that account in the last days.

Picture of Naif Alshaye
  Performance   Level  
Name: Naif Alshaye <contact>
Classes: 20 packages by
Country: Saudi Arabia Saudi Arabia
Age: ???
All time rank: 21739 in Saudi Arabia Saudi Arabia
Week rank: 84 1 in Saudi Arabia Saudi Arabia
Innovation award
Innovation award
Nominee: 6x


Laravel PayPal Package

To communicate with PayPal API to get current balance and transactions.


composer require naif/laravel-paypal

If your Laravel below 5.5 you need to add service provider and alias to config/app.php


'PayPal' => Naif\LaravelPayPal\Facades\LaravelPayPal::class,


Publish the package config file:

php artisan vendor:publish --provider="Naif\LaravelPayPal\LaravelPayPalServiceProvider"

Configuration will be published at [config/laravel-paypal.php].


Get your API access from PayPal website

Paypal > Profile > Profile and settings > My selling tools > API access > NVP/SOAP API integration (Classic)

Package screenshot

Add these to your .env



use Naif\LaravelPayPal\LaravelPayPal;

$paypal = new LaravelPayPal();

//Get Current Balance

$balance = $paypal->getBalance();

  "balance" => array:5 [?
      "ACK" => "Success"
      "L_AMT0" => "120.62"
      "L_SEVERITYCODE0" => null
      "L_ERRORCODE0" => null
      "L_LONGMESSAGE0" => null

//Get Transactions

$transactions = $paypal->getTransactions();
You can specify the number of days and number of transactions to retreive. Default (7 days, 10 transations)

 "transactions" => array:3 [?
     0 => array:11 [?
       "timestamp" => "2019-01-17"
       "timezone" => "GMT"
       "type" => "Payment"
       "email" => ""
       "name" => "Naif Alshaye"
       "transaction_id" => "3DR402287R3992703"
       "status" => "Completed"
       "amt" => "1.00"
       "currency_code" => "USD"
       "fee_amount" => "-0.34"
       "net_amount" => "0.66"



The MIT License (MIT). Please see License File for more information.

File Role Description
src (3 files, 2 directories)
composer.json Data Auxiliary data
LICENSE Lic. License text Doc. Documentation

  Files  /  src  
File Role Description
config (1 file)
Facades (1 file)
   LaravelPayPal.php Class Class source
   LaravelPayPalConnector.php Class Class source
   LaravelPayPalServiceProvider.php Class Class source

  Files  /  src  /  config  
File Role Description
   laravel-paypal.php Aux. Auxiliary script

  Files  /  src  /  Facades  
File Role Description
   LaravelPayPal.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,780
This week:251

For more information send a message to info at phpclasses dot org.