PHPackages                             swport/exp-php-sdk - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. swport/exp-php-sdk

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

swport/exp-php-sdk
==================

A simple library for PHP integrators

1.0.2(5y ago)03MITPHPPHP ^7.0

Since Jul 8Pushed 4y agoCompare

[ Source](https://github.com/swport/swport-php-sdk)[ Packagist](https://packagist.org/packages/swport/exp-php-sdk)[ RSS](/packages/swport-exp-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

 [![](https://camo.githubusercontent.com/1029cd11cfee9e0f2dee14f9d3a5fda454124e1dfe694b0abe11b2abeda8a304/68747470733a2f2f6578707265737370617967682e636f6d2f696d616765732f6c6f676f2e706e67)](https://camo.githubusercontent.com/1029cd11cfee9e0f2dee14f9d3a5fda454124e1dfe694b0abe11b2abeda8a304/68747470733a2f2f6578707265737370617967682e636f6d2f696d616765732f6c6f676f2e706e67)

Expresspay PHP SDK
==================

[](#expresspay-php-sdk)

A simple library for PHP integrators

---

Install
=======

[](#install)

- Install composer for your environment - (Composer)\[\]
- Import package via composer using the command below

```
composer require expresspaygh/exp-php-sdk
```

---

Demo / Test
===========

[](#demo--test)

- Browser Demo: \[\]
- Unit Test: `make phpunit` or `composer run test`

---

How to use
==========

[](#how-to-use)

Allowed Environments
--------------------

[](#allowed-environments)

- Sandbox - "sandbox"
- Production - "production"

---

Submit request
--------------

[](#submit-request)

This request creates a new invoice to process a payment, below you will find an example request and response.

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

use Expay\SDK\MerchantApi as ExpressPayMerchantApi;

/**
 * $this->merchant_id = Your expressPay merchant id
 * $this->merchant_key = Your expressPay merchant api key
 * $this->environment = Your preferred environment, allowed params ('sandbox' or 'production')
 */
$merchantApi = new ExpressPayMerchantApi($this->merchant_id, $this->merchant_key, $this->environment);

/**
 * submit
 *
 * string $currency
 * float $amount
 * string $order_id
 * string $order_desc
 * string $redirect_url
 * string $account_number
 * string | null $order_img_url
 * string | null $first_name
 * string | null $last_name
 * string | null $phone_number
 * string | null $email
 */
$response = $merchantApi->submit(
  "GHS",
  20.00,
  "0925469924813",
  "Test create invoice",
  "https://expresspaygh.com",
  "1234567890",
  "https://expresspaygh.com/images/logo.png",
  "Jeffery",
  "Osei",
  "233545512042",
  "jefferyosei@expresspaygh.com"
);

// print
var_dump($response);
```

```
array(13) {
  ["status"]=> int(1)
  ["order-id"]=> string(13) "0925469924813"
  ["guest-checkout"]=> string(4) "TRUE"
  ["merchantservice-name"]=> string(3) "TEST"
  ["merchantservice-srvrtid"]=> string(12) "089908783876"
  ["message"]=> string(7) "Success"
  ["token"]=> string(64) "43165f2bcf90eef856.514313495f2bcf90eef8b1.85035432516432mjhyte"
  ["redirect-url"]=> string(24) "https://expresspaygh.com"
  ["user-key"]=> NULL
  ["merchant-name"]=> string(3) "TEST"
  ["merchant-mcc"]=> string(4) "1234"
  ["merchant-city"]=> string(5) "Accra"
  ["merchant-countrycode"]=> string(2) "GH"
}

```

---

Checkout request
----------------

[](#checkout-request)

This request creates a checkout url for a customer to make payment on expressPay, below you will find an example request and response.

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

use Expay\SDK\MerchantApi as ExpressPayMerchantApi;

/**
 * $this->merchant_id = Your expressPay merchant id
 * $this->merchant_key = Your expressPay merchant api key
 * $this->environment = Your preferred environment, allowed params ('sandbox' or 'production')
 */
$merchantApi = new ExpressPayMerchantApi($this->merchant_id, $this->merchant_key, $this->environment);

/*
* Token returned from your "Submit" request
*/
$token = "43165f2bcf90eef856.514313495f2bcf90eef8b1.85035432516432mjhyte";

/**
 * checkout
 *
 * string $token
 */
$response = $merchantApi->checkout($token);

// print
var_dump($response);
```

```

string(120) "https://sandbox.expresspaygh.com/api/checkout.php?token=43165f2bcf90eef856.514313495f2bcf90eef8b1.85035432516432mjhyte"

```

---

Query request - Before payment
------------------------------

[](#query-request---before-payment)

This request checks the payment status for an invoice on expressPay, below you will find an example request and response for an unpaid invoice.

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

use Expay\SDK\MerchantApi as ExpressPayMerchantApi;

/**
 * $this->merchant_id = Your expressPay merchant id
 * $this->merchant_key = Your expressPay merchant api key
 * $this->environment = Your preferred environment, allowed params ('sandbox' or 'production')
 */
$merchantApi = new ExpressPayMerchantApi($this->merchant_id, $this->merchant_key, $this->environment);

/*
* Token returned from your "Submit" request
*/
$token = "43165f2bcf90eef856.514313495f2bcf90eef8b1.85035432516432mjhyte";

/**
 * checkout
 *
 * string $token
 */
$response = $merchantApi->query($token);

// print
var_dump($response);
```

```
array(6) {
  ["result"]=> int(3)
  ["result-text"]=> string(29) "No transaction data available"
  ["order-id"]=> string(13) "0925469924813"
  ["token"]=> string(64) "43165f2bcf90eef856.514313495f2bcf90eef8b1.85035432516432mjhyte"
  ["currency"]=> string(3) "GHS"
  ["amount"]=> string(2) "20"
}

```

---

Query request - After payment
-----------------------------

[](#query-request---after-payment)

This request checks the payment status for an invoice on expressPay, below you will find an example request and response for a paid invoice.

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

use Expay\SDK\MerchantApi as ExpressPayMerchantApi;

/**
 * $this->merchant_id = Your expressPay merchant id
 * $this->merchant_key = Your expressPay merchant api key
 * $this->environment = Your preferred environment, allowed params ('sandbox' or 'production')
 */
$merchantApi = new ExpressPayMerchantApi($this->merchant_id, $this->merchant_key, $this->environment);

/*
* Token returned from your "Submit" request
*/
$token = "43165f2bcf90eef856.514313495f2bcf90eef8b1.85035432516432mjhyte";

/**
 * checkout
 *
 * string $token
 */
$response = $merchantApi->query($token);

// print
var_dump($response);
```

```
array(15) {
  ["result"]=> int(1)
  ["result-text"]=> string(7) "Success"
  ["order-id"]=> string(13) "0925469924813"
  ["token"]=> string(64) "43165f2bcf90eef856.514313495f2bcf90eef8b1.85035432516432mjhyte"
  ["currency"]=> string(3) "GHS"
  ["amount"]=> string(2) "20"
  ["auth-code"]=> string(6) "831000"
  ["transaction-id"]=> string(13) "030556c7x8c56"
  ["date-processed"]=> string(19) "2020-08-06 11:36:16"
  ["paid_from"]=> string(16) "411111******1111"
  ["payment_type"]=> string(7) "XPAY_GW"
  ["payment_reference"]=> string(6) "831000"
  ["payment_option"]=> string(4) "VISA"
  ["payment_option_type"]=> string(7) "CARDNET"
  ["payment_option_type_name"]=> string(34) "Visa, Mastercard, Amex or Discover"
}

```

---

Copyright 2020, All rights reserved. Expresspay Ghana Limited \[\]

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71% 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 ~40 days

Total

3

Last Release

2050d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a7fba1ada794ffbd8260231832af14f19cbb7fc77820bbb312fbb74618ec8f7?d=identicon)[swport](/maintainers/swport)

---

Top Contributors

[![expclonne101](https://avatars.githubusercontent.com/u/66310158?v=4)](https://github.com/expclonne101 "expclonne101 (22 commits)")[![swport](https://avatars.githubusercontent.com/u/25667006?v=4)](https://github.com/swport "swport (4 commits)")[![dwarukira](https://avatars.githubusercontent.com/u/38427824?v=4)](https://github.com/dwarukira "dwarukira (3 commits)")[![dharmendrashah](https://avatars.githubusercontent.com/u/29393652?v=4)](https://github.com/dharmendrashah "dharmendrashah (1 commits)")[![kofinyarko](https://avatars.githubusercontent.com/u/50238226?v=4)](https://github.com/kofinyarko "kofinyarko (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/swport-exp-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/swport-exp-php-sdk/health.svg)](https://phpackages.com/packages/swport-exp-php-sdk)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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