PHPackages                             atdev/commweb - 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. atdev/commweb

ActiveLibrary[Payment Processing](/categories/payments)

atdev/commweb
=============

Commweb Direct Payment REST API PHP SDK

0.1.2(4y ago)42922MITPHPPHP &gt;=5.6.0

Since Feb 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/alekseykuleshov/commweb)[ Packagist](https://packagist.org/packages/atdev/commweb)[ Docs](https://github.com/alekseykuleshov/commweb)[ RSS](/packages/atdev-commweb/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (1)Versions (4)Used By (0)

Commweb Direct Payment REST API PHP SDK
=======================================

[](#commweb-direct-payment-rest-api-php-sdk)

This is SDK for Direct Payment REST API of Commweb. Credit card payments supported only (pay, auth, capture, void, refund).

How to use
----------

[](#how-to-use)

This sdk is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file:

```
{
    "require": {
        "atdev/commweb": "~0.1"
    }
}
```

And run composer to update your dependencies:

```
$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

```

Then, import the `autoload.php` from your `vendor` folder.

Sample calls
------------

[](#sample-calls)

Add the following to the php file which calls SDK:

```
use ATDev\Commweb\PayRequest;
use ATDev\Commweb\AuthorizeRequest;
use ATDev\Commweb\CaptureRequest;
use ATDev\Commweb\VoidRequest;
use ATDev\Commweb\RefundRequest;
use ATDev\Commweb\Order;
use ATDev\Commweb\Transaction;
use ATDev\Commweb\SourceOfFundsCard;
use ATDev\Commweb\Card;
```

### PAY

[](#pay)

```
$result = (new PayRequest("MERCHANT_ID")) // Provided by gateway
    ->setApiPassword("API_PASSWORD") // Provided by gateway
    ->setOrder(new Order("SOME_ORDER_ID", 55.55, "AUD")) // Order id has to be unique, amount in money format, AUD is the only one supported now
    ->setTransaction(new Transaction("SOME_TRANSACTION_ID")) // Transaction id has to be unique
    ->setSourceOfFunds(new SourceOfFundsCard(new Card("CARD_NUMBER", "EXP_MONTH", "EXP_YEAR", "CVC"))) // Self explanatory, year is 2-digit
    ->send();

if ( ! empty($error = $result->getError()) ) {
    // Something went wrong, log it
    die($error);
}

// Successful, save order id, transaction id
```

### AUTHORIZE

[](#authorize)

```
$result = (new AuthorizeRequest("MERCHANT_ID")) // Provided by gateway
    ->setApiPassword("API_PASSWORD") // Provided by gateway
    ->setOrder(new Order("SOME_ORDER_ID", 55.55, "AUD")) // Order id has to be unique, amount in money format, AUD is the only one supported now
    ->setTransaction(new Transaction("SOME_TRANSACTION_ID")) // Transaction id has to be unique
    ->setSourceOfFunds(new SourceOfFundsCard(new Card("CARD_NUMBER", "EXP_MONTH", "EXP_YEAR", "CVC"))) // Self explanatory, year is 2-digit
    ->send();

if ( ! empty($error = $result->getError()) ) {
    // Something went wrong, log it
    die($error);
}

// Successful, save order id, transaction id
```

### VOID

[](#void)

```
$result = (new VoidRequest("MERCHANT_ID")) // Provided by gateway
    ->setApiPassword("API_PASSWORD") // Provided by gateway
    ->setOrder(new Order("SOME_ORDER_ID")) // Original order id
    ->setTransaction(new Transaction("SOME_TRANSACTION_ID")) // New transaction id to be created, has to be unique
    ->setOldTransaction(new Transaction(("OLD_TRANSACTION_ID")) // Original transaction id
    ->send();

if ( ! empty($error = $result->getError()) ) {
    // Something went wrong, log it
    die($error);
}

// Successful, save order id, transaction id
```

### CAPTURE

[](#capture)

```
$result = (new CaptureRequest("MERCHANT_ID")) // Provided by gateway
    ->setApiPassword("API_PASSWORD") // Provided by gateway
    ->setOrder(new Order("SOME_ORDER_ID")) // Original order id
    ->setTransaction(new Transaction("SOME_TRANSACTION_ID")) // New transaction id to be created, has to be unique
    ->setOldTransaction(new Transaction("OLD_TRANSACTION_ID", 55.55, "AUD")) // Original transaction id, amount to capture in money format, AUD is the only one supported now
    ->send();

if ( ! empty($error = $result->getError()) ) {
    // Something went wrong, log it
    die($error);
}

// Successful, save order id, transaction id
```

### REFUND

[](#refund)

```
$result = (new RefundRequest("MERCHANT_ID")) // Provided by gateway
    ->setApiPassword("API_PASSWORD") // Provided by gateway
    ->setOrder(new Order("SOME_ORDER_ID")) // Original order id
    ->setTransaction(new Transaction("SOME_TRANSACTION_ID")) // New transaction id to be created, has to be unique
    ->setOldTransaction(new Transaction("OLD_TRANSACTION_ID", 55.55, "AUD")) // Original transaction id, amount to refund in money format, AUD is the only one supported now
    ->send();

if ( ! empty($error = $result->getError()) ) {
    // Something went wrong, log it
    die($error);
}

// Successful, save order id, transaction id
```

Test mode
---------

[](#test-mode)

Just add "TEST" to your merchant id if it's not already here, or call `setTestMode(true)` method for any request called.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

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

Total

3

Last Release

1624d ago

### Community

Maintainers

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

---

Top Contributors

[![alekseykuleshov](https://avatars.githubusercontent.com/u/6037974?v=4)](https://github.com/alekseykuleshov "alekseykuleshov (27 commits)")

---

Tags

commbankcommonwealthbankcommwebcommwebcommbankcommonwealthbank

### Embed Badge

![Health badge](/badges/atdev-commweb/health.svg)

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

###  Alternatives

[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[bitpay/sdk

Complete version of the PHP library for the new cryptographically secure BitPay API

42337.5k4](/packages/bitpay-sdk)[buckaroo/sdk

Buckaroo payment SDK

12189.1k9](/packages/buckaroo-sdk)[contica/facturador-electronico-cr

Un facturador de código libre para integrar facturación electrónica en Costa Rica a un proyecto PHP

2128.8k](/packages/contica-facturador-electronico-cr)

PHPackages © 2026

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