https://github.com/sytxlabs/laravel-paypal
https://github.com/sytxlabs/laravel-paypal
laravel payment-gateway paypal
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sytxlabs/laravel-paypal
- Owner: SytxLabs
- License: mit
- Created: 2024-10-15T20:19:38.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2026-04-01T16:53:25.000Z (3 months ago)
- Last Synced: 2026-04-02T01:55:57.994Z (3 months ago)
- Topics: laravel, payment-gateway, paypal
- Language: PHP
- Homepage: https://packagist.org/packages/sytxlabs/laravel-paypal
- Size: 469 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PayPal for Laravel
[](LICENSE)
[](https://github.com/SytxLabs/Laravel-PayPal/actions/workflows/code-style.yml)
[](https://packagist.org/packages/sytxlabs/laravel-paypal)
[](https://packagist.org/packages/sytxlabs/laravel-paypal)
This package adds a simple way to integrate PayPal payments into your Laravel application.
## Prerequisites
* A configured Laravel database connection
* PHP 8.2 or higher
* Laravel 10.0 or higher
## Installation
```sh
composer require sytxlabs/laravel-paypal
```
## Using
- [GuzzleHttp](https://packagist.org/packages/guzzlehttp/guzzle)
- [PayPal API Reference](https://developer.paypal.com/docs/api/overview/)
- [PayPal Account](https://developer.paypal.com/docs/api-basics/sandbox/accounts/)
## Configuration
```sh
php artisan vendor:publish --tag="sytxlabs-paypal-config"
```
the configuration file is located at `config/paypal.php`
## Optional Database
```sh
php artisan vendor:publish --tag="sytxlabs-paypal-migrations"
php artisan migrate
```
## Usage
### Create a new PayPal Order
```php
use SytxLabs\PayPal\PayPalOrder;
$paypalOrder = new PayPalOrder();
$paypalOrder->addProduct(new Product('Product 1', 10.00, 1));
$paypalOrder->createOrder();
```
### Redirect to PayPal
```php
$paypalOrder->approveOrderRedirect();
```
or get the approval link
```php
$paypalOrder->getApprovalLink();
```
### Capture the payment
```php
$paypalOrder->captureOrder();
```
### Check the payment status
```php
$paypalOrder->captureOrder()->getOrderStatus();
```
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.