PHPackages                             dime-technology/dime-php-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. dime-technology/dime-php-sdk

ActiveLibrary[Payment Processing](/categories/payments)

dime-technology/dime-php-sdk
============================

Official PHP SDK for the Dime Payments API.

v1.0.0(1mo ago)00[1 issues](https://github.com/dime-technology/dime-php-sdk/issues)MITPHPPHP ^8.3CI passing

Since Jun 11Pushed 3d agoCompare

[ Source](https://github.com/dime-technology/dime-php-sdk)[ Packagist](https://packagist.org/packages/dime-technology/dime-php-sdk)[ Docs](https://github.com/dime-technology/dime-php-sdk)[ RSS](/packages/dime-technology-dime-php-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (2)Used By (0)

Dime Payments PHP SDK
=====================

[](#dime-payments-php-sdk)

A typed PHP client for the [Dime Payments](https://dimepayments.com) API. It wraps the HTTP contract — authentication, the `data`/`filters` request envelope, cursor pagination, and error handling — behind small, predictable resource methods that return readonly data objects.

```
$dime = new \DimePayments\Sdk\Client('your-api-token');

$transaction = $dime->transactions->chargeCard('000010', [
    'amount' => 49.99,
    'token'  => 'tok_abc123',
]);

echo $transaction->transactionStatus;  // "Success"
```

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

[](#requirements)

- PHP 8.3+
- A Dime API token (a Laravel Sanctum personal access token). Tokens are minted inside the Dime application/admin, not via this SDK, and carry abilities (e.g. `transaction:charge-card-token`, `customer:read`, `merchant:update`) that gate which calls succeed.

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

[](#installation)

```
composer require dime-technology/dime-php-sdk
```

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

[](#configuration)

The simplest setup needs only a token (the base URL defaults to `https://app.dimepayments.com`):

```
$dime = new \DimePayments\Sdk\Client('your-api-token');
```

Point it at another environment by passing a base URL, or use `Config` for full control (timeout, retries, a custom Guzzle client):

```
use DimePayments\Sdk\Client;
use DimePayments\Sdk\Config;

$dime = new Client('your-api-token', 'https://staging.dimepayments.com');

$dime = new Client(new Config(
    token:      'your-api-token',
    baseUrl:    'https://app.dimepayments.com',
    timeout:    30.0,
    maxRetries: 2,      // retries 429 / 5xx / connection errors with backoff
));
```

The SDK sends `Authorization: Bearer ` and JSON headers on every request. Transient failures (HTTP 429 and 5xx, connection errors) are retried with exponential backoff, honoring the `Retry-After` header when present.

Resources
---------

[](#resources)

Every resource hangs off the client as a readonly property. The merchant `sid` is always passed explicitly; remaining fields go in an `$attributes` array (and lookups, where the API expects them, in a `$filters` array). All amounts are returned as strings to avoid float rounding.

PropertyEndpoints`$dime->transactions`charge card/ACH, tokenize, refund, void, show, list`$dime->customers`list, show, create, update, delete`$dime->paymentMethods`list, show, create, update, delete`$dime->merchants`list, show, create, update, get onboarding form link`$dime->addresses`list, show, create, update, delete`$dime->deposits`list, list-with-transactions, show`$dime->recurringPayments`list, show, create, edit, pause, cancel, activate, delete### Transactions

[](#transactions)

```
// Charge a stored token
$txn = $dime->transactions->chargeCard('000010', [
    'amount' => 100.00,
    'token'  => 'tok_abc123',
    'email'  => 'customer@example.com',
]);

// Charge raw card details (merchant must be PCI compliant)
$txn = $dime->transactions->chargeCard('000010', [
    'amount'          => 100.00,
    'cardholder_name' => 'John Doe',
    'card_number'     => '4111111111111111',
    'expiration_date' => '01/2027',
    'cvv'             => '123',
    'billing_address' => ['zip' => '30009'],
]);

// ACH
$txn = $dime->transactions->chargeAch('000010', [
    'routing_number' => '123456789',
    'account_number' => '9876543210',
    'account_type'   => 'Checking',
    'account_name'   => 'John Doe',
    'amount'         => 75.00,
]);

// Tokenize without charging
$token = $dime->transactions->tokenizeCard('000010', [
    'cardholder_name' => 'John Doe',
    'card_number'     => '4111111111111111',
    'expiration_date' => '01/2027',
    'billing_address' => ['zip' => '30009'],
])->token;

// Refund / void
$dime->transactions->refund('000010', ['amount' => 25.00, 'transaction_info_id' => 123456]);
$dime->transactions->void('000010', 'CC', 123456);

// Read
$txn = $dime->transactions->show('000010', ['transaction_info_id' => 123456]);
```

### Customers, payment methods, addresses

[](#customers-payment-methods-addresses)

```
$customer = $dime->customers->create('000010', [
    'first_name' => 'Jane',
    'last_name'  => 'Doe',
    'email'      => 'jane@example.com',
]);

$customer = $dime->customers->show('000010', ['uuid' => $customer->uuid]);

$pm = $dime->paymentMethods->create('000010', [
    'uuid'               => $customer->uuid,
    'type'               => 'cc',
    'cc_name_on_card'    => 'Jane Doe',
    'cc_number'          => '4111111111111111',
    'cc_expiration_date' => '01/2027',
    'cc_cvv'             => '123',
    'cc_brand'           => 'Visa',
    'addr1'              => '123 Main St',
    'city'               => 'Alpharetta',
    'state'              => 'GA',
    'zip'                => '30009',
    'default'            => true,
]);

$address = $dime->addresses->create('000010', $customer->uuid, [
    'recipient' => 'Jane Doe',
    'line_one'  => '123 Main St',
    'city'      => 'Atlanta',
    'state'     => 'GA',
    'zip'       => '30301',
]);
```

### Recurring payments

[](#recurring-payments)

```
$rp = $dime->recurringPayments->create('000010', [
    'name'                => 'Monthly donation',
    'amount'              => 25.00,
    'start_date'          => '2026-07-01 00:00:00',
    'recurrence_schedule' => 'Monthly',
    'payment_method'      => $pm->id,
    'customer_uuid'       => $customer->uuid,
]);

$dime->recurringPayments->pause('000010', $rp->id, '2026-09-01 00:00:00');
$dime->recurringPayments->activate('000010', $rp->id);
$dime->recurringPayments->cancel('000010', $rp->id);
```

Pagination
----------

[](#pagination)

List endpoints return a `CursorPage`. Iterate one page, walk pages manually, or stream every item across all pages with `autoPaging()`:

```
$page = $dime->transactions->list('000010', [
    'start_date' => '2026-01-01 00:00:00',
    'end_date'   => '2026-01-31 23:59:59',
]);

foreach ($page as $txn) {
    // first page only
}

if ($page->hasMore()) {
    $next = $page->next();
}

// Every transaction across every page (fetches lazily as you iterate)
foreach ($dime->transactions->list('000010')->autoPaging() as $txn) {
    echo $txn->transactionNumber, PHP_EOL;
}
```

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

[](#error-handling)

Every failure throws a `DimePayments\Sdk\Exceptions\DimeException` subclass. Catch the base type, or a specific one:

```
use DimePayments\Sdk\Exceptions\DimeException;
use DimePayments\Sdk\Exceptions\ValidationException;
use DimePayments\Sdk\Exceptions\RateLimitException;

try {
    $dime->transactions->chargeCard('000010', ['amount' => 0]);
} catch (ValidationException $e) {
    $e->getErrors();     // ['data.amount' => ['The data.amount field must be greater than 0.']]
    $e->firstError();
} catch (RateLimitException $e) {
    sleep($e->getRetryAfter() ?? 1);
} catch (DimeException $e) {
    $e->getStatusCode();   // HTTP status
    $e->getResponseBody(); // decoded API body
}
```

ExceptionWhen`ValidationException`HTTP 400/422 with field errors`AuthenticationException`HTTP 401 (missing/invalid token, or insufficient ability)`PermissionDeniedException`HTTP 403 (`belongs-to-company` guard)`NotFoundException`HTTP 404`RateLimitException`HTTP 429 (carries `Retry-After`)`ServerException`HTTP 5xx`ConnectionException`No HTTP response (DNS, timeout, TLS)`ApiException`Any other non-2xxNotes
-----

[](#notes)

- **GET requests carry a JSON body.** The Dime API expects read parameters in the request body even for `GET` endpoints; the SDK handles this for you.
- **No API versioning.** Endpoints live under `/api` with no version prefix.
- A handful of list endpoints (customers, merchants) return their collection without the `links`/`meta` block; `CursorPage` degrades gracefully (items are returned, `hasMore()` is false).

Development
-----------

[](#development)

```
composer install
composer test      # Pest
composer analyse   # PHPStan (level 6)
composer lint      # Pint
```

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance95

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2320507?v=4)[Ryan Taylor](/maintainers/ryantaylor)[@ryantaylor](https://github.com/ryantaylor)

---

Top Contributors

[![baybay00](https://avatars.githubusercontent.com/u/157333212?v=4)](https://github.com/baybay00 "baybay00 (2 commits)")

---

Tags

sdkpaymentsapi clientdimedime-payments

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/dime-technology-dime-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/dime-technology-dime-php-sdk/health.svg)](https://phpackages.com/packages/dime-technology-dime-php-sdk)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k543.5M2.7k](/packages/aws-aws-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

293.1k](/packages/eslazarev-wildberries-sdk)[chargebee/chargebee-php

ChargeBee API client implementation for PHP

758.5M9](/packages/chargebee-chargebee-php)

PHPackages © 2026

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