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

3.0.3 2021-03-02 09:52 UTC


Software License Latest Version on Packagist Total Downloads StyleCI Tests Coverage Status Code Quality


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


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();

Override PayPal API Configuration

You can override PayPal API configuration by calling setApiCredentials method:


Get Access Token

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


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:


Initiating an order for Checkout

Use the createOrder method to initiate an order

  "intent"=> "CAPTURE",
  "purchase_units"=> [
      0 => [
          "amount"=> [
              "currency_code"=> "USD",
              "value"=> "100.00"

The response from this will include an order ID which you will need to retail, and a links collection so you can redirect the user to Paypal to complete the order with their payment details

When the user returns to the notifcation url you can capture the order payment with

$provider->capturePaymentOrder($order_id); //order id from the createOrder step 


This version supports Laravel 6 or greater.

  • In case of any issues, kindly create one on the Issues section.
  • If you would like to contribute:
    • Fork this repository.
    • Implement your features.
    • Generate pull request.