PHPackages                             kuzry/laravel-przelewy24 - 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. [Payment Processing](/categories/payments)
4. /
5. kuzry/laravel-przelewy24

ActiveLibrary[Payment Processing](/categories/payments)

kuzry/laravel-przelewy24
========================

Laravel integration package for Przelewy24 payment gateway

1.1.1(6mo ago)98MITPHPPHP ^8.3 || 8.4CI passing

Since Oct 7Pushed 6mo agoCompare

[ Source](https://github.com/Kuzry/laravel-przelewy24)[ Packagist](https://packagist.org/packages/kuzry/laravel-przelewy24)[ Docs](https://github.com/kuzry/laravel-przelewy24)[ RSS](/packages/kuzry-laravel-przelewy24/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (13)Versions (4)Used By (0)

Laravel Przelewy24
==================

[](#laravel-przelewy24)

[![Latest Version on Packagist](https://camo.githubusercontent.com/cb4b977d1aeccc8ccd972371f5f1b4e9247c6e1121f0ce108c5c24513acce9d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b757a72792f6c61726176656c2d70727a656c65777932342e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kuzry/laravel-przelewy24)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6838ed8c88e367664fdb50f0b2273eb85a48069f595175e364bb6216e6e91cb2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b757a72792f6c61726176656c2d70727a656c65777932342f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/kuzry/laravel-przelewy24/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/6a972b900af0f9dd34f2e29e1b84d23fa325ef8ae48d157102bc2aefffb779e4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b757a72792f6c61726176656c2d70727a656c65777932342f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/kuzry/laravel-przelewy24/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/1318670e3c92a1b6298e4c30ef9f5dd53fb48cb26ff0d48911c5c98e2c5408da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b757a72792f6c61726176656c2d70727a656c65777932342e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kuzry/laravel-przelewy24)

A Laravel package for seamless integration with [Przelewy24](https://www.przelewy24.pl/) payment gateway. Przelewy24 is one of the leading online payment providers in Poland, offering a wide range of payment methods including credit cards, bank transfers, BLIK, and more.

This package allows you to quickly implement secure online payments in your Laravel application using the official Przelewy24 API.

Features
--------

[](#features)

- 🚀 Easy Integration - Quick setup with minimal configuration
- ⚛️ React Hooks - Ready-to-use hooks for frontend payment handling
- 🏪 Multiple POS Support - Handle multiple Point of Sales configurations
- 🔄 Automatic Data Sharing - Seamless integration with Inertia.js
- 🔒 Secure - Built-in signature verification and transaction validation
- 📝 TypeScript Support - Full type definitions for frontend integration

Requirements
------------

[](#requirements)

- **PHP**: 8.3 or higher
- **Laravel**: 11.x or higher

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

[](#installation)

### 1. Install the package

[](#1-install-the-package)

```
composer require kuzry/laravel-przelewy24
```

### 2. Publish a configuration file

[](#2-publish-a-configuration-file)

```
php artisan vendor:publish --tag=przelewy24-config
```

Default values from the configuration file can be overridden directly when calling the package's methods.

### 3. Configure environment variables

[](#3-configure-environment-variables)

Add the following variables to your `.env` file. You can obtain these credentials from your Przelewy24 merchant panel:

```
PRZELEWY24_POS_DEFAULT_ENVIRONMENT=sandbox # sandbox or production
PRZELEWY24_POS_DEFAULT_MERCHANT_ID=        # your merchant ID from Przelewy24 panel
PRZELEWY24_POS_DEFAULT_POS_ID=             # your POS ID (usually same as merchant ID)
PRZELEWY24_POS_DEFAULT_CRC=                # CRC key from Przelewy24
PRZELEWY24_POS_DEFAULT_REPORT_KEY=         # report key used for transaction verification
```

**Note:** Always use a sandbox environment for development and testing. Switch to production only when you're ready to accept real payments.

### 4. Frontend Framework Setup

[](#4-frontend-framework-setup)

#### 4.1 React

[](#41-react)

Update your `vite.config.js`:

```
import { resolve } from 'path';

export default defineConfig({
    resolve: {
        alias: {
            '@kuzry/laravel-przelewy24': resolve(__dirname, 'vendor/kuzry/laravel-przelewy24/resources/js/react'),
        }
    }
});
```

Update your `tsconfig.json`:

```
{
    "compilerOptions": {
        "paths": {
            "@kuzry/laravel-przelewy24": ["./vendor/kuzry/laravel-przelewy24/resources/js/react"]
        }
    }
}
```

Quick start
-----------

[](#quick-start)

### Payment Flow Overview

[](#payment-flow-overview)

The integration follows a standard payment flow:

1. **Register Transaction** - Create a payment session with Przelewy24
2. **Redirect Customer** - Send the customer to Przelewy24 payment gateway
3. **Receive Notification** - Handle the webhook callback after payment from Przelewy24
4. **Verify Transaction** - Confirm the payment with Przelewy24 API

### Transaction Registration

[](#transaction-registration)

The `transactionRegister` method initiates a new payment transaction with Przelewy24. It creates a payment session and returns the data needed to redirect the customer to the payment gateway.

**Important security note:** Never trust data directly from the request for critical fields like `amount`, `currency` or `sessionId`. Always retrieve these values from your database or calculate them server-side to prevent payment manipulation.

```
