Skip to content

Przelewy24 API v1 driver for the Omnipay payment processing library

License

Notifications You must be signed in to change notification settings

TomekTraczyk/omnipay-przelewy24v1

 
 

Repository files navigation

Omnipay: Przelewy24 API V1

Przelewy24 API V1 gateway for the Omnipay PHP payment processing library

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

Coverage Maintainability Rating Quality Gate Status Reliability Rating Security Rating Bugs Code Smells Duplicated Lines (%) Lines of Code Technical Debt Vulnerabilities

API endpoints implemented

API endpoint Gateway method
/api/v1/testAccess testAccess
/api/v1/payment/methods methods
/api/v1/transaction/register purchase
/api/v1/transaction/verify completePurchase
/api/v1/transaction/refund refund
/api/v1/transaction/by/sessionId purchaseInfo
/api/v1/card/info cardInfo
/api/v1/card/pay cardPay
/api/v1/card/charge cardCharge
/api/v1/card/chargeWith3ds cardCharge3ds
/api/v1/transaction/registerOffline purchaseOffline

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' => '[email protected]',
    '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'); 

About

Przelewy24 API v1 driver for the Omnipay payment processing library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.8%
  • Makefile 0.2%