PHPackages                             barstec/laravel-paypal-payment-ipn - 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. [Framework](/categories/framework)
4. /
5. barstec/laravel-paypal-payment-ipn

ActiveLibrary[Framework](/categories/framework)

barstec/laravel-paypal-payment-ipn
==================================

Package for easily integrating paypal payments via html buttons with Laravel and IPN verification.

v1.0.1(2mo ago)016MITPHPCI passing

Since Dec 25Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/Bartlomiej-Stec/laravel-paypal-payment-ipn)[ Packagist](https://packagist.org/packages/barstec/laravel-paypal-payment-ipn)[ RSS](/packages/barstec-laravel-paypal-payment-ipn/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (5)Versions (3)Used By (0)

Paypal pay now buttons with IPN verification for Laravel
========================================================

[](#paypal-pay-now-buttons-with-ipn-verification-for-laravel)

This package facilitates seamless integration of PayPal payments via pay now buttons and IPN verification within Laravel. It's specifically designed for sellers without a PayPal business account, eliminating the need for access to the live API version.

Support
-------

[](#support)

If this package is helpful for you, you can support my work on Ko-fi.

[![ko-fi](https://camo.githubusercontent.com/201ef269611db7eb6b5d08e9f756ab8980df3014b64492770bdf13a6ed924641/68747470733a2f2f6b6f2d66692e636f6d2f696d672f676974687562627574746f6e5f736d2e737667)](https://ko-fi.com/S6S6PH8KM)

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

[](#installation)

1. Install composer package using command:

```
composer require barstec/laravel-paypal-payment-ipn
```

2. Publish configuration files to your project

```
php artisan vendor:publish --provider="Barstec\Paypal\PaypalServiceProvider"
```

4. Run migrations

```
php artisan migrate
```

Setup
-----

[](#setup)

Firstly you need to move environmental variables from .env.example to .env:

```
PAYPAL_MODE=dev
PAYPAL_EMAIL=
```

If you are in testing mode, set PAYPAL\_MODE to **dev**. When in production, switch it to **prod**.

PAYPAL\_EMAIL is the email address of the PayPal account where payments will be sent.

In the configuration file, you can define return routes, default values, the database table name, and the columns to be collected. After modifying columns, rerun the migration process.

Ensure that you specify the same notification route as in the PayPal IPN settings. This URL is used to verify transactions and is set by default to /api/paypal/notification.

**Important!** You should set your PayPal IPN settings to use encoding UTF-8. Otherwise, there is no guarantee that certain characters will be recognized correctly. You can set it up here: [https://www.paypal.com/cgi-bin/customerprofileweb?cmd=\_profile-language-encoding](https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-language-encoding)

Usage/Examples
--------------

[](#usageexamples)

To initiate a transaction, create a **Payload** object in your controller and assign values. Then, create a **Payment** object, pass the **Payload**, and call **redirect()**. This action will start the transaction and redirect the user to the Paypal payment page. By default **Payload** object is configured to handle single-item payment without delivery or additional costs. You can modify it using predefined methods or by adding any fields you want using **setParams**.

```
