Skip to content

tbanov/omnipay-epay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
tihomir.banov
May 22, 2023
1515e19 · May 22, 2023

History

24 Commits
May 22, 2023
Mar 25, 2015
Mar 25, 2015
May 11, 2017
May 22, 2023

Repository files navigation

Omnipay: Epay

ePay.bg driver for the Omnipay PHP payment processing library

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Epay, EasyPay, Bpay and more Bugarian online payment providers support for Omnipay.

Installation

Omnipay is installed via Composer. To install, simply run:

composer require gentor/omnipay-epay

The following gateways are provided by this package:

For general usage instructions, please see the main Omnipay repository.

Basic Usage

Purchase

use Omnipay\Omnipay;

$provider = Epay; # Or Easypay
$gateway = Omnipay::create($provider);
$gateway->setMin('Epay Merchant Id');
$gateway->setSignature('Epay Signature');

$response = $gateway->purchase(
    [
        'amount' => '10.00', // BGN
        'transactionId' => 'Unique ID in your system',
        'returnUrl' => 'your.site.com/return',
        'cancelUrl' => 'your.site.com/cancel',
    ]
)->send();

if ($response->isSuccessful()) {
    // only EasyPay get IDN
    echo($response->getRedirectData());
} elseif ($response->isRedirect()) {
    // redirect to epay payment gateway
    $response->redirect();
} else {
    // payment failed: display message to customer
    echo $response->getMessage();
}

Webhook

  • Listener for payment status
//Use only epay gateway
$gateway = Omnipay::create('Epay');
$gateway->setMin('Epay Merchant Id');
$gateway->setSignature('Epay Signature');

$response = $gateway->acceptNotification()->send();

if ($response->isSuccessful()) {
    $status = $response->getTransactionStatus();
    // Response is required for epay gateway to stop sending data
    echo $response->getData()['notify_text'];
} else {
    // Response is required for epay gateway to stop sending data
    echo $response->getData()['notify_text'];
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published