PHPackages                             applax-dev/gate-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. [API Development](/categories/api)
4. /
5. applax-dev/gate-sdk

ActiveLibrary[API Development](/categories/api)

applax-dev/gate-sdk
===================

Official PHP SDK for Appla-X Gate API v0.6 - Secure payment processing, order management, and merchant services

v1.2.0(7mo ago)03MITPHPPHP &gt;=8.0

Since Sep 18Pushed 7mo agoCompare

[ Source](https://github.com/applax-dev/gate-sdk)[ Packagist](https://packagist.org/packages/applax-dev/gate-sdk)[ Docs](https://github.com/applax-dev/gate-sdk)[ RSS](/packages/applax-dev-gate-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (10)Versions (5)Used By (0)

 [![Applax Logo](https://camo.githubusercontent.com/6f2fbdecbd850c80fe8a596b943012ddd0601759062cb480d2a4d5435689f7f9/68747470733a2f2f6d656469612e6170706c612d782e636f6d2f696d672f6170706c61782e706e67)](https://camo.githubusercontent.com/6f2fbdecbd850c80fe8a596b943012ddd0601759062cb480d2a4d5435689f7f9/68747470733a2f2f6d656469612e6170706c612d782e636f6d2f696d672f6170706c61782e706e67)

Appla-X Gate SDK for PHP / LARAVEL 11+
======================================

[](#appla-x-gate-sdk-for-php--laravel-11)

[![Latest Version](https://camo.githubusercontent.com/5d79f1c7f2be6aad67aea1350fd15189ffbfbe05c19e53c7d7a52e5d5cd80492/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6170706c61782d6465762f676174652d73646b2e737667)](https://packagist.org/packages/applax-dev/gate-sdk)[![PHP Version](https://camo.githubusercontent.com/ba8acde44ff2cc4f4328ab5e26403a1b3a7b3da98684305c92e8e6034c8ffe79/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6170706c61782d6465762f676174652d73646b2e737667)](https://packagist.org/packages/applax-dev/gate-sdk)[![License](https://camo.githubusercontent.com/3f5bcd304a66d728ecd246eb9cc0285f72d0cc5f054a4adbbf4b1b1e899ba4b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6170706c61782d6465762f676174652d73646b2e737667)](https://packagist.org/packages/applax-dev/gate-sdk)[![Total Downloads](https://camo.githubusercontent.com/5efce91fa6c55800fcb0f215c250098ff61ac966d88d386466aa534d87836461/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6170706c61782d6465762f676174652d73646b2e737667)](https://packagist.org/packages/applax-dev/gate-sdk)

The official PHP SDK for Appla-X Gate API v1.2.0, providing secure payment processing, order management, and merchant services.

✨ Features
----------

[](#-features)

- ⭐ **NEW: Raw API Access** - Direct access to ALL endpoints (Brands, Charges, Taxes, Subscriptions)
- 🔒 **Enterprise Security** - Secure authentication, input validation, SSL/TLS enforcement
- 🚀 **Production Ready** - Comprehensive error handling, retry logic, logging support
- 📦 **PSR Compatible** - PSR-3 logging, PSR-18 HTTP client support
- 🎯 **Type Safe** - Full PHP 8.0+ type declarations with rich IDE support
- 🔄 **Retry Logic** - Exponential backoff for failed requests
- 📊 **Rich Models** - Structured data objects for all API responses
- 🎛️ **Configurable** - Flexible configuration with environment support
- 📝 **Well Documented** - Comprehensive documentation and examples

🔧 Requirements
--------------

[](#-requirements)

- PHP 8.0 or higher
- Guzzle HTTP Client 7.0+
- Valid Appla-X Gate API credentials

📦 Installation
--------------

[](#-installation)

Install via Composer:

```
composer require applax-dev/gate-sdk
```

🔄 Updating
----------

[](#-updating)

To update to the latest version:

```
# Update to latest version
composer update applax-dev/gate-sdk

# Or update with all dependencies
composer update

# Update to specific version
composer require applax-dev/gate-sdk:^1.2

# Check current version
composer show applax-dev/gate-sdk
```

**After updating:**

- Review the [CHANGELOG.md](CHANGELOG.md) for breaking changes
- Test in sandbox environment before production
- Update your code if using deprecated features

🚀 Quick Start
-------------

[](#-quick-start)

### Basic Setup

[](#basic-setup)

```
use ApplaxDev\GateSDK\GateSDK;

// Initialize with API key
$sdk = new GateSDK(
    apiKey: 'your-bearer-token-here',
    sandbox: true // Use sandbox for testing
);
```

### Environment-based Configuration

[](#environment-based-configuration)

Set up your environment variables:

```
APPLAX_API_KEY=your-bearer-token
APPLAX_SANDBOX=true
APPLAX_DEBUG=false
```

Then use environment-based setup:

```
use ApplaxDev\GateSDK\GateSDK;
use ApplaxDev\GateSDK\Config\GateConfig;

$config = GateConfig::fromEnvironment();
$sdk = GateSDK::fromConfig($config);
```

### Create Your First Order

[](#create-your-first-order)

```
// Create an order
$orderData = [
    'client' => [
        'email' => 'customer@example.com',
        'phone' => '371-12345678',
        'first_name' => 'John',
        'last_name' => 'Doe',
    ],
    'products' => [
        [
            'title' => 'Premium Subscription',
            'price' => 29.99,
            'quantity' => 1,
        ]
    ],
    'currency' => 'EUR',
    'language' => 'en',
];

use ApplaxDev\GateSDK\Exceptions\GateException;

try {
    $order = $sdk->createOrderModel($orderData);

    echo "Order created: " . $order->getNumber() . "\n";
    echo "Total: " . $order->getFormattedAmount() . "\n";
    echo "Payment URL: " . $order->getPaymentUrl() . "\n";

} catch (GateException $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
```

### Access Any API Endpoint (NEW!)

[](#access-any-api-endpoint-new)

```
// Create a brand
$brand = $sdk->rawPost('/brands/', [
    'name' => 'My Brand',
    'description' => 'Brand description'
]);

// Create a subscription
$subscription = $sdk->rawPost('/subscriptions/', [
    'client' => ['email' => 'customer@example.com'],
    'amount' => 29.99,
    'currency' => 'EUR',
    'interval' => 'monthly'
]);

// Manage taxes
$tax = $sdk->rawPost('/taxes/', [
    'name' => 'VAT',
    'rate' => 21.0,
    'country' => 'LV'
]);

// Create charges
$charge = $sdk->rawPost('/charges/', [
    'amount' => 100.00,
    'currency' => 'EUR',
    'description' => 'Service charge'
]);
```

### Process Card Payment

[](#process-card-payment)

```
// Execute card payment
$cardData = [
    'cardholder_name' => 'John Doe',
    'card_number' => '4111111111111111', // Test card
    'cvv' => '123',
    'exp_month' => 12,
    'exp_year' => 25,
];

$paymentResult = $sdk->executeCardPayment($order->getApiDoUrl(), $cardData);

if ($paymentResult['status'] === 'success') {
    echo "Payment successful! Transaction ID: " . $paymentResult['transaction_id'] . "\n";
}
```

🎯 API Coverage
--------------

[](#-api-coverage)

### Raw API Access (NEW!)

[](#raw-api-access-new)

Access **any** Appla-X Gate API endpoint, including Brands, Charges, Taxes, and Subscriptions:

```
// Use raw methods for full API access
$brand = $sdk->rawPost('/brands/', ['name' => 'My Brand']);
$subscription = $sdk->rawGet('/subscriptions/', ['status' => 'active']);
$tax = $sdk->rawPatch('/taxes/{id}/', ['rate' => 21.0]);
$charge = $sdk->rawDelete('/charges/{id}/');

// Or use the universal raw() method
$result = $sdk->raw('POST', '/any-endpoint/', $payload);
```

[📖 Full Raw API Documentation](docs/raw-api-access.md)

### Orders Management

[](#orders-management)

```
// Create order
$order = $sdk->createOrder($orderData);

// Get order with rich model
$order = $sdk->getOrderModel($orderId);

// Payment operations
$sdk->capturePayment($orderId, ['amount' => 50.00]);
$sdk->refundPayment($orderId, ['amount' => 25.00, 'reason' => 'Customer request']);
$sdk->cancelOrder($orderId);
```

### Payment Methods

[](#payment-methods)

#### Card Payments

[](#card-payments)

```
$result = $sdk->executeCardPayment($order->getApiDoUrl(), $cardData);
```

#### Digital Wallets

[](#digital-wallets)

```
// Apple Pay
$result = $sdk->executeApplePayPayment($order->getApplePayUrl(), $applePayData);

// Google Pay
$result = $sdk->executeGooglePayPayment($order->getGooglePayUrl(), $googlePayData);
```

#### Alternative Payment Methods

[](#alternative-payment-methods)

```
// PayPal
$result = $sdk->initPayPalPayment($order->getPayPalInitUrl());

// Klarna
$result = $sdk->initKlarnaPayment($order->getKlarnaInitUrl(), $klarnaData);
```

### Products &amp; Clients

[](#products--clients)

```
// Product management
$product = $sdk->createProduct($productData);
$products = $sdk->getProducts(['filter_title' => 'Premium']);

// Client management
$client = $sdk->createClient($clientData);
$clientCards = $sdk->getClientCards($clientId);
```

### Brands, Subscriptions, Taxes &amp; Charges (NEW!)

[](#brands-subscriptions-taxes--charges-new)

```
// Brands
$brand = $sdk->rawPost('/brands/', ['name' => 'My Brand']);
$brands = $sdk->rawGet('/brands/', ['limit' => 20]);
$brand = $sdk->rawPatch('/brands/{id}/', ['name' => 'Updated']);
$sdk->rawDelete('/brands/{id}/');

// Subscriptions
$subscription = $sdk->rawPost('/subscriptions/', $subscriptionData);
$subscriptions = $sdk->rawGet('/subscriptions/', ['status' => 'active']);
$sdk->rawPost('/subscriptions/{id}/cancel/', []);

// Taxes
$tax = $sdk->rawPost('/taxes/', ['name' => 'VAT', 'rate' => 21.0]);
$taxes = $sdk->rawGet('/taxes/', ['country' => 'LV']);

// Charges
$charge = $sdk->rawPost('/charges/', $chargeData);
$sdk->rawPost('/charges/{id}/capture/', []);
$sdk->rawPost('/charges/{id}/refund/', ['amount' => 50.00]);
```

[📖 Complete Raw API Documentation](docs/raw-api-access.md)

📊 Rich Data Models
------------------

[](#-rich-data-models)

The SDK provides rich, type-safe models for API responses:

```
use ApplaxDev\GateSDK\Models\Order;

$order = $sdk->getOrderModel($orderId);

// Rich model methods
echo $order->getNumber();
echo $order->getFormattedAmount();
echo $order->getClient()->getDisplayName();

// Status checks
if ($order->isPayable()) {
    echo "Order can be paid";
}

if ($order->isPaid()) {
    echo "Order is fully paid";
}

// Get available payment methods
$methods = $order->getAvailablePaymentMethods();
// ['card', 'apple_pay', 'paypal', 'klarna']
```

🚨 Error Handling
----------------

[](#-error-handling)

The SDK provides a comprehensive exception hierarchy:

```
use ApplaxDev\GateSDK\Exceptions\{
    GateException,
    ValidationException,
    AuthenticationException,
    NotFoundException,
    RateLimitException,
    ServerException,
    NetworkException
};

try {
    $order = $sdk->createOrder($orderData);

} catch (ValidationException $e) {
    // Handle validation errors (400)
    echo "Validation error: " . $e->getMessage() . "\n";

    // Get field-specific errors
    if ($e->hasFieldErrors('email')) {
        print_r($e->getFieldErrors('email'));
    }

} catch (AuthenticationException $e) {
    // Handle authentication errors (401, 403)
    echo "Auth error: " . $e->getRecommendedAction() . "\n";

} catch (RateLimitException $e) {
    // Handle rate limiting (429)
    echo "Rate limited. Wait " . $e->getSuggestedWaitTime() . " seconds\n";

} catch (NetworkException $e) {
    // Handle network issues
    if ($e->isRetryable()) {
        echo "Network error, retrying in " . $e->getRecommendedRetryDelay() . "s\n";
    }

} catch (GateException $e) {
    // Handle any other API errors
    echo "API error: " . $e->getMessage() . "\n";
    print_r($e->getErrorDetails());
}
```

🔗 Webhook Support
-----------------

[](#-webhook-support)

### Setup Webhooks

[](#setup-webhooks)

```
// Create webhook
$webhook = $sdk->createWebhook([
    'url' => 'https://yourdomain.com/webhooks/applax',
    'events' => ['order.paid', 'order.failed', 'order.refunded']
]);

$webhookSecret = $webhook['secret']; // Store securely
```

### Handle Webhooks

[](#handle-webhooks)

```
// In your webhook endpoint
$payload = file_get_contents('php://input');
$signature = $_SERVER['HTTP_X_WEBHOOK_SIGNATURE'] ?? '';

if (!$sdk->validateWebhookSignature($payload, $signature, $webhookSecret)) {
    http_response_code(401);
    exit('Invalid signature');
}

$data = json_decode($payload, true);

switch ($data['event']) {
    case 'order.paid':
        // Handle successful payment
        $orderId = $data['object']['id'];
        break;

    case 'order.failed':
        // Handle failed payment
        $orderId = $data['object']['id'];
        break;
}

http_response_code(200);
```

⚙️ Advanced Configuration
-------------------------

[](#️-advanced-configuration)

### Custom HTTP Client

[](#custom-http-client)

```
use GuzzleHttp\Client;

$customClient = new Client([
    'timeout' => 60,
    'verify' => '/path/to/cacert.pem'
]);

$sdk = new GateSDK(
    apiKey: 'your-api-key',
    sandbox: true,
    httpClient: $customClient
);
```

### Custom Logger

[](#custom-logger)

```
use Monolog\Logger;
use Monolog\Handler\FileHandler;

$logger = new Logger('applax-sdk');
$logger->pushHandler(new FileHandler('applax-sdk.log', Logger::DEBUG));

$sdk = new GateSDK(
    apiKey: 'your-api-key',
    sandbox: true,
    config: ['debug' => true],
    logger: $logger
);
```

🧪 Testing
---------

[](#-testing)

### Test Cards

[](#test-cards)

Use these test cards in sandbox mode:

Card TypeNumberCVVExpiryVisa411111111111111112312/25Mastercard555555555555444412312/25Amex378282246310005123412/25### Running Tests

[](#running-tests)

```
# Install dev dependencies
composer install --dev

# Run tests
composer test

# Run with coverage
composer test-coverage

# Code quality checks
composer quality
```

📚 Documentation
---------------

[](#-documentation)

- [Installation Guide](docs/installation.md)
- [Configuration](docs/configuration.md)
- [Raw API Access](docs/raw-api-access.md) ⭐ NEW
- [Payment Methods](docs/payment-methods.md)
- [Webhooks](docs/webhooks.md)
- [API Reference](https://gate.appla-x.com/api-docs/)

🤝 Support
---------

[](#-support)

- 📖 [Official Documentation](https://docs.appla-x.com/)
- 🐛 [Issue Tracker](https://github.com/applax-dev/gate-sdk/issues)
- 💬 [Support Email](mailto:ike@appla-x.com)

📄 License
---------

[](#-license)

This SDK is released under the MIT License. See [LICENSE](LICENSE) file for details.

🙏 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.

---

**Ready to start processing payments? Get your API credentials from the [Appla-X Dashboard](https://gate.appla-x.com/) and start building!** 🚀

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance63

Regular maintenance activity

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% 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 ~4 days

Total

4

Last Release

230d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.4

v1.0.2PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/8dcd917b3852d77fb1dd5f536fe4d0954c99ef8223c45bd9361d48a4796bf625?d=identicon)[applax-dev](/maintainers/applax-dev)

---

Top Contributors

[![applax-dev](https://avatars.githubusercontent.com/u/233069906?v=4)](https://github.com/applax-dev "applax-dev (6 commits)")[![ovency](https://avatars.githubusercontent.com/u/215346427?v=4)](https://github.com/ovency "ovency (4 commits)")

---

Tags

apisdkpaymentgatewaypaypalApple Paymerchantsubscriptione-commercegoogle-paycredit-cardfintechappla-x

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/applax-dev-gate-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/applax-dev-gate-sdk/health.svg)](https://phpackages.com/packages/applax-dev-gate-sdk)
```

###  Alternatives

[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60014.4M62](/packages/mollie-mollie-api-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[mollie/magento2

Mollie Payment Module for Magento 2

1121.6M10](/packages/mollie-magento2)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[mollie/magento

iDEAL, Creditcard, Bancontact/Mister Cash, SOFORT, Bank transfer, Bitcoin, PayPal &amp; paysafecard for Magento https://www.mollie.com/

397.9k](/packages/mollie-magento)

PHPackages © 2026

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