Download the PHP package kuzry/laravel-przelewy24 without Composer

On this page you can find all versions of the php package kuzry/laravel-przelewy24. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-przelewy24

Laravel Przelewy24

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Laravel package for seamless integration with Przelewy24 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

Requirements

Installation

1. Install the package

2. Publish a configuration file

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

3. Configure environment variables

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

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.1 React

Update your vite.config.js:

Update your tsconfig.json:

Quick start

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

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.

Register the route in your routes/web.php:

Note: The route name must match the url_transaction_register option in your config/przelewy24.php file. This allows the package to generate proper callback URLs.

Payment Status Webhook

After the customer completes the payment, Przelewy24 will send a notification to your webhook endpoint. This is where you verify and confirm the transaction.

Register the webhook route in your routes/api.php:

Note: The route name must match the url_status option in your config/przelewy24.php file. This allows the package to generate proper callback URLs.

Frontend Integration

Automatic Data Sharing

If you're using Inertia.js, the package can automatically share Przelewy24 configuration data with all your frontend components. The przelewy24 prop will be available globally in every Inertia page without any additional setup.

To enable this feature, set the following option in your config/przelewy24.php:

This is handled automatically by the package's Service Provider. No additional setup required!

Manual Data Sharing

If auto_register_frontend_data is disabled, you need to manually pass the data in your controllers:

React Integration

The package provides a ready-to-use React hook (usePrzelewy24) for handling payment initialization and redirection directly from your frontend. This hook simplifies the integration process, allowing you to start a transaction in just a few lines of code.

Hook API

The usePrzelewy24() hook returns an object with the following structure:

Basic Usage

Here's a simple example of implementing a payment button in your shopping cart:

By default, the hook automatically redirects the user to the Przelewy24 payment gateway on success.

Advanced Usage with Custom Callbacks

You can customize the behavior by providing onSuccess and onError callbacks:

Security

Best Practices

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-przelewy24 with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3 || 8.4
illuminate/contracts Version ^11.0||^12.0
saloonphp/saloon Version ^3.14
spatie/laravel-data Version ^4.17
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package kuzry/laravel-przelewy24 contains the following files

Loading the files please wait ...