| Recommend this page to a friend! | 
| Info | Documentation | Reputation | Support forum | Blog | Links | 
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not yet rated by the users | Total: 60 | All time:  10,511 This week: 455 | ||||
| Version | License | PHP version | Categories | |||
| laravel-paypal 1.0.0 | Custom (specified... | 5 | PHP 5, Web services, Finances | 
| Description | Author  | |
This package can access Paypal API using a Laravel service provider.  | 
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
Naif\LaravelPayPal\LaravelPayPalServiceProvider::class,
'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
https://www.paypal.com/businessprofile/mytools/apiaccess/firstparty/signature
Paypal > Profile > Profile and settings > My selling tools > API access > NVP/SOAP API integration (Classic)

Add these to your .env
LARAVEL_PAYPAL_USERNAME=
LARAVEL_PAYPAL_PASSWORD=
LARAVEL_PAYPAL_SIGNATURE=
use Naif\LaravelPayPal\LaravelPayPal;
$paypal = new LaravelPayPal();
//Get Current Balance
$balance = $paypal->getBalance();
Response:
[
  "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)
Response:
[
 "transactions" => array:3 [?
     0 => array:11 [?
       "timestamp" => "2019-01-17"
       "timezone" => "GMT"
       "type" => "Payment"
       "email" => "[email protected]"
       "name" => "Naif Alshaye"
       "transaction_id" => "3DR402287R3992703"
       "status" => "Completed"
       "amt" => "1.00"
       "currency_code" => "USD"
       "fee_amount" => "-0.34"
       "net_amount" => "0.66"
     ]
 ]
]
https://www.linkedin.com/in/naif
The MIT License (MIT). Please see License File for more information.
| File | Role | Description | ||
|---|---|---|---|---|
| Data | Auxiliary data | |||
| Lic. | License text | |||
| Doc. | Documentation | |||
| / | src | 
| File | Role | Description | ||
|---|---|---|---|---|
|    | 
Class | Class source | ||
|    | 
Class | Class source | ||
|    | 
Class | Class source | ||
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% | 
  | 
  | 
| Applications that use this package | 
 If you know an application of this package, send a message to the author to add a link here.