Download the PHP package gardi/dcb-kit without Composer

On this page you can find all versions of the php package gardi/dcb-kit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dcb-kit

dcb-kit

A small, framework-agnostic toolkit for direct carrier billing (DCB) in PHP — the part that's the same across every carrier: one gateway interface, normalized callback events, idempotent charging, and signature verification. Zero runtime dependencies.

I built and ran 20+ carrier-billing integrations across ~10 countries on a production platform (subscriptions, one-off charges, and millions of async billing callbacks). The carriers were all different — different APIs, different notification formats, different quirks — but the shape of the problem was always the same. dcb-kit is that shape, distilled. It is not any carrier's proprietary integration (those stay under NDA where they belong); it's the scaffolding you hang your own adapters on.

Install

The idea

A carrier integration always comes down to a few operations — subscribe a number, charge it, cancel — plus a stream of async notifications (activated, renewed, charged, out of balance, unsubscribed). Every carrier names these differently; dcb-kit normalizes them to one enum so the rest of your app never cares which carrier it's talking to:

Write a carrier

Implement one interface per carrier:

Or configure one instead of coding it

Most carriers are just a base URL + a status table + an auth scheme + a signature scheme. For those, skip the class — hand HttpCarrierGateway the moving parts:

The pieces that vary most between carriers are all strategies you pick:

Carriers that still don't fit extend HttpCarrierGateway and override the one method that differs.

Or define every carrier in config

When the carriers are config-shaped, build the whole manager from an array — no per-carrier code at all:

auth.type is one of bearer / api_key / basic / query / none; verifier.type is hmac / none. This maps straight onto a Laravel/Symfony config file — adding a carrier becomes a config edit, not a code deploy.

Use it

Register your carriers and resolve them by name:

See tests/FakeCarrier.php for a complete reference gateway.

Resilience (optional)

Three opt-in decorators cover the production concerns — all composable with the above.

Retry transient failures — wrap your Transport. Retrying a charge is safe because the reference is the carrier's idempotency key, so the same reference is never a second charge:

Don't double-charge your own retries — wrap a gateway with an IdempotencyStore. A charge already completed under a reference is replayed from the store instead of charged again (failed charges aren't remembered, so they can be retried):

The shipped InMemoryIdempotencyStore is for tests / a single process — back the IdempotencyStore interface with Redis or a unique-indexed table in production. (This guards against your app repeating a charge; the in-flight case — you charged, the response was lost, you retry — is covered by the carrier's own reference idempotency.)

Handle a webhook in one call — resolve the carrier, verify the raw body, decode, and parse:

What's in the box

Limitations

Deliberately a toolkit, not a platform:

Development

License

MIT — see LICENSE.


All versions of dcb-kit with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gardi/dcb-kit contains the following files

Loading the files please wait ...