PHPackages                             dizatech/rayanpay\_ipg - 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. dizatech/rayanpay\_ipg

ActiveLibrary[Payment Processing](/categories/payments)

dizatech/rayanpay\_ipg
======================

Rayanpay payment gateway for Laravel

v1.0.0(3y ago)024GPL-3.0-or-laterPHP

Since Apr 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dizatech/rayanpay_ipg)[ Packagist](https://packagist.org/packages/dizatech/rayanpay_ipg)[ RSS](/packages/dizatech-rayanpay-ipg/feed)WikiDiscussions main Synced 1mo ago

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

Payment Cycle
-------------

[](#payment-cycle)

For a payment transaction we have to request a payment via web service. If our request is successful the IPG will return a token which we should use while redirecting customer to payment page. Customer will be redirected back to our desired URL(callback URL) from payment page via a GET request carrying data which may be used to check and verify customer's transaction using web service.

Request payment
---------------

[](#request-payment)

For a payment transaction we should send a payment request to IPG and acquire a token. This may be accomplished by calling `getToken` method.

### Instantiating an IPG object

[](#instantiating-an-ipg-object)

for instantiating an IPG object we should call `Dizatech\RayanpayIpg\RayanpayIpg` constructor passing it an array of required arguments containing:

- merchantId: your payment gateway merchant id

#### Code sample:

[](#code-sample)

```
$args = [
    'merchantId'    => '4e1598fc-09b8-29e6-2edc-bf5494616b4d'
]; //Replace arguments with your gateway actual values
$ipg = new RayanpayIpg($args);
```

### `getToken` method

[](#gettoken-method)

#### Arguments:

[](#arguments)

- amount: amount in Rials
- redirect\_address: URL to which customer may be redirected after payment

#### Returns:

[](#returns)

An object with the following properties:

- status: `success` or `error`
- token: in case of a successful request contains the generated token which may be used while redirecting customer to payment page
- message: contains error message when `status` is `error`

Redirecting customer to payment page
------------------------------------

[](#redirecting-customer-to-payment-page)

If `status` property of the result of calling `getToken` is `success` we can redirect customer to payment page URL which is currently `https://pms.rayanpay.com/pg/startpay/`. We have to redirect user to payment page via a GET request.

**It is neccessary to save the acquired token token for further use**

#### Code sample:

[](#code-sample-1)

```
$args = [
    'merchantId'    => '4e1598fc-09b8-29e6-2edc-bf5494616b4d'
]; //Replace arguments with your gateway actual values
$ipg = new RayanpayIpg($args);
$amount = 1000; //Replace with actual order amount in Rials
$redirect_address = 'http://my.com/verify'; //Replace with your desired callback page URL
$result = $ipg->getToken($amount, $redirect_address);
if( $result->status == 'success' ){
    header('Location: https://pms.rayanpay.com/pg/startpay/' . $result->token);
    die();
}
else{
    echo "Error: {$result->message}";
}
```

Payment verification and settle
-------------------------------

[](#payment-verification-and-settle)

After payment the customer will be redirected back to the callback URL provided in payment request phase via a GET request carrying all necessary data including:

- Authority: Payment token by which the user has been redirected to payment page
- Status: Payment status which should be ‍`OK` for successful payments

If `Status` equals `OK` we can call the `verifyRequest` method to verify payment.

### `verifyRequest` method

[](#verifyrequest-method)

#### Arguments:

[](#arguments-1)

- amount: Original order amoun tused in payment request
- token: Authority parameter returned by IPG

#### Returns:

[](#returns-1)

An object with the following properties:

- status: `success` or `error`
- message: message describing the status
- ref\_id: reference id in case of successful transaction

#### Code sample:

[](#code-sample-2)

```
$args = [
    'merchantId'    => '4e1598fc-09b8-29e6-2edc-bf5494616b4d'
]; //Replace arguments with your gateway actual values
$ipg = new RayanpayIpg($args);
$amount = 1000; //Replace with actual order amount in Rials
$result = $ipg->verifyRequest($amount, $_GET['Authority']);
```

Getting `success` status in response means that the transction is successful and settled.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1115d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ca25b6ce9e40a205b65efd8c9fb92865bbf6d4586f11be7ca76be0d4151b808?d=identicon)[omidfarahani](/maintainers/omidfarahani)

---

Top Contributors

[![omidfarahani](https://avatars.githubusercontent.com/u/10830204?v=4)](https://github.com/omidfarahani "omidfarahani (5 commits)")

### Embed Badge

![Health badge](/badges/dizatech-rayanpay-ipg/health.svg)

```
[![Health](https://phpackages.com/badges/dizatech-rayanpay-ipg/health.svg)](https://phpackages.com/packages/dizatech-rayanpay-ipg)
```

###  Alternatives

[chargebee/chargebee-php

ChargeBee API client implementation for PHP

768.0M9](/packages/chargebee-chargebee-php)[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[buckaroo/sdk

Buckaroo payment SDK

12189.1k8](/packages/buckaroo-sdk)[contica/facturador-electronico-cr

Un facturador de código libre para integrar facturación electrónica en Costa Rica a un proyecto PHP

2128.8k](/packages/contica-facturador-electronico-cr)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)

PHPackages © 2026

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