PHPackages                             inxy-payments/merchant-sdk - 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. inxy-payments/merchant-sdk

ActiveLibrary[Payment Processing](/categories/payments)

inxy-payments/merchant-sdk
==========================

SDK for INXY Payments merchant api

v3.3.2(1y ago)483.1k—8.6%2[1 PRs](https://github.com/inxy-payments/merchant-sdk/pulls)MITPHPPHP ^7.4 || ^8.0CI passing

Since Sep 13Pushed 1y ago3 watchersCompare

[ Source](https://github.com/inxy-payments/merchant-sdk)[ Packagist](https://packagist.org/packages/inxy-payments/merchant-sdk)[ RSS](/packages/inxy-payments-merchant-sdk/feed)WikiDiscussions master Synced 1mo ago

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

Getting Started
===============

[](#getting-started)

Setup/Install
-------------

[](#setupinstall)

Install through Composer.

```
composer require inxy-payments/merchant-sdk

```

Example redirect to pay page
----------------------------

[](#example-redirect-to-pay-page)

```
$apiKey      = 'Your api key here';
$config      = new Config(Environment::Sandbox, $apiKey, ApiVersion::v1);
$merchantSDK = new MerchantSDK($config);

$orderAmountInUSD      = 20;
$orderName             = 'Order #1';
$customer              = new Customer('example@mail.com', 'John', 'Doe');
$sessionRequest        = new MultiCurrencySessionRequest($orderAmountInUSD, $orderName, FiatCurrencyCode::USD);
$defaultCryptocurrency = new Cryptocurrency(CurrencyCode::USDT, Blockchain::Ethereum, CoinType::ERC20);
$cryptocurrencies      = [];

$cryptocurrencies[] = $defaultCryptocurrency;
$cryptocurrencies[] = new Cryptocurrency(CurrencyCode::USDT, Blockchain::BinanceSmartChain, CoinType::BEP20);
$cryptocurrencies[] = new Cryptocurrency(CurrencyCode::BTC, Blockchain::Bitcoin, CoinType::Native);
$cryptocurrencies[] = new Cryptocurrency(CurrencyCode::ETH, Blockchain::Ethereum, CoinType::Native);
$cryptocurrencies[] = new Cryptocurrency(CurrencyCode::DOGE, Blockchain::Dogecoin, CoinType::Native);
$cryptocurrencies[] = new Cryptocurrency(CurrencyCode::USDC, Blockchain::Ethereum, CoinType::ERC20);

$sessionRequest->setCryptocurrencies($cryptocurrencies);
$sessionRequest->setDefaultCryptocurrency($defaultCryptocurrency);
$sessionRequest->setOrderId('order_123');
$sessionRequest->setPostbackUrl('https://example.com/postback');
$sessionRequest->setCancelUrl('https://example.com/cancel');
$sessionRequest->setSuccessUrl('https://example.com/success');
$sessionRequest->setCustomer($customer);

$sessionResponse = $merchantSDK->createMultiCurrencySession($sessionRequest);

header('Location: ' . $sessionResponse->getRedirectUri());
```

Example handle webhook
----------------------

[](#example-handle-webhook)

```
function handleWebhooks($request) {
    $secretKey  = 'Your secret key here';
    $validator  = new Validator($secretKey);
    $signedHash = $request->headers['X-INXY-Payments-Signature'];

    $payload = $request->getBody()->getContents(); // fetch json from your request

    if (!$validator->isValid($payload, $signedHash)) {
        throw new BadRequestException('No valid webhook');
    }

    $data = json_decode($payload, false);

    switch ($data->name) {
        case EventName::PaymentsInit:
            handlePaymentsInitWebhook($data);
            break;
        case EventName::PaymentsWaitingConfirmations:
            handlePaymentsWaitingConfirmationsWebhook($data);
            break;
        case EventName::PaymentsReceived:
            handlePaymentsReceivedWebhook($data);
            break;
        default:
            throw new InvalidArgumentException('Undefined webhook name');
    }
}

function handlePaymentsInitWebhook(stdClass $webhookData) {
    $webhook = PaymentsInitWebhookFactory::create($webhookData);

    if ($webhook->data->paymentIntent->status === PaymentIntentStatus::WaitingPayment) {
        /** Waiting first payment */
    }

    if ($webhook->data->paymentIntent->status === PaymentIntentStatus::WaitingPaymentPart) {
        /** Waiting part payment after partially paid */
    }

    /** Your code here */
}

function handlePaymentsWaitingConfirmationsWebhook(stdClass $webhookData) {
    $webhook = PaymentsWaitingConfirmationsWebhookFactory::create($webhookData);

    /** Your code here */
}

function handlePaymentsReceivedWebhook(stdClass $webhookData) {
    $webhook = PaymentsReceivedWebhookFactory::create($webhookData);

    if ($webhook->data->paymentIntent->status === PaymentIntentStatus::Paid) {
        /** Success payment code */
    }

    if ($webhook->data->paymentIntent->status === PaymentIntentStatus::PartiallyPaid) {
        /** Partially paid actions */
    }

    /** Your code here */
}
```

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance49

Moderate activity, may be stable

Popularity37

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 87.9% 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 ~17 days

Recently: every ~0 days

Total

57

Last Release

377d ago

Major Versions

v2.3.0 → v3.3.02025-02-27

v1.3.1 → v2.3.12025-03-27

v2.3.1 → v3.3.12025-03-27

v1.x-dev → v2.x-dev2025-05-06

v2.3.2 → v3.3.22025-05-06

PHP version history (3 changes)v1.0.0PHP ^5.6

v2.0.0PHP ^7.0

v3.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/35b7365f7abd9d7ca48eba8295e08dec1b6316ae54cf300f5cc62091a566b42a?d=identicon)[inxy-payments](/maintainers/inxy-payments)

---

Top Contributors

[![apvalkov](https://avatars.githubusercontent.com/u/102719109?v=4)](https://github.com/apvalkov "apvalkov (131 commits)")[![AlexeyHrynko](https://avatars.githubusercontent.com/u/139231069?v=4)](https://github.com/AlexeyHrynko "AlexeyHrynko (17 commits)")[![inxy-payments](https://avatars.githubusercontent.com/u/113416743?v=4)](https://github.com/inxy-payments "inxy-payments (1 commits)")

---

Tags

cryptocrypto-payment-apicrypto-payment-gatewaycryptocurrencypaygatepayment-gatewaypayment-integration

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/inxy-payments-merchant-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/inxy-payments-merchant-sdk/health.svg)](https://phpackages.com/packages/inxy-payments-merchant-sdk)
```

###  Alternatives

[chargebee/chargebee-php

ChargeBee API client implementation for PHP

768.0M9](/packages/chargebee-chargebee-php)[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)[karson/mpesa-php-sdk

172.2k](/packages/karson-mpesa-php-sdk)

PHPackages © 2026

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