2017 © Pedro Peláez
 

library paypal

include donation demo

image

skygdi/paypal

include donation demo

  • Monday, May 7, 2018
  • by skygdi
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Quick paypal button deploy for Laravel

1.Install:, (*1)

composer require skygdi/paypal

2.Add paypal configuration into your .env file:, (*2)

PAYPAL_SANBOX_CLIENTID=your_paypal_client_ID
PAYPAL_SANBOX_CLIENTSECRET=your_paypal_client_secret
PAYPAL_CLIENTID=your_paypal_client_ID
PAYPAL_CLIENTSECRET=your_paypal_client_secret
PAYPAL_ENV=sandbox

[ sandbox production ], (*3)

3.Public button template:, (*4)

php artisan vendor:publish --provider="skygdi\paypal\PayPalProvider"

4.include the template partial where ever you wanted and edit as needed:, (*5)

@include('vendor.skygdi.paypal_button')

Change the #order_id input and #order_total value as your logic needed before clicking the paypal checkout button., (*6)

  1. Create your order status logic, for example in web.php:
use Session;
use Illuminate\Http\Request;
use skygdi\paypal\CommonController;

Route::post('paypal/execute', function (Request $request) {
    $obj = new \skygdi\paypal\CommonController();

    $obj->InitializeApiContext();
    if( Session::has('ordering_id') ){
        //Mark order as paying
    }

    if( !$request->has("paymentID") || !$request->has("payerID") ) return ["state"=>"error","text"=>"parameter required"];

    $p = $obj->Execute($request);
    if( isset($p->state) && $p->state=="approved" ){
        //Mark order as finished
        return ["state"=>"success"];
    }
    else{
        return $p;
    }
});

Quick test url:, (*7)

yourURL/skygdi/paypal/test

test5, (*8)

The Versions

07/05 2018

dev-master

9999999-dev

include donation demo

  Sources   Download

The Requires

 

by Avatar skygdi

07/05 2018

1.0.6

1.0.6.0

include donation demo

  Sources   Download

The Requires

 

by Avatar skygdi

07/05 2018

1.0.4

1.0.4.0

include donation demo

  Sources   Download

The Requires

 

by Avatar skygdi

07/05 2018

1.0.5

1.0.5.0

include donation demo

  Sources   Download

The Requires

 

by Avatar skygdi

07/05 2018

1.0.3

1.0.3.0

include donation demo

  Sources   Download

The Requires

 

by Avatar skygdi

07/05 2018

1.0.1

1.0.1.0

include donation demo

  Sources   Download

The Requires

 

by Avatar skygdi

07/05 2018

1.0.2

1.0.2.0

include donation demo

  Sources   Download

The Requires

 

by Avatar skygdi

06/05 2018

v0.2

0.2.0.0

include donation demo

  Sources   Download

The Requires

 

by Avatar skygdi