PHPackages                             dotapay/laravel-sdk - 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. [Payment Processing](/categories/payments)
4. /
5. dotapay/laravel-sdk

ActiveLibrary[Payment Processing](/categories/payments)

dotapay/laravel-sdk
===================

Laravel SDK for integrating with DotaPay (customers, payment, settlements) using Private Key auth.

v1.0.5(4mo ago)1232MITPHPPHP ^8.1

Since Dec 19Pushed 4mo agoCompare

[ Source](https://github.com/DOTALINKNG/dotapay-laravel-wrapper)[ Packagist](https://packagist.org/packages/dotapay/laravel-sdk)[ RSS](/packages/dotapay-laravel-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (5)Versions (9)Used By (0)

DotaPay Laravel SDK
===================

[](#dotapay-laravel-sdk)

A small Laravel-friendly SDK for calling DotaPay APIs:

- `customers/*`
- `payment/*`
- `settlements/*`

Authentication is handled with a **Private Key** sent as a request header (default: `DPPRIVATEKEY`).

> This package is an SDK (HTTP client). It does **not** add routes to your application.

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

[](#requirements)

- PHP 8.1+
- Laravel 10 or 11

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

[](#installation)

```
composer require dotapay/laravel-sdk
```

Publish the config (optional):

```
php artisan vendor:publish --tag=dotapay-config
```

Configuration
-------------

[](#configuration)

Add these to `.env`:

```
DOTAPAY_BASE_URL=https://YOUR-TENANT-DOMAIN.dotapay.ng
DOTAPAY_API_PREFIX=api/v1
DOTAPAY_PRIVATE_KEY=PRIV_DP_xxxxxx
DOTAPAY_PRIVATE_KEY_HEADER=DPPRIVATEKEY
```

Usage
-----

[](#usage)

### Customers

[](#customers)

```
use DotaPay\LaravelSdk\Facades\Dotapay;

// Create (fails if reference exists)
$created = Dotapay::customers()->create([
  'first_name' => 'John',
  'last_name' => 'Doe',
  'bvn' => '12345678901',
  'dob' => '1998-03-17',
  'email' => 'john@example.com',
  'reference' => 'my-app-user-123',
  'type' => 'wallet',
]);

// Create-or-get (idempotent by reference)
$customer = Dotapay::customers()->createOrGetByReference([
  'first_name' => 'John',
  'last_name' => 'Doe',
  'bvn' => '12345678901',
  'dob' => '1998-03-17',
  'email' => 'john@example.com',
  'reference' => 'my-app-user-123',
  'type' => 'wallet',
]);

// Show by id/code/reference
$found = Dotapay::customers()->show('my-app-user-123');

// Balance
$balance = Dotapay::customers()->balance('my-app-user-123');
```

### Payment

[](#payment)

```
$txn = Dotapay::payment()->request([
  'public_key' => 'PUB_DP_xxxxx',
  'order_id' => 'ORDER-10001',
  'customer_email' => 'john@example.com',
  'customer_name' => 'John Doe',
  'items' => [
    ['id' => 'sku-1', 'name' => 'Item 1', 'unit_cost' => 1000, 'quantity' => 1],
  ],
]);

$status = Dotapay::payment()->status($txn['transaction']['data']['reference'] ?? 'REF_...');
```

### Settlements

[](#settlements)

```
$list = Dotapay::settlements()->index(['per_page' => 20]);

$withdraw = Dotapay::settlements()->withdraw([
  'wallet_id' => 'WALLET_ABC_live',
  'amount' => 5000, // NGN
  'settlement_bank_id' => 'SETTBANK_...',
]);

$direct = Dotapay::settlements()->withdrawDirect([
  'wallet_id' => 'WALLET_ABC_live',
  'amount' => 5000, // NGN
  'bank_code' => '058',
  'account_number' => '0123456789',
  'reference' => 'WD-'.now()->timestamp,
]);

/**
 * Customer-scoped withdrawals
 * $identifier can be customer id / code / reference (same pattern as customers()->show())
 */

// Customer -> settlement bank (uses customer context)
$customerWithdraw = Dotapay::settlements()->withdrawCustomer('my-app-user-123', [
  'amount' => 5000,
  'settlement_bank_id' => 'SETTBANK_...',
  // 'reference' => 'CWD-'.now()->timestamp,
]);

// Customer -> bank account (direct)
$customerDirect = Dotapay::settlements()->withdrawDirectCustomer('my-app-user-123', [
  'amount' => 5000,
  'bank_code' => '058',
  'account_number' => '0123456789',
  'reference' => 'CWD-'.now()->timestamp,
]);

/**
 * Customer wallet transfer (customer -> wallet)
 * Useful when you want to move funds from a customer's wallet to another wallet (e.g. business wallet)
 */
$customerWalletTransfer = Dotapay::settlements()->withdrawCustomerWallet('my-app-user-123', [
  'amount' => 5000,
  'wallet_id' => 'DEST_WALLET_live', // destination wallet slug/id (as required by your API)
  'reference' => 'CWT-'.now()->timestamp,
]);

/**
 * Bulk direct withdrawals
 */
$bulk = Dotapay::settlements()->withdrawDirectBulk([
  'wallet_id' => 'WALLET_ABC_live',
  'items' => [
    [
      'amount' => 5000,
      'bank_code' => '058',
      'account_number' => '0123456789',
      'reference' => 'WD-'.now()->timestamp.'-1',
    ],
    [
      'amount' => 7500,
      'bank_code' => '011',
      'account_number' => '0001112223',
      'reference' => 'WD-'.now()->timestamp.'-2',
    ],
  ],
]);
```

Multi-merchant platforms
------------------------

[](#multi-merchant-platforms)

If your application holds multiple DotaPay private keys, you can swap the key per request:

```
$dotapay = app('dotapay')->usingPrivateKey($businessPrivateKey);
$customer = $dotapay->customers()->show('my-ref');
```

Error handling
--------------

[](#error-handling)

By default, non-2xx responses throw `DotaPay\LaravelSdk\Exceptions\DotapayRequestException`. Disable throws via:

```
DOTAPAY_THROW=false
```

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance78

Regular maintenance activity

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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

Total

8

Last Release

121d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2e77ac8b1d29d49492dda2cfedbba6f35c211e3d1e5d49bdbd5a193a58310d21?d=identicon)[impozzible](/maintainers/impozzible)

---

Top Contributors

[![tescoint](https://avatars.githubusercontent.com/u/13892299?v=4)](https://github.com/tescoint "tescoint (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dotapay-laravel-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/dotapay-laravel-sdk/health.svg)](https://phpackages.com/packages/dotapay-laravel-sdk)
```

###  Alternatives

[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[asciisd/knet

Knet package is provides an expressive, fluent interface to KNet's payment services.

141.1k](/packages/asciisd-knet)

PHPackages © 2026

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