PHPackages                             gembapay/gembapay-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. [Payment Processing](/categories/payments)
4. /
5. gembapay/gembapay-php

ActiveLibrary[Payment Processing](/categories/payments)

gembapay/gembapay-php
=====================

GembaPay PHP SDK — Unified payment gateway for crypto (ETH, BNB, POL, USDC, USDT), Stripe, and PayPal. Non-custodial payments.

v1.0.0(3mo ago)11MITPHPPHP &gt;=7.4

Since Feb 7Pushed 3mo agoCompare

[ Source](https://github.com/ivanovslavy/gembapay-php)[ Packagist](https://packagist.org/packages/gembapay/gembapay-php)[ Docs](https://gembapay.com)[ RSS](/packages/gembapay-gembapay-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

GembaPay PHP SDK
================

[](#gembapay-php-sdk)

**Unified payment gateway for crypto, cards, and PayPal.**

Accept ETH, BNB, POL, USDC, USDT, credit cards (via Stripe), and PayPal through a single API. Non-custodial crypto payments — funds go directly to your wallet via smart contracts.

[![Packagist](https://camo.githubusercontent.com/37e486974e32d629f83dce91216ed5fae3e09b85c32153a4168c203e09064eb5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67656d62617061792f67656d62617061792d706870)](https://packagist.org/packages/gembapay/gembapay-php)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](https://opensource.org/licenses/MIT)[![PHP](https://camo.githubusercontent.com/c28ebff896060bfeb9557d2a066ae6235915bf305a91434c38f524a6002dc30d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d253345253344372e342d373737424234)](https://php.net)

---

Features
--------

[](#features)

- **One API, three payment methods** — Crypto, Stripe (cards/Apple Pay/Google Pay), PayPal
- **Non-custodial crypto** — Payments route directly to your wallet via smart contracts
- **86+ currencies** — Price in any fiat currency, settle in crypto or fiat
- **Multi-chain** — Ethereum, BNB Smart Chain, Polygon
- **Test mode built-in** — Testnets + sandbox environments for development
- **Zero dependencies** — Uses only PHP built-in curl and json extensions
- **Laravel &amp; WordPress compatible** — Works with any PHP framework

Install
-------

[](#install)

```
composer require gembapay/gembapay-php
```

Quick Start
-----------

[](#quick-start)

```
use GembaPay\GembaPay;

$gembapay = new GembaPay(
    apiKey: 'gembapay_test_your_key',  // test key for development
    webhookSecret: 'your_webhook_secret'
);

// Create a payment
$payment = $gembapay->createPayment(
    orderId: 'ORDER-123',
    amount: 100.00,
    currency: 'EUR'
);

echo $payment['paymentUrl'];
// → https://payment.gembapay.com/checkout/ORDER-123

echo implode(', ', $payment['allowedMethods']);
// → crypto, stripe, paypal
```

Usage
-----

[](#usage)

### Create Payment

[](#create-payment)

```
$payment = $gembapay->createPayment(
    orderId: 'ORDER-456',
    amount: 49.99,
    currency: 'USD',
    description: 'Premium Plan'
);

// Redirect customer to unified checkout
header('Location: ' . $payment['paymentUrl']);
exit;
```

### Check Status

[](#check-status)

```
$status = $gembapay->getPaymentStatus('ORDER-456');

echo $status['status'];   // 'completed'
echo $status['network'];  // 'bsc', 'stripe', 'paypal', etc.
```

### Webhook Handling

[](#webhook-handling)

```
// webhook.php
$gembapay = new GembaPay(
    apiKey: $_ENV['GEMBAPAY_API_KEY'],
    webhookSecret: $_ENV['GEMBAPAY_WEBHOOK_SECRET']
);

try {
    $event = $gembapay->parseWebhookFromGlobals();

    if ($event['event'] === 'payment.completed') {
        $orderId = $event['payment']['orderId'];
        $amount = $event['payment']['usdAmount'];
        $method = $event['payment']['network'];

        // Fulfill the order
        fulfillOrder($orderId);
    }

    http_response_code(200);
    echo json_encode(['received' => true]);

} catch (\GembaPay\GembaPayException $e) {
    http_response_code(401);
    echo json_encode(['error' => $e->getMessage()]);
}
```

Or verify manually:

```
$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_GEMBAPAY_SIGNATURE'] ?? '';

if ($gembapay->verifyWebhook($payload, $signature)) {
    $data = json_decode($payload, true);
    // Process event...
}
```

### Transactions &amp; Stats

[](#transactions--stats)

```
$transactions = $gembapay->listTransactions();
$stats = $gembapay->getStats();
```

Laravel Integration
-------------------

[](#laravel-integration)

```
// config/services.php
'gembapay' => [
    'api_key' => env('GEMBAPAY_API_KEY'),
    'webhook_secret' => env('GEMBAPAY_WEBHOOK_SECRET'),
],

// app/Providers/AppServiceProvider.php
$this->app->singleton(GembaPay::class, function () {
    return new GembaPay(
        apiKey: config('services.gembapay.api_key'),
        webhookSecret: config('services.gembapay.webhook_secret')
    );
});

// In your controller
public function checkout(Request $request, GembaPay $gembapay)
{
    $payment = $gembapay->createPayment(
        orderId: $request->order_id,
        amount: $request->amount,
        currency: $request->currency ?? 'USD'
    );

    return redirect($payment['paymentUrl']);
}
```

Test Mode
---------

[](#test-mode)

Use test API keys (`gembapay_test_...`) for development. Test mode automatically uses:

MethodTest EnvironmentCryptoSepolia, BSC Testnet, Polygon AmoyStripeTest cards (`4242 4242 4242 4242`)PayPalSandbox accounts```
$gembapay = new GembaPay(apiKey: 'gembapay_test_your_key');
var_dump($gembapay->isTestMode()); // true
```

Claim free test tokens at [Developer Resources](https://gembapay.com/developers).

API Reference
-------------

[](#api-reference)

### Constructor

[](#constructor)

```
new GembaPay(
    string $apiKey,               // Required
    ?string $webhookSecret = null, // For webhook verification
    ?string $baseUrl = null,       // Custom API URL
    int $timeout = 30              // Timeout in seconds
)
```

### Methods

[](#methods)

MethodDescription`createPayment($orderId, $amount, $currency, $description)`Create payment → returns array with `paymentUrl``getPayment($orderId)`Get payment details`getPaymentStatus($orderId)`Check payment status`listTransactions($params)`List merchant transactions`getStats()`Get merchant statistics`verifyWebhook($payload, $signature)`Verify webhook signature → bool`parseWebhookFromGlobals()`Parse &amp; verify from PHP globals`isTestMode()`Check if using test modeFee Structure
-------------

[](#fee-structure)

MethodFeeCrypto (ETH, BNB, POL, USDC, USDT)1%Stripe (Cards, Apple Pay, Google Pay)1% + €0.20 + Stripe feesPayPal (Balance, Bank, Pay Later)1% + €0.20 + PayPal feesRequirements
------------

[](#requirements)

- PHP &gt;= 7.4
- ext-curl
- ext-json

Links
-----

[](#links)

- [Documentation](https://gembapay.com/docs)
- [Merchant Dashboard](https://merchant-dashboard.gembapay.com)
- [Integration Guide](https://gembapay.com/integration)
- [GitHub](https://github.com/ivanovslavy/gembapay)
- [npm Package](https://www.npmjs.com/package/gembapay)

Support
-------

[](#support)

- Email:
- GitHub Issues: [github.com/ivanovslavy/gembapay/issues](https://github.com/ivanovslavy/gembapay/issues)

License
-------

[](#license)

[MIT](LICENSE) © GEMBA EOOD

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance81

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

100d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8acff9135824333ab5a0c72ae0eb9895a54787724b765ce9e0ae4797dbe003c0?d=identicon)[ivanovslavy](/maintainers/ivanovslavy)

---

Top Contributors

[![ivanovslavy](https://avatars.githubusercontent.com/u/204871213?v=4)](https://github.com/ivanovslavy "ivanovslavy (2 commits)")

---

Tags

laravelcryptostripeprotocolpayment processingpaymentsgatewaypaypalecommercemerchantphp-sdkcheckoutcryptocurrencypayment gatewayPolygonethereumweb3blockchainbnbcrypto paymentsUSDCUSDTsmart-contractfiat paymentsdefinon-custodialaccept-cryptoaccept-paymentsmulti-chain

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[cybersource/rest-client-php

Client SDK for CyberSource REST APIs

39881.3k6](/packages/cybersource-rest-client-php)[aktive_merchant/aktive_merchant

Aktive-Merchant provides a common interface to process payments using multiple gateways.

15036.8k](/packages/aktive-merchant-aktive-merchant)[coinpaymentsnet/coinpayments-php

A PHP wrapper for the CoinPayments.net v1 API.

55126.2k](/packages/coinpaymentsnet-coinpayments-php)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)

PHPackages © 2026

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