mysiar/omnipay-przelewy24v1

Przelewy24 API v1 driver for the Omnipay payment processing library

0.7.1 2022-11-10 12:35 UTC

This package is auto-updated.

Last update: 2024-10-30 02:10:46 UTC


README

Przelewy24 API V1 gateway for the Omnipay PHP payment processing library

CI Latest Version Total downloads GitHub license PHP Version Require GitHub stars

API endpoints implemented

Install

This gateway can be installed with Composer:

$ composer require mysiar/omnipay-przelewy24v1

Usage

The following gateways are provided by this package:

  • Przelewy24

Reference official documentation https://developers.przelewy24.pl/index.php?en

Example

require_once  __DIR__ . '/vendor/autoload.php';

use Omnipay\Omnipay;

/** @var \Omnipay\Przelewy24\Gateway $gateway */
$gateway = Omnipay::create('Przelewy24');

$gateway->initialize([
    'merchantId' => 'YOUR MERCHANT ID HERE',
    'posId'      => 'YOUR POS ID HERE',
    'crc'        => 'YOUR CRC KEY HERE',
    'reportKey'  => 'YOUR REPORT KEY HERE'
    'testMode'   => true,
]);

$params = [
    'sessionId' => 2327398739,
    'amount' => 12.34,
    'currency' => 'PLN',
    'description' => 'Payment test',
    'email' => 'franek@dolas.com',
    'country' => 'PL',
    'returnUrl' => 'www.your-domain.pl/return_here',
    'notifyUrl' => 'www.your-domain.pl/notify_here',
];

$response = $gateway->purchase($params)->send();

For more examples check

Optionally you can specify the payment channels.

$gateway->initialize([
    //[...]
    'channel' => Gateway::P24_CHANNEL_CC,
]);

// or
$gateway->setChannel(Gateway::P24_CHANNEL_CC); 

Optionally you can specify language (default: en).

$gateway->initialize([
    //[...]
    'language' => 'pl',
]);

// or
$gateway->setLanguage('pl');