PHPackages                             datingvip/ach-wts-dbs-api - 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. datingvip/ach-wts-dbs-api

ActiveLibrary[API Development](/categories/api)

datingvip/ach-wts-dbs-api
=========================

WTS ACH DBS API Implementation for PHP

v1.0.3(3y ago)22.1kLGPL-3.0-or-laterPHPPHP &gt;=5.0.0

Since Jun 23Pushed 3y ago17 watchersCompare

[ Source](https://github.com/DatingVIP/ach-wts-dbs-api)[ Packagist](https://packagist.org/packages/datingvip/ach-wts-dbs-api)[ Docs](https://github.com/DatingVIP/ach-wts-dbs-api)[ RSS](/packages/datingvip-ach-wts-dbs-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

ACH WTS DBS API
===============

[](#ach-wts-dbs-api)

A PHP class to make the WTS ACH (achdebit.com) API usage easier. These classes are for Dynamic Billing System users.

Usage Examples
==============

[](#usage-examples)

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

use DatingVIP\Payment\Ach\DbsApi;
use DatingVIP\Payment\Ach\TransactionParams;
use DatingVIP\Payment\Ach\ResponseParams;
use DatingVIP\Payment\Ach\TransactionRefundParams;
use DatingVIP\Payment\Ach\ToastParams;

// add your credentials here

$config = [
    'parent_id' => 'YOUR_PARTNER_ID',
    'sub_id'    => 'YOUR_SUB_ID'
];

$api = new DbsApi();

// create a subscription / re-billing

$params = new TransactionParams();

$params->parent_id = $config['parent_id'];
$params->sub_id    = $config['sub_id'];
$params->pmt_type  = TransactionParams::PAYMENT_TYPE_CHECK;

$params->response_location = 'http://example.com/listener/' . time();

$params->chk_acct = '123456789';
$params->chk_aba  = '987654321';

$params->custname     = 'John Smith';
$params->custemail    = 'jsmith@example.com';
$params->custaddress1 = 'Main Street';
$params->custstate    = 'TX';
$params->custzip      = '00893';
$params->custcity     = 'Austin';

$params->initial_amount  = '1.00';
$params->recur_amount    = '5.00';
$params->max_num_billing = '10';
$params->billing_cycle   = TransactionParams::CYCLE_MONTHLY;
$params->ip_forward      = $_SERVER['REMOTE_ADDR'];
$params->merordernumber  = time();

$api = new DbsApi();

$api->doTransaction($params);

// what do we got

switch ($api->getResponseObject()->status) {
    case ResponseParams::STATUS_ACCEPTED:
    case ResponseParams::STATUS_SUCCESS:
        // All good!
        echo 'Successful Payment!';
        break;

    case ResponseParams::STATUS_VERIFY:
        // Redirect user to WTS site
        // in this case we will need a listener which, which will handle returned data from join.achbill.com
        echo 'Finish payment!';
        break;

    case ResponseParams::STATUS_DECLINED:
        // Declined transaction
        echo 'Transaction Declined! "' . $api->getResponseObject()->reason . '"';
        break;

    default:
        echo '???';
}

// cancel subscription example

$cparams = new TransactionParams();

$cparams->parent_id   = $config['parent_id'];
$cparams->sub_id      = $config['sub_id'];
$cparams->action_code = TransactionParams::ACTION_CANCEL;

$cparams->prev_history_id = 'history_id';
$cparams->order_id        = 'ach_order_id';
$cparams->canceltype      = TransactionParams::CANCEL_IMMEDIATE;

$api->doTransaction($cparams);

// refund transaction

$rparams = new TransactionRefundParams();

$rparams->parent_id = $config['parent_id'];
$rparams->sub_id    = $config['sub_id'];
$rparams->pmt_type  = TransactionParams::PAYMENT_TYPE_CHECK;

$rparams->action_code     = TransactionRefundParams::ACTION_REFUND;
$rparams->prev_history_id = 'history_id';
$rparams->order_id        = 'ach_order_id';
$rparams->initial_amount  = 'amount';

$api->doTransaction($rparams);

// example of how to handle TOAST's from the listener script

$tparams = new ToastParams();
$tparams->setVariablesFromString( http_build_query($_POST) );

if(!$api->isToastIpValid($_SERVER['REMOTE_ADDR'])) { die ( 'Toast IP is not valid!' ); }

switch ($tparams->status) {

    case ResponseParams::STATUS_ACCEPTED:
    case ResponseParams::STATUS_SUCCESS:
        // All good!
        break;

    default:
        // Declined
}
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

4

Last Release

1173d ago

### Community

Maintainers

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

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

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

---

Top Contributors

[![kornrunner](https://avatars.githubusercontent.com/u/725986?v=4)](https://github.com/kornrunner "kornrunner (3 commits)")[![prymas007](https://avatars.githubusercontent.com/u/1726010?v=4)](https://github.com/prymas007 "prymas007 (3 commits)")[![bboldi](https://avatars.githubusercontent.com/u/839347?v=4)](https://github.com/bboldi "bboldi (2 commits)")

---

Tags

api-clientwts-achapipaymentachWTSDBS

### Embed Badge

![Health badge](/badges/datingvip-ach-wts-dbs-api/health.svg)

```
[![Health](https://phpackages.com/badges/datingvip-ach-wts-dbs-api/health.svg)](https://phpackages.com/packages/datingvip-ach-wts-dbs-api)
```

###  Alternatives

[mage2pro/stripe

Stripe integration with Magento 2

605.3k](/packages/mage2pro-stripe)[everypay/everypay-php

1742.0k](/packages/everypay-everypay-php)

PHPackages © 2026

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