2017 © Pedro Peláez
 

library laravel-paypal

A Basic Laravel PHP Wrapper for the Paypal API

image

lightshire/laravel-paypal

A Basic Laravel PHP Wrapper for the Paypal API

  • Tuesday, February 11, 2014
  • by imcorleone
  • Repository
  • 2 Watchers
  • 7 Stars
  • 177 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

OVERVIEW

This paypal laravel wrapper is created for simultaneous or bulk differentials in the paypal sandbox. This is a pet project for my own REST API for a reservation system. (LOLS), (*1)

INSTALLATION

add the following from your composer.json, (*2)

    "lightshire/laravel-paypal": "dev-master"

SERVICE PROVIDER

    'providers' => array(
            'Lightshire\Paypal\PaypalServiceProvider',
            'Lightshire\Paypal\IpnServiceProvider'
        )

FACADE

'facades'   => array(
            'Paypal'        => 'Lightshire\Paypal\Facades\Facade',
            'IpnListener'   => 'Lightshire\Paypal\Facades\IpnListenerFacade'
        )
Uses
-there is no definite use as of the moment!

deploying config files

You could easily deploy the config files by running, (*3)

    php artisan config:publish lightshire/laravel-paypal

you should see the following, (*4)

    return array(
            'endpoint'      => 'api.sandbox.paypal.com',
            'client_id'     => 'nil',
            'secret'        => 'nil',
            'mode'          => 'sandbox'
        );

change mode with live or sandbox depending on your paypal configuration., (*5)

Once you have already created your own paypal application you will be given a Client ID and a Secret. Those values should replace the nil inside the array., (*6)

Adding pre-made artisan commands

an artisan command command:paypalconfig was created in order to easily edit the embedded sdk_config.ini of the paypal API. to install:, (*7)

add the following to app/start/artisan.php, (*8)

Artisan::add(new Lightshire\Paypal\PaypalConfig);

Initiating a Paypal instance connection

To initiate a paypal instance, after all configuration, (*9)

Paypal::make();

since there will only be one instance per connection, directly creating an nstance via new Paypal would not override the instance, instead run the make method. To get the current instance, connect via:, (*10)

Paypal::getInstance()

Using the Instant Payment Notification of Paypal

for secure transactions paypal requires to have a vaiable callback to initiate an IPNListener, (*11)

example, (*12)


$mode = Config::get('laravel-paypal::config.mode'); $listener = new IpnListener(); if($mode == 'sandbox') { $listener->use_sandbox = true; } try { $verified = $listener->processIpn(); }catch(Exception $exs) { //an error occured exit(0); } if($verified) { //verified }else { //not verified }

You could also directly wait for a confirmation that would return true or false by using, (*13)

```php Paypal::IPNConfirmer() ````, (*14)

Credits

Credits to -https://github.com/Quixotix/PHP-PayPal-IPN, (*15)

The Versions

11/02 2014

dev-master

9999999-dev

A Basic Laravel PHP Wrapper for the Paypal API

  Sources   Download

The Requires

 

by Sourcescript

laravel php laravel-paypal laravel-php paypal-laravel paypal-php