AN Unofficial PHP SDK for ZainCash Iraq
Examples
·
Report a Bug
·
Request Feature
This is an Unofficial PHP (Composer & PSR Compatible) SDK to integrate ZainCash Iraq with php applications.
- The Official SDK is un-documented.
- The Official SDK is not Object Oriented (imperative).
- The Official SDK has some bad practices and 0 encapsulation of logic.
Most of the code here is not properly tested and hasn't been touched since i worked at ZainCash in 2015-2016.
Kindly, inspect the code closely and make sure it fits your needs.
The code is provided as-is and no guarantees are given regarding functionality/security.
While this project started when i used to work at ZainCash (2015-2016), I wrote all of this code on my own spare time.
While the package is not suited for production usage at its current stage, and is mainly intended for educational purposes (for now), below is how you can install it to an existing composer project:
Modify your composer.json
to add a repositories source and a require statement:
{
...
"repositories": [
{
"type": "vcs",
"url": "https://github.com/alhasaniq/zaincash-sdk.git"
}
],
"require": {
"alhasaniq/zaincash-sdk": "dev-master"
}
}
For Usage Examples, kindly refer to the examples
folder which includes 2 examples of the 2 main endpoints needed:
- An endpoint to initiate the transaction (charge the user), which redirects users to zaincash to finish the payment.
- Another endpoint to capture the transaction status and info, after being redirected back to your application (from zaincash).
The project is at a hobbyist-project state, where it is not properly tested/updated.
If you use this on production, your feedback is highly appreciated.
Distributed under the MIT License. See LICENSE
for more information.
Alhasan A. AL-Nasiry - @alhasaniq
Project Link: https://github.com/alhasaniq/zaincash-sdk