Download the PHP package mnastalski/przelewy24-php without Composer

On this page you can find all versions of the php package mnastalski/przelewy24-php. 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 przelewy24-php

Przelewy24 PHP library

PHP wrapper for Przelewy24.

If you are using Laravel, check out mnastalski/przelewy24-laravel.

Przelewy24's API documentation is available at https://developers.przelewy24.pl/.

Requirements

For lower PHP versions, check the 0.x versions.

Installation

Usage

Creating an instance

Setting isLive to false will use the sandbox environment. Set it to true to use production/live mode.

Testing the connection

You may use the following method to test if the connection to Przelewy24's API using provided credentials is working:

Creating a transaction

Note that amount is passed as an integer, so if the actual amount is 1.25 PLN you will need to pass 125 as value.

For the complete list of available parameters check the signature of TransactionRequests::register().

Return the transaction's token:

Return the URL to the payment gateway:

Listening for transaction registration status webhook

To parse the webhook's payload, pass the whole request's POST data as an array to handleWebhook():

handleWebhook() returns TransactionStatusNotification::class, which has a bunch of useful methods you can use to check the transaction's data, as well as verify the webhook's signature:

If you would like to make sure the incoming request's IP address belongs to Przelewy24 then a list of valid IPs is available in the \Przelewy24\Constants\IpAddresses::V4 constant. A helper method that accepts a string with an IP address and returns a boolean is also available: \Przelewy24\Constants\IpAddresses::isValid($ip).

Verifying a transaction

Similarly to registering a transaction, the amount is passed as an integer.

Refunding transactions

Return the refunds' item list:

`

Listening for transaction refund status webhook

To parse the webhook's payload, pass the whole request's POST data as an array to handleRefundWebhook():

Error handling

Should Przelewy24's API return an erroneous response, an ApiResponseException::class (which extends Przelewy24Exception::class) will be thrown. You can therefore use a try/catch block to handle any errors:


All versions of przelewy24-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
guzzlehttp/guzzle Version ^7.6
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 mnastalski/przelewy24-php contains the following files

Loading the files please wait ....