PHPackages                             aleksandrzhiliaev/omnipay-okpay - 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. aleksandrzhiliaev/omnipay-okpay

ActiveLibrary[Payment Processing](/categories/payments)

aleksandrzhiliaev/omnipay-okpay
===============================

Okpay gateway for Omnipay payment processing library

1.0.0.0(9y ago)11.2k1PHP

Since Jan 31Pushed 9y agoCompare

[ Source](https://github.com/aleksandrzhiliaev/omnipay-okpay)[ Packagist](https://packagist.org/packages/aleksandrzhiliaev/omnipay-okpay)[ Docs](http://sassoft.ru)[ RSS](/packages/aleksandrzhiliaev-omnipay-okpay/feed)WikiDiscussions master Synced 2w ago

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

omnipay-okpay
=============

[](#omnipay-okpay)

[![Build Status](https://camo.githubusercontent.com/4915964d1dbdff0f8768796a55058bfa591b768e86401bbae116d2b1e20c2786/68747470733a2f2f7472617669732d63692e6f72672f616c656b73616e64727a68696c696165762f6f6d6e697061792d6f6b7061792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/aleksandrzhiliaev/omnipay-okpay)[![Codacy Badge](https://camo.githubusercontent.com/6ad8429e572ee46c9da953e14045b6aa4c4a62fc5623cb97e7e2898c96314922/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3935633332636230366434313434343661366133653936306634383135326535)](https://www.codacy.com/app/sassoftinc/omnipay-okpay?utm_source=github.com&utm_medium=referral&utm_content=aleksandrzhiliaev/omnipay-okpay&utm_campaign=Badge_Grade)[![Latest Stable Version](https://camo.githubusercontent.com/386958ad845183e265892bf764e4ce91a3ec5479aa587bedd4e99f0c68c6ce3c/68747470733a2f2f706f7365722e707567782e6f72672f616c656b73616e64727a68696c696165762f6f6d6e697061792d6f6b7061792f762f737461626c65)](https://packagist.org/packages/aleksandrzhiliaev/omnipay-okpay)[![Total Downloads](https://camo.githubusercontent.com/5280d13b383f6c81fc08e1e352eb6686128f9cf71967d260235df13d970d7338/68747470733a2f2f706f7365722e707567782e6f72672f616c656b73616e64727a68696c696165762f6f6d6e697061792d6f6b7061792f646f776e6c6f616473)](https://packagist.org/packages/aleksandrzhiliaev/omnipay-okpay)

Okpay gateway for [Omnipay](https://github.com/thephpleague/omnipay) payment processing library.

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

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

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file:

```
{
    "require": {
        "aleksandrzhiliaev/omnipay-okpay": "*"
    }
}
```

And run composer to update your dependencies:

```
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

```

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

[](#basic-usage)

The following gateways are provided by this package:

- Okpay

For general usage instructions, please see the main [Omnipay](https://github.com/omnipay/omnipay)repository. See also the [Okpay Documentation](https://dev.okpay.com/en/index.html)

Example
-------

[](#example)

1. Purchase:

```
$gateway = Omnipay::create('Okpay');

$gateway->setAccount('');
$gateway->setAccountName('');
$gateway->setSecret('');

$response = $gateway->purchase([
       'amount' => '0.1',
       'currency' => 'USD',
       'transactionId' => time(),
       'description' => 'Order # 123',
        ])->send();

if ($response->isSuccessful()) {
   // success
} elseif ($response->isRedirect()) {

   # Generate form to do payment
   $hiddenFields = '';
   foreach ($response->getRedirectData() as $key => $value) {
       $hiddenFields .= sprintf(
          '',
           htmlentities($key, ENT_QUOTES, 'UTF-8', false),
           htmlentities($value, ENT_QUOTES, 'UTF-8', false)
          )."\n";
   }

   $output = ' %2$s ';
   $output = sprintf(
      $output,
      htmlentities($response->getRedirectUrl(), ENT_QUOTES, 'UTF-8', false),
      $hiddenFields
   );
   echo $output;
   # End of generating form
} else {
   echo $response->getMessage();
}
```

2. Validate webhook

```
try {
    $response = $gateway->completePurchase()->send();
    $success = $response->isSuccessful();
    if ($success) {
       $transactionId = $response->getTransactionId();
       $amount = $response->getAmount();
       $currency = $response->getCurrency();
       // success
    }
} catch (\Exception $e) {
  // check $e->getMessage()
}
```

3. Do refund

```
try {
    $response = $gateway->refund(
        [
            'payeeAccount' => 'OK993835197',
            'amount' => 0.1,
            'description' => 'Testing okpay',
            'currency' => 'USD',
        ]
    )->send();

    if ($response->isSuccessful()) {
        // success
    } else {
        // check $response->getMessage();
    }

} catch (\Exception $e) {
    // check $e->getMessage();
}
```

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/aleksandrzhiliaev/omnipay-nixmoney/issues).

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~39 days

Total

4

Last Release

3321d ago

Major Versions

0.0.1.2 → 1.0.0.02017-05-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2b3b57c64f0a830f409ec8b43a05dc8c48048b701ce0e61633c4d7c8ff8e29b?d=identicon)[Sassoft](/maintainers/Sassoft)

---

Top Contributors

[![aleksandrzhiliaev](https://avatars.githubusercontent.com/u/12209346?v=4)](https://github.com/aleksandrzhiliaev "aleksandrzhiliaev (10 commits)")

---

Tags

okpayomnipayphppaymentgatewaypaymerchantomnipaypurchaseokpay

### Embed Badge

![Health badge](/badges/aleksandrzhiliaev-omnipay-okpay/health.svg)

```
[![Health](https://phpackages.com/badges/aleksandrzhiliaev-omnipay-okpay/health.svg)](https://phpackages.com/packages/aleksandrzhiliaev-omnipay-okpay)
```

###  Alternatives

[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

557422.2k11](/packages/lokielse-omnipay-alipay)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
