PHPackages                             mahekarim/paypal-payment - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mahekarim/paypal-payment

ActiveLibrary

mahekarim/paypal-payment
========================

A package to handle PayPal payments.

051↓100%PHP

Since Oct 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/MaheKarim/paypal-payment)[ Packagist](https://packagist.org/packages/mahekarim/paypal-payment)[ RSS](/packages/mahekarim-paypal-payment/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

PayPal Payment Integration
==========================

[](#paypal-payment-integration)

[![Latest Version on Packagist](https://camo.githubusercontent.com/349c651f270d6ef3cb1c6124cf396f22ec295e6c4f1cbc066400702ef03a0c82/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6168656b6172696d2f70617970616c2d7061796d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mahekarim/paypal-payment)[![Total Downloads](https://camo.githubusercontent.com/f13fe7a18d8103d5c7e64c808e317e69daa82ce4849d41f372dbe596598ae59a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6168656b6172696d2f70617970616c2d7061796d656e742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mahekarim/paypal-payment)[![License](https://camo.githubusercontent.com/75b0d2818e69ee334743383bd9b0172590e14bae633d85110475509289cd2ff9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f796f7572757365726e616d652f70617970616c2d7061796d656e742e7376673f7374796c653d666c61742d737175617265)](https://github.com/yourusername/paypal-payment/blob/main/LICENSE)

A lightweight PHP package to integrate PayPal payment services into your application. This package provides a simple way to create and execute payments using PayPal’s API in both sandbox and live modes.

Features
--------

[](#features)

- Create and execute PayPal payments with minimal setup.
- Easily configurable to switch between sandbox and live modes.
- Integrates seamlessly with Laravel or any other PHP framework.

Installation
------------

[](#installation)

Install the package via Composer:

```
composer require mahekarim/paypal-payment
```

Configuration
-------------

[](#configuration)

Step 1: Set up environment variables Add your PayPal API credentials to your .env file:

```
PAYPAL_CLIENT_ID=your-client-id
PAYPAL_SECRET_ID=your-secret-id
PAYPAL_ACCOUNT_MODE=sandbox

```

\#Step 2: Publish the configuration (Optional for Laravel) If you're using Laravel, publish the config file:

```
php artisan vendor:publish --provider="Mahekarim\PaypalPayment\PayPalServiceProvider"

```

Configuration Step 1: Set up environment variables Add your PayPal API credentials to your .env file:

env Copy code

```
PAYPAL_CLIENT_ID=your-client-id
PAYPAL_SECRET_ID=your-secret-id
PAYPAL_ACCOUNT_MODE=sandbox # Change to 'live' for production

```

Step 2: Publish the configuration (Optional for Laravel) If you're using Laravel, publish the config file:

```
php artisan vendor:publish --provider="MaheKarim\PaypalPayment\PayPalServiceProvider"

```

This will create a configuration file `config/paypal.php` where you can specify your PayPal settings.

Usage Step 1: Create a Payment To create a payment, use the PayPalService class:

```
