PHPackages                             arifpay/phpsdk - 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. arifpay/phpsdk

ActiveLibrary[Payment Processing](/categories/payments)

arifpay/phpsdk
==============

Arifpay PHP SDK

v1.1.1(3y ago)017MITPHP

Since Oct 4Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Arifpay-net/phpsdk)[ Packagist](https://packagist.org/packages/arifpay/phpsdk)[ RSS](/packages/arifpay-phpsdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

[![](https://camo.githubusercontent.com/cac64a1005b20fb5582e594cde63ac39a111a4f2dea5bd4d64460d540f04ee9f/68747470733a2f2f617269667061792e6e65742f6272616e642f417269665061792d4c6f676f2d2846756c6c2d436f6c6f72292e706e67)](https://arifpay.net)

Arifpay API Package.
====================

[](#arifpay-api-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/33b7f3f6165af0bed00172279408c5f10e140569911565581d5fc5b1d8e1813c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617269667061792f617269667061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arifpay/arifpay)[![GitHub Tests Action Status](https://camo.githubusercontent.com/5d19b8c32122c2938620a266bf26fb8c6456717f4c45b901ede29cd2a079a260/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f617269667061792f617269667061792f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/arifpay/arifpay/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/8d6536f2ec4b23fa691d5c32fa2d215b4abe0cd832ed2b7b1f2960796a20b99c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f617269667061792f617269667061792f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/arifpay/arifpay/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/e565551d9303b3771d44092853716a6a0754c7be947961f9658bb8aa6882c15a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617269667061792f617269667061792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arifpay/arifpay)

Documentation
-------------

[](#documentation)

See the [`Developer` API docs](https://developer.arifpay.net/).

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

[](#installation)

You can install the package via composer:

```
composer require arifpay/arifpay
```

Usage
-----

[](#usage)

The package needs to be configured with your account's API key, which is available in the [Arifpay Dashboard](https://dashboard.arifpay.net/app/api). Require it with the key's value. After install the package. you can use as follow.

> ⚠️ Since V2 `Arifpay->create()` is deprecated and `Arifpay->checkout->create()` should be used.

```
use Arifpay\Phpsdk\Arifpay;

...

$arifpay = new Arifpay('your-api-key');
```

Creating Checkout Session
-------------------------

[](#creating-checkout-session)

After importing the `arifpay` package, use the checkout property of the Arifpay instance to create or fetch `checkout sessions`.

```
require_once 'vendor/autoload.php';

use Arifpay\Phpsdk\Arifpay;

use Arifpay\Phpsdk\Helper\ArifpaySupport;
use Arifpay\Phpsdk\Lib\ArifpayBeneficary;
use Arifpay\Phpsdk\Lib\ArifpayCheckoutItem;
use Arifpay\Phpsdk\Lib\ArifpayCheckoutRequest;
use Arifpay\Phpsdk\Lib\ArifpayOptions;

$arifpay = new Arifpay('your-api-key');

$expired = "2023-01-13T17:09:42.411";
$data = new ArifpayCheckoutRequest(
    cancel_url: 'https://api.arifpay.com',
    error_url: 'https://api.arifpay.com',
    notify_url: 'https://gateway.arifpay.net/test/callback',
    expireDate: $expired,
    nonce: floor(rand() * 10000) . "",
    beneficiaries: [
        ArifpayBeneficary::fromJson([
            "accountNumber" => '01320811436100',
            "bank" => 'AWINETAA',
            "amount" => 10.0,
        ]),
    ],
    paymentMethods: ["CARD"],
    success_url: 'https://gateway.arifpay.net',
    items: [
        ArifpayCheckoutItem::fromJson([
            "name" => 'Bannana',
            "price" => 10.0,
            "quantity" => 1,
        ]),
    ],
);
$session =  $arifpay->checkout->create($data, new ArifpayOptions(sandbox: true));
echo $session->session_id;
```

Getting Session by Session ID
-----------------------------

[](#getting-session-by-session-id)

To track the progress of a checkout session you can use the fetch method as shown below:

```
 $arifpay = new Arifpay('API KEY...');
// A sessionId will be returned when creating a session.
 $session = $arifpay->checkout->fetch('checkOutSessionID', new ArifpayOptions(true));
```

The following object represents a session

```
{
  public int $id,
  public ArifpayTransaction $transcation,
  public float $totalAmount,
  public bool $test,
  public string $uuid,
  public string $created_at,
  public string $update_at
}
```

Cancel Session by Session ID
----------------------------

[](#cancel-session-by-session-id)

If the merchant want to cancel a checkout session. it's now possible as shown below.

```
 $arifpay = new Arifpay('API KEY...');
// A sessionId will be returned when creating a session.
 $session = $arifpay->checkout->cancel('checkOutSessionID', new ArifpayOptions(true));
```

The `ArifpayCheckoutSession` class is returned.

DirectPay
---------

[](#directpay)

learn more about [DirectPay here](https://developer.arifpay.net/docs/direcPay/overview)

### DirectPay for telebirr

[](#directpay-for-telebirr)

```
     $session = $arifpay->checkout->create($data, new ArifpayOptions(true));

    return $arifpay->directPay->telebirr->pay($session->session_id);
```

### DirectPay for awash wallet

[](#directpay-for-awash-wallet)

```
     $session = $arifpay->checkout->create($data, new ArifpayOptions(true));

    return $arifpay->directPay->awash_wallet->pay($session->session_id);
```

### DirectPay for awash

[](#directpay-for-awash)

```
     $session = $arifpay->checkout->create($data, new ArifpayOptions(true));

    return $arifpay->directPay->awash->pay($session->session_id);
```

Change Log
==========

[](#change-log)

Released Date: `v1.1.1` Oct 03, 2022

- Initial Release

More Information
----------------

[](#more-information)

- [DirectPay](https://developer.arifpay.net/docs/direcPay/overview)
- [Check Full Example](https://github.com/Arifpay-net/-sample)
- [REST API Version](https://developer.arifpay.net/docs/checkout/overview)
- [Mobile SDK](https://developer.arifpay.net/docs/clientSDK/overview)
- [Change Log](https://developer.arifpay.net/docs/nodejs/changelog)
- [Node JS](https://developer.arifpay.net/docs/nodejs/overview)
- [](https://developer.arifpay.net/docs//overview)
- [Change Log](https://developer.arifpay.net/docs//changelog)

Credits
-------

[](#credits)

- [basliel](https://github.com/ba5liel)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Every ~0 days

Total

3

Last Release

1321d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/68ca89a16de513cc0a50818f26157522f096d78ce29687aaf8d8a5ca34843827?d=identicon)[ba5liel](/maintainers/ba5liel)

---

Top Contributors

[![ba5liel](https://avatars.githubusercontent.com/u/55631362?v=4)](https://github.com/ba5liel "ba5liel (6 commits)")

### Embed Badge

![Health badge](/badges/arifpay-phpsdk/health.svg)

```
[![Health](https://phpackages.com/badges/arifpay-phpsdk/health.svg)](https://phpackages.com/packages/arifpay-phpsdk)
```

###  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.1k9](/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)
