PHPackages                             kipolaboratory/kipo-kpg - 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. kipolaboratory/kipo-kpg

ActivePhp-library[Payment Processing](/categories/payments)

kipolaboratory/kipo-kpg
=======================

Kipopay payment gateway library OOP (PHP)

0.5.7(6y ago)0170MITPHP

Since Aug 29Pushed 6y agoCompare

[ Source](https://github.com/kipolaboratory/kipo-kpg)[ Packagist](https://packagist.org/packages/kipolaboratory/kipo-kpg)[ RSS](/packages/kipolaboratory-kipo-kpg/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (19)Used By (0)

PHP Kipo KPG Library: make payment easy with kipo
=================================================

[](#php-kipo-kpg-library-make-payment-easy-with-kipo)

[![Latest Stable Version](https://camo.githubusercontent.com/c6646ef8b09a23e6577ff5ce438d5958af67100a2eaee1f786c0738b22902e5b/68747470733a2f2f706f7365722e707567782e6f72672f6b69706f6c61626f7261746f72792f6b69706f2d6b70672f762f737461626c65)](https://packagist.org/packages/kipolaboratory/kipo-kpg)[![](https://camo.githubusercontent.com/d9452907c366cc17b682073d6f0868e2ccd9458fd750cadc212bbd42f5ce0030/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6b69706f6c61626f7261746f72792f6b69706f2d6b70672e737667)](https://github.com/kipolaboratory/kipo-kpg/blob/master/LICENSE)[![](https://camo.githubusercontent.com/850dca07c6ec4bb0bc872eb7cb69b6116966fb0b4ea2968e7033576e77f4fff0/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6b69706f6c61626f7261746f72792f6b69706f2d6b70672e737667)](https://travis-ci.org/kipolaboratory/kipo-kpg/)[![](https://camo.githubusercontent.com/97c6a7a2ceb8a2865f2d5fa85c2b70f526df6adfb5b3e51bed8d4ee62bd44033/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b69706f6c61626f7261746f72792f6b69706f2d6b70672e737667)](https://github.com/kipolaboratory/kipo-kpg/releases/)

PHP Kipo KPG Library make it easy to stablish payment with kipo gateway.

[![KipoPay Company logo](https://camo.githubusercontent.com/b653ab2bdb24c2b31226cf7b561a3e7e864b5094cb32853236c252cbef63e8ea/68747470733a2f2f6b69706f7061792e636f6d2f696d616765732f6b69706f2d6865616465722e737667)](https://camo.githubusercontent.com/b653ab2bdb24c2b31226cf7b561a3e7e864b5094cb32853236c252cbef63e8ea/68747470733a2f2f6b69706f7061792e636f6d2f696d616765732f6b69706f2d6865616465722e737667)

---

- [Installation](#installation)
- [Quick Start and Examples](#quick-start-and-examples)
- [Properties](#properties)
- [HTML Form to transfer user to KPG](#html-form-to-transfer-user-to-kpg)
- [Error code and messages](#error-code-message)

---

### Installation

[](#installation)

To install PHP Kipo KPG Library, simply:

```
$ composer require kipolaboratory/kipo-kpg

```

For latest commit version:

```
$ composer require kipolaboratory/kipo-kpg @dev

```

### Requirements

[](#requirements)

PHP Kipo KPG Library works with PHP 5.6, 7.0, 7.1, 7.2.

### Quick Start and Examples

[](#quick-start-and-examples)

Initial Kipo KPG and request shoping key from kipo server.

```
use kipolaboratory\KipoPay\KipoKPG;

/**
 * Initial Kipo Library and craete object from that class
 * Merchant key is merchant phone number
 */
$kipo = new KipoKPG(['merchant_key' => '09*********']);

/**
 * Replace "YOUR CALLBACK URL" and "AMOUNT" with what you want
 * KPGInitiate return ARRAY for result
 * Successful - ['status' => true, 'shopping_key' => SHOPING_KEY]
 * Failed - ['status' => false, 'message' => ERROR_MESAGE, 'code' => ERROR_CODE]
 */
$kpg_initiate = $kipo->KPGInitiate(AMOUNT, 'YOUR CALLBACK URL');

if ($kpg_initiate['status']) {
    /**
     * Store $kpg_initiate['shopping_key'] to session to verfiy
     * payment after user came back from gateway
     *
     * Call renderForm function to render a html form and send
     * user to Kipo KPG Gateway (you can create this form manually
     * where you want - form example is at the end of Quick Start
     */
     $kipo->renderForm($kpg_initiate['shopping_key']);
} else {
    /**
     * Show error to user
     *
     * You can call getErrorMessage and send error code to that
     * and get error message
     * $kipo->getErrorMessage(ERROR_CODE)
     */
}
```

Verify payment after user return back to *CALLBACK URL*

```
/**
 * Replace "SHOPPING_KEY" with your SHOPPING_KEY that you taken from
 * Initiate function
 *
 * KPGInquery return ARRAY for result
 * Successful - ['status' => true, 'referent_code' => REFERENT_CODE, 'amount' => PAYMENT_AMOUNT]
 * Failed - ['status' => false, 'message' => ERROR_MESAGE, 'code' => ERROR_CODE]
 */
$kpg_inquery = $kipo->KPGInquery(SHOPPING_KEY);
```

```
// Get shopping key after KPGInitiate called
$curl->getShoppingKey();
```

```
// Get referent code after KPGInquery called
$curl->getReferentCode();
```

### Properties

[](#properties)

```
// URL of Kipo KPG - https://webgate.kipopay.com/
// Shopping key must post to this url with SK name
$kipo->kipo_webgate_url;
```

### HTML Form to transfer user to KPG

[](#html-form-to-transfer-user-to-kpg)

```

document.forms['kipopay-gateway'].submit();
```

### Error code and messages

[](#error-code-and-messages)

- -1: There is a problem with request parameters, please check them out (initial payment)
- -2: There is a problem with parse requested data (please request again later)
- -3: Connection error, API can't connect to KIPO server
- -4: There is a problem with request parameters, please check them out (verify payment)
- -5: Payment canceled by user or there is a problem
- -6: Invalid Merchant key **(Merchant mobile number)**
- -7: Minimum payment must be atleast 1.000 Rials
- -8: Maximum payment must be 100.000.000 Rials
- -9: Invalid payment token **(shoping key)** format

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity60

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 ~32 days

Total

18

Last Release

2262d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/703ce4cfa1499559395985460041a6c4ddd6e536753b0f4ca5029b1645d3ea34?d=identicon)[kipolaboratory](/maintainers/kipolaboratory)

---

Top Contributors

[![kipolaboratory](https://avatars.githubusercontent.com/u/42690184?v=4)](https://github.com/kipolaboratory "kipolaboratory (23 commits)")

---

Tags

kipo-payooppaymentphpphp-classphp-libraryphppaymentgatewayOOP

### Embed Badge

![Health badge](/badges/kipolaboratory-kipo-kpg/health.svg)

```
[![Health](https://phpackages.com/badges/kipolaboratory-kipo-kpg/health.svg)](https://phpackages.com/packages/kipolaboratory-kipo-kpg)
```

###  Alternatives

[omalizadeh/laravel-multi-payment

A driver-based laravel package for online payments via multiple gateways

491.1k](/packages/omalizadeh-laravel-multi-payment)

PHPackages © 2026

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