raphael/paypal-payout

There is no license information available for the latest version (dev-master) of this package.

gateway of paypal payout

dev-master 2018-12-05 13:24 UTC

This package is auto-updated.

Last update: 2024-04-06 08:58:41 UTC


README

This package is developed for a special client.

Installation

  1. Install package

     composer require raphael/paypal-payout
    
  2. publish config file

    php artisan vendor:publish
    

    After publishing, edit config/paypal.php with your setting

        return [
    	    'settings' => array(
        	    'mode' => env('PAYPAL_MODE', 'sandbox'),
        	    'http.ConnectionTimeOut' => 30,
    		    'log.LogEnabled' => true,
        	    'log.FileName' => storage_path() .  '/logs/paypal.log',
        	    'log.LogLevel' => 'ERROR'
    	    ),
    	    'sandbox' => [
        	    'client_id' => env('PAYPAL_SANDBOX_CLIENT_ID', ''),
        	    'secret' => env('PAYPAL_SANDBOX_SECRET', ''),
        	    'webhook_id' => env('PAYPAL_SANDBOX_WEBHOOK_ID', ''),
    	    ],
    	    'live' => [
        	    'client_id' => env('PAYPAL_LIVE_CLIENT_ID', ''),
        	    'secret' => env('PAYPAL_LIVE_SECRET', ''),
        	    'webhook_id' => env('PAYPAL_LIVE_WEBHOOK_ID', ''),
    	    ],
    ];
    
  3. create table for payout log

    php artisan migrate
    
  4. Set your paypal webhook url to https://{your site url}/paypal/webhook

Usage

Create Payout

$payout = new \Raphael\PaypalPayout\PaypalPayout;
$receiver = 'test@email.com';
$amount = 10;
$log = $payout::createPayout($receiver, $amount);

You'll get log object if payout has been created, but get null if fails.