PHPackages                             adnane-ka/omnipay-sepay - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. adnane-ka/omnipay-sepay

ActiveLibrary[Payment Processing](/categories/payments)

adnane-ka/omnipay-sepay
=======================

Sepay gateway for Omnipay payment processing library

1.3(1y ago)046MITPHP

Since Sep 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/adnane-ka/omnipay-sepay)[ Packagist](https://packagist.org/packages/adnane-ka/omnipay-sepay)[ RSS](/packages/adnane-ka-omnipay-sepay/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (7)Versions (5)Used By (0)

Omnipay: Sepay
==============

[](#omnipay-sepay)

**Sepay payments gateway for Omnipay payment processing library**

[![Build Status](https://camo.githubusercontent.com/879e9e70c7021a138e30acd134148b7c6cb087c63c5649adc5ddd8c09d34329c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f61646e616e652d6b612f6f6d6e697061792d73657061792e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.com/adnane-ka/omnipay-sepay)[![Latest Stable Version](https://camo.githubusercontent.com/23b8a7310f96c16986c1f156cac4915ada3ce8d29a05a8929d99d56c714e5bca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61646e616e652d6b612f6f6d6e697061792d73657061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adnane-ka/omnipay-sepay)[![Total Downloads](https://camo.githubusercontent.com/5e4d5bcb57736bc931c2ecd97491488d6065d51feb9d22dd91fc9fda25a95c1d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61646e616e652d6b612f6f6d6e697061792d73657061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adnane-ka/omnipay-sepay)

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Tap support for Omnipay.

Installation
------------

[](#installation)

```
composer require adnane-ka/omnipay-sepay
```

Basic Usage
-----------

[](#basic-usage)

The following gateways are provided by this package:

- Sepay

This package ineteracts with [Sepay's API](https://sepay.vn/lap-trinh-cong-thanh-toan.html).

For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)repository.

Flow
----

[](#flow)

1. Configure gateway.
2. Create a QR image for the operation.
3. Display the QR image for the end-user in a on-site checkout page.
4. Once the operation is accomplished, a webhook should be fired.
5. Receive data from webhook.
6. Complete purchase by comparing / proccessing the received data.

Example usage
-------------

[](#example-usage)

### Configuration

[](#configuration)

```
use Omnipay\Omnipay;

$gateway = Omnipay::create('Sepay');
$gateway->setApiKey('YOUR_API_KEY');
$gateway->setBankAccountNumber('YOUR_BANK_ACCOUNT_NUMBER');
$gateway->setBankName('YOUR_BANK_NAME');
```

### Creating a Purchase

[](#creating-a-purchase)

```
$response = $gateway->purchase([
    'amount' => 100000, // the amount in VND
    'checkoutUrl' => 'http://localhost:8000/checkout.php', // the page where the QR image is displayed
    'returnUrl' => 'http://localhost:8000/complete.php', // the URL to return to after the operation is fully proccessed
    'transactionId' => uniqid() // A unique identifier for the operation
])->send();

if ($response->isRedirect()) {
    // The QR code is generated successfully and you're ready to be redirected to checkout
    $response->redirect();
} else {
    // An error occured
    echo $response->getMessage();
}
```

### Checkout

[](#checkout)

```
