PHPackages                             obaidkhattak/pqapiv2 - 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. [API Development](/categories/api)
4. /
5. obaidkhattak/pqapiv2

ActiveLibrary[API Development](/categories/api)

obaidkhattak/pqapiv2
====================

desc

v1.0.6(3y ago)05MITPHPPHP &gt;=7.2 &lt;8.2

Since Aug 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Obaid-Rehman/PHP)[ Packagist](https://packagist.org/packages/obaidkhattak/pqapiv2)[ Docs](https://www.payquicker.com)[ RSS](/packages/obaidkhattak-pqapiv2/feed)WikiDiscussions main Synced 1mo ago

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

Getting Started with PQ API v2
==============================

[](#getting-started-with-pq-api-v2)

Introduction
------------

[](#introduction)

desc

Building
--------

[](#building)

The generated code has dependencies over external libraries like UniRest. These dependencies are defined in the `composer.json` file that comes with the SDK. To resolve these dependencies, we use the Composer package manager which requires PHP greater than or equal to 7.2 installed in your system. Visit  to download the installer file for Composer and run it in your system. Open command prompt and type `composer --version`. This should display the current version of the Composer installed if the installation was successful.

- Using command line, navigate to the directory containing the generated files (including `composer.json`) for the SDK.
- Run the command `composer install`. This should install all the required dependencies and create the `vendor` directory in your project directory.

[![Building SDK - Step 1](https://camo.githubusercontent.com/c6819a2692fb57f22d45c89d77e11d4242781e5e8f8bc90f7211a4c41adbe55d/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d696e7374616c6c446570656e64656e63696573)](https://camo.githubusercontent.com/c6819a2692fb57f22d45c89d77e11d4242781e5e8f8bc90f7211a4c41adbe55d/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d696e7374616c6c446570656e64656e63696573)

### Configuring CURL Certificate Path in php.ini

[](#configuring-curl-certificate-path-in-phpini)

ℹ️ **Note** This is for Windows users only.

CURL used to include a list of accepted CAs, but no longer bundles ANY CA certs. So by default it will reject all SSL certificates as unverifiable. You will have to get your CA's cert and point curl at it. The steps are as follows:

1. Download the certificate bundle (.pem file) from  on to your system.
2. Add curl.cainfo = "PATH\_TO/cacert.pem" to your php.ini file located in your php installation. “PATH\_TO” must be an absolute path containing the .pem file.

```
[curl]; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = PATH_TO/cacert.pem

```

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

[](#installation)

The following section explains how to use the PQAPIV2Lib library in a new project.

### 1. Open Project in an IDE

[](#1-open-project-in-an-ide)

Open an IDE for PHP like PhpStorm. The basic workflow presented here is also applicable if you prefer using a different editor or IDE.

[![Open project in PHPStorm - Step 1](https://camo.githubusercontent.com/eab9643eaa9fcd373e9398eadb9eb39d8d6012ff8ec524389c122670240205b7/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d6f70656e494445)](https://camo.githubusercontent.com/eab9643eaa9fcd373e9398eadb9eb39d8d6012ff8ec524389c122670240205b7/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d6f70656e494445)

Click on `Open` in PhpStorm to browse to your generated SDK directory and then click `OK`.

[![Open project in PHPStorm - Step 2](https://camo.githubusercontent.com/dbab75c83d67460809a105b42cca9419e4682880bcdfd0069b4878312edbc4ae/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d6f70656e50726f6a65637430)](https://camo.githubusercontent.com/dbab75c83d67460809a105b42cca9419e4682880bcdfd0069b4878312edbc4ae/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d6f70656e50726f6a65637430)

### 2. Add a new Test Project

[](#2-add-a-new-test-project)

Create a new directory by right clicking on the solution name as shown below:

[![Add a new project in PHPStorm - Step 1](https://camo.githubusercontent.com/e7c5c84a418339cecbd1c81922fcfd6ecbca4da19bfca99002b371e4d858fae5/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d6372656174654469726563746f7279)](https://camo.githubusercontent.com/e7c5c84a418339cecbd1c81922fcfd6ecbca4da19bfca99002b371e4d858fae5/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d6372656174654469726563746f7279)

Name the directory as "test".

[![Add a new project in PHPStorm - Step 2](https://camo.githubusercontent.com/b2d64a981ffd250462b31f2d84ca6dd5790a9c303328c16c902b930aaa2f8827/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d6e616d654469726563746f7279)](https://camo.githubusercontent.com/b2d64a981ffd250462b31f2d84ca6dd5790a9c303328c16c902b930aaa2f8827/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d6e616d654469726563746f7279)

Add a PHP file to this project.

[![Add a new project in PHPStorm - Step 3](https://camo.githubusercontent.com/c343696ffd28baf90d2fdee842191c87ffedb62e845cd1a66bc5c21f31c647e5/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d63726561746546696c65)](https://camo.githubusercontent.com/c343696ffd28baf90d2fdee842191c87ffedb62e845cd1a66bc5c21f31c647e5/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d63726561746546696c65)

Name it "testSDK".

[![Add a new project in PHPStorm - Step 4](https://camo.githubusercontent.com/4c44c0564fbe5691ea5be7ce229a67b6e5ba9004174fc53c0244377fc4bb7f99/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d6e616d6546696c65)](https://camo.githubusercontent.com/4c44c0564fbe5691ea5be7ce229a67b6e5ba9004174fc53c0244377fc4bb7f99/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d6e616d6546696c65)

Depending on your project setup, you might need to include composer's autoloader in your PHP code to enable auto loading of classes.

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

It is important that the path inside require\_once correctly points to the file `autoload.php` inside the vendor directory created during dependency installations.

[![Add a new project in PHPStorm - Step 5](https://camo.githubusercontent.com/6d69f3ae4443329ede56b18a31a8536583fc66509bc1f82da987d2a49969b4ff/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d70726f6a65637446696c6573)](https://camo.githubusercontent.com/6d69f3ae4443329ede56b18a31a8536583fc66509bc1f82da987d2a49969b4ff/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d70726f6a65637446696c6573)

After this you can add code to initialize the client library and acquire the instance of a Controller class. Sample code to initialize the client library and use the Controller methods is given in the subsequent sections.

### 3. Run the Test Project

[](#3-run-the-test-project)

To run your project you must set the Interpreter for your project. Interpreter is the PHP engine installed on your computer.

Open `Settings` from `File` menu.

[![Run Test Project - Step 1](https://camo.githubusercontent.com/fb824f81197a56314dd8f5761c8fe73ee0a39a47807f213c1c2a07af7f7f4bdf/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d6f70656e53657474696e6773)](https://camo.githubusercontent.com/fb824f81197a56314dd8f5761c8fe73ee0a39a47807f213c1c2a07af7f7f4bdf/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d6f70656e53657474696e6773)

Select `PHP` from within `Languages & Frameworks`.

[![Run Test Project - Step 2](https://camo.githubusercontent.com/63a3154dfa25f67d6956eaaf6b62b0f6fd2d96b6f73f9df12e3bd13dc3194488/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d736574496e74657270726574657230)](https://camo.githubusercontent.com/63a3154dfa25f67d6956eaaf6b62b0f6fd2d96b6f73f9df12e3bd13dc3194488/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d736574496e74657270726574657230)

Browse for Interpreters near the `Interpreter` option and choose your interpreter.

[![Run Test Project - Step 3](https://camo.githubusercontent.com/a90e6c233f544946ca52572345ce745cc7615c56cc8d63cd30379ddda2b82f26/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d736574496e74657270726574657231)](https://camo.githubusercontent.com/a90e6c233f544946ca52572345ce745cc7615c56cc8d63cd30379ddda2b82f26/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d736574496e74657270726574657231)

Once the interpreter is selected, click `OK`.

[![Run Test Project - Step 4](https://camo.githubusercontent.com/e41fd527af3bbee25900184177f421ddda4a77d0dac691d9e6a27d186a7f88f1/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d736574496e74657270726574657232)](https://camo.githubusercontent.com/e41fd527af3bbee25900184177f421ddda4a77d0dac691d9e6a27d186a7f88f1/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d736574496e74657270726574657232)

To run your project, right click on your PHP file inside your Test project and click on `Run`.

[![Run Test Project - Step 5](https://camo.githubusercontent.com/d8d9772c51abd60e5b80c87561352abb49a875c460cd23d7f23eafcfd267760d/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d72756e50726f6a656374)](https://camo.githubusercontent.com/d8d9772c51abd60e5b80c87561352abb49a875c460cd23d7f23eafcfd267760d/68747470733a2f2f617069646f63732e696f2f696c6c757374726174696f6e2f7068703f776f726b7370616365466f6c6465723d5051415049563226737465703d72756e50726f6a656374)

Test the SDK
------------

[](#test-the-sdk)

Unit tests in this SDK can be run using PHPUnit.

1. First install the dependencies using composer including the `require-dev` dependencies.
2. Run `vendor\bin\phpunit --verbose` from commandline to execute tests. If you have installed PHPUnit globally, run tests using `phpunit --verbose` instead.

You can change the PHPUnit test configuration in the `phpunit.xml` file.

Initialize the API Client
-------------------------

[](#initialize-the-api-client)

***Note:*** Documentation for the client can be found [here.](doc/client.md)

The following parameters are configurable for the API Client:

ParameterTypeDescription`environment`EnvironmentThe API environment.
 **Default: `Environment.PRODUCTION`**`timeout``int`Timeout for API calls in seconds.
*Default*: `0``enableRetries``bool`Whether to enable retries and backoff feature.
*Default*: `false``numberOfRetries``int`The number of retries to make.
*Default*: `0``retryInterval``float`The retry time interval between the endpoint calls.
*Default*: `1``backOffFactor``float`Exponential backoff factor to increase interval between retries.
*Default*: `2``maximumRetryWaitTime``int`The maximum wait time in seconds for overall retrying requests.
*Default*: `0``retryOnTimeout``bool`Whether to retry on request timeout.
*Default*: `true``httpStatusCodesToRetry``array`Http status codes to retry against.
*Default*: `408, 413, 429, 500, 502, 503, 504, 521, 522, 524, 408, 413, 429, 500, 502, 503, 504, 521, 522, 524``httpMethodsToRetry``array`Http methods to retry against.
*Default*: `'GET', 'PUT', 'GET', 'PUT'`The API client can be initialized as follows:

```
$client = new PQAPIV2Lib\PQAPIV2Client([
    // Set the environment
    'environment' => 'production',
]);
```

List of APIs
------------

[](#list-of-apis)

- [Payments](doc/controllers/payments.md)
- [Transfers](doc/controllers/transfers.md)
- [Spend Back](doc/controllers/spend-back.md)
- [Prepaid Cards](doc/controllers/prepaid-cards.md)
- [Paper Checks](doc/controllers/paper-checks.md)
- [Bank Accounts](doc/controllers/bank-accounts.md)
- [Balances](doc/controllers/balances.md)
- [Receipts](doc/controllers/receipts.md)
- [Users](doc/controllers/users.md)
- [Documents](doc/controllers/documents.md)
- [Webhooks](doc/controllers/webhooks.md)
- [Program](doc/controllers/program.md)

Classes Documentation
---------------------

[](#classes-documentation)

- [ApiException](doc/api-exception.md)
- [HttpRequest](doc/http-request.md)
- [HttpResponse](doc/http-response.md)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

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

Total

6

Last Release

1312d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/35a59607d1467300b232925406b536e16728c4e3c1d00023899680997def29eb?d=identicon)[obaidkhattak](/maintainers/obaidkhattak)

---

Top Contributors

[![Obaid-Rehman](https://avatars.githubusercontent.com/u/54360008?v=4)](https://github.com/Obaid-Rehman "Obaid-Rehman (12 commits)")

---

Tags

apisdkPQ API v2

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/obaidkhattak-pqapiv2/health.svg)

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

###  Alternatives

[square/square

Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.

793.4M20](/packages/square-square)[bandwidth/sdk

Bandwidth's set of APIs

16948.8k1](/packages/bandwidth-sdk)

PHPackages © 2026

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