PHPackages                             tecnovice/dimplespay - 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. tecnovice/dimplespay

ActiveLibrary[API Development](/categories/api)

tecnovice/dimplespay
====================

A PHP library for interacting with the DimplesPay API.

00PHP

Since Nov 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Tecnovice/dimplespay-composer-php)[ Packagist](https://packagist.org/packages/tecnovice/dimplespay)[ RSS](/packages/tecnovice-dimplespay/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

**DimplesPay PHP SDK**
======================

[](#dimplespay-php-sdk)

[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)
A simple and flexible PHP SDK for integrating with the **DimplesPay API**, designed for seamless payment management.

---

**Features**
------------

[](#features)

- Authenticate with the DimplesPay API
- Perform transactions and manage payments
- Simplified HTTP requests using Guzzle
- Extendable for custom implementations

---

**Installation**
----------------

[](#installation)

To get started, install the SDK using Composer:

```
composer require tecnovice/dimplespay
```

Ensure you have PHP 8.0 or later installed.

---

**Usage**
---------

[](#usage)

### **Step 1: Configure Environment Variables**

[](#step-1-configure-environment-variables)

Create a `.env` file in your project root or set the environment variables directly in your system. Use the following keys:

```
DIMPLESPAY_CLIENT_ID=your-client-id
DIMPLESPAY_SECRET_ID=your-secret-id
DIMPLESPAY_BASE_URL=https://api.dimplespay.com
```

Alternatively, you can pass these directly to the client during initialization.

---

### **Step 2: Initialize the Client**

[](#step-2-initialize-the-client)

```
require 'vendor/autoload.php';

use DimplesPay\DimplesPayClient;

$client = new DimplesPayClient([
    'client_id' => 'your-client-id',
    'secret_id' => 'your-secret-id',
    'base_url' => 'https://api.dimplespay.com'
]);
```

---

### **Step 3: Fetch an Access Token**

[](#step-3-fetch-an-access-token)

```
$accessToken = $client->getAccessToken();
echo "Access Token: " . $accessToken['access_token'];
```

---

### **1. Authentication: Get Access Token**

[](#1-authentication-get-access-token)

Generate an access token to initiate secure API calls.

#### **Method:**

[](#method)

`POST /authentication/token`

#### **Example Usage:**

[](#example-usage)

```
require 'vendor/autoload.php';

use DimplesPay\DimplesPayClient;

$client = new DimplesPayClient([
    'client_id' => 'your-client-id',
    'secret_id' => 'your-secret-id',
    'base_url' => 'https://api.dimplespay.com'
]);

$response = $client->getAccessToken();

if ($response['status'] === 'success') {
    echo "Access Token: " . $response['access_token'];
    echo "Expires In: " . $response['expire_time'] . " seconds";
} else {
    echo "Failed to fetch token: " . $response['message'];
}
```

---

### **2. Initiate Payment**

[](#2-initiate-payment)

Start a new payment transaction.

#### **Endpoint:**

[](#endpoint)

`POST /payment/create`

#### **Required Parameters:**

[](#required-parameters)

- `amount`: (decimal) The transaction amount (must be rounded to 2 decimal places).
- `currency`: (string) Currency code in uppercase (e.g., "USD", "XAF").
- `return_url`: (string) URL to redirect after payment success.
- `cancel_url`: (string, optional) URL to redirect after payment failure.
- `custom`: (string, optional) Custom transaction ID for reference.

#### **Example Usage:**

[](#example-usage-1)

```
$response = $client->initiatePayment([
    'amount' => 100.00,
    'currency' => 'USD',
    'return_url' => 'https://example.com/success',
    'cancel_url' => 'https://example.com/cancel',
    'custom' => '123ABC456DEF'
]);

if ($response['status'] === 'success') {
    echo "Payment Created Successfully!";
    echo "Payment URL: " . $response['data']['payment_url'];
} else {
    echo "Payment Failed: " . $response['message'];
}
```

---

### **3. Check Payment Status**

[](#3-check-payment-status)

Retrieve the status of a payment.

#### **Endpoint:**

[](#endpoint-1)

`GET /payment/status`

#### **Required Parameters:**

[](#required-parameters-1)

- `token`: (string) The payment token obtained during payment initiation.

#### **Example Usage:**

[](#example-usage-2)

```
$response = $client->checkPaymentStatus('payment-token-here');

if ($response['status'] === 'success') {
    echo "Payment Status: SUCCESS";
    echo "Transaction ID: " . $response['data']['trx_id'];
    echo "Payer Email: " . $response['data']['payer']['email'];
} else {
    echo "Failed to fetch payment status: " . $response['message'];
}
```

---

**Error Handling**
------------------

[](#error-handling)

Every API call may throw an exception in case of invalid data or server issues. Wrap calls in try-catch blocks to handle errors gracefully.

```
try {
    $response = $client->initiatePayment([...]);
} catch (\DimplesPay\Exceptions\DimplesPayException $e) {
    echo "Error: " . $e->getMessage();
}
```

---

This documentation now focuses solely on the endpoints for **authentication**, **payment initiation**, and **payment status checks**. Include this in your `README.md` file for clarity and developer guidance. Let me know if any other adjustments are needed!

---

**Testing**
-----------

[](#testing)

Install PHPUnit to run tests:

```
composer install --dev
vendor/bin/phpunit
```

---

**Contributing**
----------------

[](#contributing)

We welcome contributions! To get started:

1. Fork the repository
2. Create a new branch for your feature/bugfix
3. Commit your changes
4. Submit a pull request

---

**License**
-----------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

---

**Support**
-----------

[](#support)

For issues or feature requests, please visit the [GitHub Issues page](https://github.com/tecnovice/dimplespay/issues).

---

Feel free to modify this as needed! Let me know if you’d like additional sections or further customization.

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19749244?v=4)[Lekunze Stanley Enow](/maintainers/happiguru)[@happiguru](https://github.com/happiguru)

---

Top Contributors

[![happiguru](https://avatars.githubusercontent.com/u/19749244?v=4)](https://github.com/happiguru "happiguru (6 commits)")

### Embed Badge

![Health badge](/badges/tecnovice-dimplespay/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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