PHPackages                             credoteam/credo - 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. credoteam/credo

ActiveLibrary[API Development](/categories/api)

credoteam/credo
===============

This package is for communicating with CredoCentral.com API

03211[1 PRs](https://github.com/credogit/credo-php-sdk/pulls)PHP

Since Feb 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/credogit/credo-php-sdk)[ Packagist](https://packagist.org/packages/credoteam/credo)[ RSS](/packages/credoteam-credo/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

credo/credo-php
===============

[](#credocredo-php)

###### This package is for communicating with CREDO RESTful API. [Credo](https://credocentral.com/)

[](#this-package-is-for-communicating-with-credo-restful-api-credo)

Having other resource point available on CREDO API, Resources like;

- Transaction
- 3D Secure Payment via Card
- Verify Card Number
- Direct Card Charges
- and many more

Just to name a few, it is only the Transaction Resource that is made available currently in this package. Development is ongoing while releases are Stable.

Requirements
------------

[](#requirements)

- Curl

Install
-------

[](#install)

### Via Composer

[](#via-composer)

```
$ composer require credoteam/credo:dev-main
```

If you use a Framework, check your documentation for how vendor packages are autoloaded else Add this to the top of your source file;

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

Making Transactions/Recieving Payment
-------------------------------------

[](#making-transactionsrecieving-payment)

### Starting Up Credo Transaction

[](#starting-up-credo-transaction)

```
use Credoteam\Credo\Transaction;
use Credoteam\Credo\Helpers\Debugger;
use Credoteam\Credo\Helpers\Requesters;

$publicKey =  "pk_demo-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxx-d";
$secretKey = "sk_demo-xxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxx-d";

// creating the transaction object
$Transaction = new Transaction( $publicKey );
```

### Initializing Transaction

[](#initializing-transaction)

Set data/payload/requestBody to post with initialize request. Minimum required data are email and amount.

```
// Set data to post using array
$data = [
  "amount"=> 3000,
  "currency"=> "NGN",
  "redirectUrl"=> "http://localhost:8080/test-credo/welcome/",
  "transRef"=> "748rbrio4823ruoqedb9h4378e", //you can send your transaction ref or allow Credo generate for you
  "paymentOptions"=> "CARD",
  "customerEmail"=> "adiegodswill17@gmail.com",
  "customerName"=> "Adie Godswill",
  "customerPhoneNo"=> "09021960905"
];

$response = $Transaction->initialize($data);
```

If you want to get the 200OK raw Object as it is sent by Credo, Set the 2nd argument of the `initialize()` to `true`, example below

```
// Set data to post using this method
$response =
        $Transaction
            ->setEmail( 'adiegodswill17@gmail.com' )
            ->setAmount( 23000 )
            ->initialize([], true);
```

Now do a redirect to payment page (using redirectUrl)
NOTE: Recommended to Debug `$response` or check if redirectUrl is set, and save your Transaction reference code. useful to verify Transaction status

```
// recommend to save Transaction reference in database and do a redirect
$transRef = $response->transRef;
// redirect
Http::redirect($response->redirectUrl);
```

Using a Framework? It is recommended you use the reverse routing/redirection functions provided by your Framework

### Verifying Transaction

[](#verifying-transaction)

It is also imperative that you create Transaction Object once more.
This method would return the Transaction Object but `false` if saved `$transRef` is not passed in as argument and also cant be guessed. Using `verify()` would require you do a manual check on the response Object

```
// creating the transaction object
$Transaction = new Transaction( $secretKey );

// Set data to post using this method
$response = $Transaction->verify($transRef);

// Debuging the $response
Debugger::print_r( $response);
```

OR

```
// This method does the check for you and return `(bool) true|false`
$response = $Transaction->isSuccessful();
```

The two methods above try to guess your Transaction `$transRef` but it is highly recommended you pass the Transaction `$transRef` as an argument on the method as follows

```
// This method does the check for you and return `(bool) true|false`
$response = $Transaction->isSuccessful($transRef);
```

### Direct Card Charge

[](#direct-card-charge)

Set data/payload/requestBody to post with direct charge request.

```
// Set data to post using array
$data = [
  "orderAmount" => 400,
  "orderCurrency" => "NGN",
  "cardNumber" => 4242424242424242,
  "expiryMonth" => 1,
  "expiryYear" => 22,
  "securityCode" => 439,
  "transRef" => "748rbri4823ruoqedb9h435",
	"customerEmail" => "adiegodswill17@gmail.com",
	"customerName" => "Adie Godswill",
	"customerPhoneNo" => "09021960905"
];

// creating the transaction object
$Transaction = new Transaction( $secretKey );

// Set data to post using this method
$response = $Transaction->direct_charge($data);
```

### Verify Card Number

[](#verify-card-number)

Set data/payload/requestBody to post with verifying a card number request.

```
// Set data to post using array
$data = [
 	"cardNumber" => 4242424242424242,
 	"orderCurrency" => "NGN",
  "paymentSlug" => "pIEiYn8xxxxxxxxxxxxx"
];

// creating the transaction object
$Transaction = new Transaction( $secretKey );

// Set data to post using this method
$response = $Transaction->verify_card_number($data);
```

### 3D Secure Payment via Card

[](#3d-secure-payment-via-card)

Set data/payload/requestBody to post with performing a 3D Secure payment request.

```
// Set data to post using array
$data = [
  "amount" => 4500,
  "currency" => "NGN",
  "redirectUrl" => "http://localhost/go",
  "transRef" => "748389842939e3",
  "paymentOptions" => "CARD",
  "customerEmail" => "adiegodswill17@gmail.com",
  "customerName" => "Adie Godswill",
  "customerPhoneNo" => "09021960905"
];

// creating the transaction object
$Transaction = new Transaction( $secretKey );

// Set data to post using this method
$response = $Transaction->payment_3ds($data);
```

Contributions
-------------

[](#contributions)

If you seem to understand the architecture, you are welcome to fork and pull else you can wait a bit more till when we provide convention documentation.

Licence
-------

[](#licence)

GNU GPLV3

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.7% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e8f70fba444a0132a146c59bc0553d74f548c17b29e2557a80d5f53d55726e14?d=identicon)[credocentral](/maintainers/credocentral)

---

Top Contributors

[![credogithub](https://avatars.githubusercontent.com/u/77614737?v=4)](https://github.com/credogithub "credogithub (8 commits)")[![geektutor](https://avatars.githubusercontent.com/u/28659143?v=4)](https://github.com/geektutor "geektutor (2 commits)")[![obakolefunmi](https://avatars.githubusercontent.com/u/23407115?v=4)](https://github.com/obakolefunmi "obakolefunmi (2 commits)")

### Embed Badge

![Health badge](/badges/credoteam-credo/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M474](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M33](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

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