php-cellulant

Cellulant for PHP

Latest Version on Packagist Tests Total Downloads

Cellulant for PHP is a PHP client for the Tingg API a product of Cellulant.

Features

The package is centered around Custom Checkout APIs provided by Tingg. It provides the following features:

Installation

Pre-requisites

Preferable way to install is with Composer.

You can install the package via Composer:

composer require alphaolomi/php-cellulant

Usage

use Alphaolomi\CellulantService;

$cellulant = new CellulantService([
    'clientId' => 'your clientId',
    'clientSecret' => 'your clientSecret',
    'apiKey' => 'your api key',
    'serviceCode' => 'your service code',
    'callbackUrl' => 'your callback url',
    'env' => 'sandbox', // or 'production' // default is sandbox
]);


// Authentication
// Get the access token
$authRes = $cellulant->authenticate();
// $authRes is an array with the following keys
// [
//  "token_type" => "bearer",
//  "expires_in" => 3600,
//  "access_token" => "WU3My1AHOcKsnxj3n",
//  "refresh_token" =>   "GSWtHRnJrMHBzdEFPbjhNS0FjODIwMTU1NVlTb3c9PQ=="
// ]

// Checkout Request
$checkoutRes = $cellulant->checkoutRequest([
    // ... Tingg Checkout Request Payload
]);

// Charge Request
$chargeRes = $cellulant->chargeRequest([
    // ... Tingg Charge Request Payload
]);

// Query Status
$queryRes = $cellulant->queryStatus([
    // ... Tingg Checkout Status Payload
]);

// Acknowledgement Request
$ackRes = $cellulant->acknowledgementRequest([
    // ... Tingg Acknowledgement Payload
]);

// Refund Request
$refundRes = $cellulant->refundRequest([
    // ... Tingg Refund Payload
]);

Refer to Features Test Cases for more usage examples.

Refer to Tingg API documentation for the required parameters reference for each method.

Notes

Testing

Tests are written with Pest. To run the tests:

composer test

Support the development

Do you like this project? Support it by Star this repository ⭐️ and follow me on Twitter for more updates 👍.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Versioning

This project follows RomVer.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

If you discover a security vulnerability within Laravel, please send an e-mail to Alpha Olomi via alphaolomi@gmail.com. All security vulnerabilities will be promptly addressed.

Credits

Reaching Me

If you are having issues with this package, feel free to contact me on Twitter.

License

The MIT License (MIT). Please see License File for more information.