PHPackages                             techwave/vouchers-php - 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. techwave/vouchers-php

ActiveLibrary[API Development](/categories/api)

techwave/vouchers-php
=====================

PHP SDK for the Commerce Partner Vouchers API

00PHPCI passing

Since Mar 4Pushed 4mo agoCompare

[ Source](https://github.com/techwave-ly/vouchers_php)[ Packagist](https://packagist.org/packages/techwave/vouchers-php)[ RSS](/packages/techwave-vouchers-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Commerce Vouchers PHP SDK
=========================

[](#commerce-vouchers-php-sdk)

A robust, dependency-free PHP client SDK created for Commerce partners. Plugs smoothly into generic PHP, Symfony, and acts as a primary standard via a native `ServiceProvider` hook for **Laravel**.

Features
--------

[](#features)

- **No bloated package requirements**: Built purely upon native `json` and `curl`. Compatible with PHP 8.0+.
- Guaranteed idempotency execution behind-the-scenes.
- Handles authorization implicitly via standard HTTP `$apiKeyId` and `$apiSecret` injection.
- Plug &amp; Play Laravel Facade.

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

[](#installation)

Inside your project root directory containing `composer.json`, simply require:

```
composer require techwave/commerce-vouchers-php
```

Quick Start (Generic/Vanilla PHP)
---------------------------------

[](#quick-start-genericvanilla-php)

```
use Commerce\Vouchers\VouchersClient;
use Commerce\Vouchers\Exceptions\APIError;

$client = new VouchersClient(
    'your_api_key',
    'your_api_secret',
    'https://api.wavecommerce.ly'
);

try {
    // 1. Enter sandbox API mode safely
    $modeRes = $client->switchMode('test');
    echo "Mode Switched: " . $modeRes['mode'] . "\n";

    // 2. Issue a Voucher (Defaults natively to LYD)
    $issueRes = $client->issueVoucher(100.0);
    $voucherId = $issueRes['voucher']['id'];
    echo "Test Voucher Created! Code: " . $issueRes['voucher']['code'] . "\n";

    // 3. Status validation
    $statusRes = $client->getVoucherStatus($voucherId);
    echo "IsTest?: " . ($statusRes['isTest'] ? "true" : "false") . "\n";

    // 4. Bulk Generation (Create 10 vouchers worth 25 LYD instantly)
    $bulkRes = $client->bulkIssueVouchers(25.0, 10);
    echo "Bulk Created Vouchers: " . count($bulkRes['vouchers']) . "\n";

    // 5. Void when complete
    $client->voidVoucher($voucherId);
    echo "Voucher voided successfully.\n";

} catch (APIError $e) {
    echo "API Request failed (" . $e->getStatusCode() . "): " . $e->getMessage() . "\n";
    print_r($e->getResponseBody());
}
```

Laravel Framework Usage
-----------------------

[](#laravel-framework-usage)

Because we ship a native service provider hook (`Commerce\Vouchers\Laravel\VouchersServiceProvider`), the package instantly loads your `.env` keys mapping natively.

Simply add the keys to your Application's `.env` configuration file:

```
VOUCHERS_API_KEY_ID="your_api_key"
VOUCHERS_API_SECRET="your_api_secret"
VOUCHERS_BASE_URL="https://api.wavecommerce.ly"
# VOUCHERS_VERIFY_SSL=false # For local sandbox development bridging HTTPS
```

Anywhere in your Laravel controllers, directly fetch from the IoC Facade or via dependency injection:

```
namespace App\Http\Controllers;

use Commerce\Vouchers\Laravel\VouchersFacade as Vouchers;

class TopupController extends Controller
{
    public function generate()
    {
        $payload = Vouchers::issueVoucher(2400.0);

        return response()->json([
            'voucherCode' => $payload['voucher']['code']
        ]);
    }
}
```

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance52

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/163947789?v=4)[hatcha6](/maintainers/hatcha6)[@hatcha6](https://github.com/hatcha6)

---

Top Contributors

[![hatcha6](https://avatars.githubusercontent.com/u/163947789?v=4)](https://github.com/hatcha6 "hatcha6 (5 commits)")

### Embed Badge

![Health badge](/badges/techwave-vouchers-php/health.svg)

```
[![Health](https://phpackages.com/badges/techwave-vouchers-php/health.svg)](https://phpackages.com/packages/techwave-vouchers-php)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k13](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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