PHP code example of sytxlabs / laravel-paypal

1. Go to this page and download the library: Download sytxlabs/laravel-paypal library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sytxlabs / laravel-paypal example snippets


use SytxLabs\PayPal\PayPalOrder;

$paypalOrder = new PayPalOrder();

$paypalOrder->addProduct(new Product('Product 1', 10.00, 1));

$paypalOrder->createOrder();

$paypalOrder->approveOrderRedirect();

$paypalOrder->getApprovalLink();

$paypalOrder->captureOrder();

$paypalOrder->captureOrder()->getOrderStatus();
sh
php artisan vendor:publish --tag="sytxlabs-paypal-config"
sh
php artisan vendor:publish --tag="sytxlabs-paypal-migrations"
php artisan migrate