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 2mo 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

19

—

LowBetter than 10% of packages

Maintenance56

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://www.gravatar.com/avatar/41f672ccf761769a8e2f88b22311c49125ede17f824e033bd18006c86d344b1d?d=identicon)[hatcha6](/maintainers/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

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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