PHPackages                             rafoabbas/epoint-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. rafoabbas/epoint-php

ActiveLibrary[Payment Processing](/categories/payments)

rafoabbas/epoint-php
====================

Epoint.az Payment Gateway PHP SDK - Online payment integration for Azerbaijan

v0.2.3(2w ago)223↓93.3%1[1 issues](https://github.com/rafoabbas/epoint-php/issues)MITPHPPHP ^8.2

Since Feb 24Pushed 1w agoCompare

[ Source](https://github.com/rafoabbas/epoint-php)[ Packagist](https://packagist.org/packages/rafoabbas/epoint-php)[ Docs](https://github.com/rafoabbas/epoint-php)[ RSS](/packages/rafoabbas-epoint-php/feed)WikiDiscussions main Synced today

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

Epoint.az Payment Gateway PHP SDK
=================================

[](#epointaz-payment-gateway-php-sdk)

[![Latest Version](https://camo.githubusercontent.com/23e280c36503dc819dbd941eceee9c06d5869db721ae102c207f3ec4ee095d8f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7261666f61626261732f65706f696e742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rafoabbas/epoint-php)[![Total Downloads](https://camo.githubusercontent.com/293a4bb502fcbba55fc78812a9aa8846b127508938375f85d0550cd805455e11/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7261666f61626261732f65706f696e742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rafoabbas/epoint-php)[![License](https://camo.githubusercontent.com/ec46b659230e4d8268c3e150435ea51ff0c97cef7ddb7ad709c7961692dae329/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7261666f61626261732f65706f696e742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rafoabbas/epoint-php)

Modern PHP SDK for integrating [Epoint.az](https://epoint.az) payment gateway into your application. Supports standard payments, card tokenization, split payments, preauth, Apple Pay, Google Pay, wallets, and invoices.

Features
--------

[](#features)

- ✅ **Standard Payment** - Accept online card payments
- ✅ **Card Registration** - Save cards for future payments (PCI-compliant tokenization)
- ✅ **Card Registration with Payment** - Register card and process payment in one step
- ✅ **Saved Card Payments** - Charge saved cards without re-entering details
- ✅ **Split Payments** - Split payment between multiple merchants (with saved card &amp; registration)
- ✅ **Preauth** - Hold funds before capture (authorization + completion)
- ✅ **Refunds &amp; Reversals** - Full or partial refunds, transaction cancellation
- ✅ **Apple Pay &amp; Google Pay** - Digital wallet integration
- ✅ **Wallets** - Support for local e-wallets
- ✅ **Invoices** - Create and send payment invoices
- ✅ **Signature Verification** - Secure callback validation
- ✅ **Type-safe** - Full PHP 8.2+ type coverage with enums
- ✅ **Fluent API** - Clean, readable builder pattern

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

[](#-documentation)

For detailed documentation, guides, and advanced usage examples, visit our **[GitHub Wiki](https://github.com/rafoabbas/epoint-php/wiki)**.

**Quick Links:**

- 🚀 [Getting Started Guide](https://github.com/rafoabbas/epoint-php/wiki/Getting-Started)
- 💳 [Payment Methods](https://github.com/rafoabbas/epoint-php/wiki/Payment-Methods)
- 🔐 [Security &amp; Signature Verification](https://github.com/rafoabbas/epoint-php/wiki/Security)
- 🔄 [Refunds &amp; Reversals](https://github.com/rafoabbas/epoint-php/wiki/Refunds-and-Reversals)
- 📱 [Digital Wallets (Apple Pay, Google Pay)](https://github.com/rafoabbas/epoint-php/wiki/Digital-Wallets)
- 🧪 [Testing Guide](https://github.com/rafoabbas/epoint-php/wiki/Testing)
- ❓ [FAQ &amp; Troubleshooting](https://github.com/rafoabbas/epoint-php/wiki/FAQ)

**Official Epoint API Documentation:**

- 📄 [Epoint API Documentation (PDF)](https://epointbucket.s3.eu-central-1.amazonaws.com/files/instructions/API%20Epoint%20en.pdf)

Official Platform Plugins
-------------------------

[](#official-platform-plugins)

Use the ready-made plugins below if you need to integrate Epoint into popular e-commerce platforms without writing a custom integration from scratch:

- 🛒 [OpenCart 3.0.x Plugin](https://github.com/rafoabbas/epoint-opencart-v3.0.x)
- 🧩 [WooCommerce 9.x.x Plugin](https://github.com/rafoabbas/epoint-woocommerce-9.x.x)

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- ext-json
- ext-curl

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

[](#installation)

```
composer require rafoabbas/epoint-php
```

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

[](#quick-start)

### 1. Initialize Client

[](#1-initialize-client)

```
use Epoint\EpointClient;

$client = new EpointClient(
    publicKey: 'i000000001',      // Your merchant public key
    privateKey: 'your-private-key'  // Your merchant private key
);
```

### 2. Create Payment

[](#2-create-payment)

```
use Epoint\Enums\Language;

$response = $client->payment()
    ->amount(100.50)
    ->orderId('ORDER-12345')
    ->description('Product purchase')
    ->language(Language::EN)
    ->successUrl('https://yoursite.com/payment/success')
    ->errorUrl('https://yoursite.com/payment/error')
    ->send();

if ($response->isSuccess()) {
    // Redirect user to payment page
    header('Location: ' . $response->getRedirectUrl());
}
```

### 3. Handle Callback

[](#3-handle-callback)

```
// In your callback handler (result_url)
$data = $_POST['data'];
$signature = $_POST['signature'];

try {
    $callbackData = $client->verifyCallback($data, $signature);

    if ($callbackData['status'] === 'success') {
        // Payment successful
        $orderId = $callbackData['order_id'];
        $transaction = $callbackData['transaction'];
        $amount = $callbackData['amount'];

        // Update your database
    }
} catch (\Epoint\Exceptions\SignatureVerificationException $e) {
    // Invalid signature - possible fraud
    http_response_code(400);
}
```

Usage Examples
--------------

[](#usage-examples)

### Standard Payment

[](#standard-payment)

```
$response = $client->payment()
    ->amount(50.00)
    ->orderId('ORDER-001')
    ->description('Monthly subscription')
    ->installment(true) // Enable installment payment
    ->send();
```

### Check Payment Status

[](#check-payment-status)

```
$status = $client->checkStatus()
    ->transaction('te001234567')
    ->get();

if ($status->getPaymentStatus() === \Epoint\Enums\PaymentStatus::SUCCESS) {
    echo 'Payment successful!';
}
```

### Check Card Registration Status

[](#check-card-registration-status)

```
use Epoint\Enums\CardStatus;

$status = $client->checkCardStatus()
    ->cardId('ce001234567')
    ->get();

if ($status->getCardStatus() === CardStatus::ACTIVE) {
    echo 'Card is active!';
    echo 'Card: ' . $status->getCardMask();    // ****1234
    echo 'Expiry: ' . $status->getExpiredDate(); // 12/25
}
```

### Card Registration

[](#card-registration)

```
// Register card without payment
$response = $client->registerCard()
    ->description('Save card for future purchases')
    ->successUrl('https://yoursite.com/cards/success')
    ->errorUrl('https://yoursite.com/cards/error')
    ->send();

// Get card_id from callback and store in your database
$cardId = $response->getCardId();
```

### Card Registration with Payment

[](#card-registration-with-payment)

```
// Register card and process payment simultaneously
$response = $client->registerCardWithPay()
    ->amount(100.50)
    ->orderId('ORDER-123')
    ->description('First purchase + save card')
    ->successUrl('https://yoursite.com/cards/success')
    ->errorUrl('https://yoursite.com/cards/error')
    ->send();

// Get both card_id and transaction from response
$cardId = $response->getCardId();
$transaction = $response->getTransaction();
```

### Payment with Saved Card

[](#payment-with-saved-card)

```
$response = $client->savedCardPayment()
    ->cardId('saved-card-id-from-database')
    ->amount(25.00)
    ->orderId('ORDER-002')
    ->description('Subscription renewal')
    ->execute();
```

### Refund

[](#refund)

```
$response = $client->refund()
    ->cardId('card-id-for-refund')
    ->orderId('original-order-id')
    ->amount(50.00)
    ->description('Product return')
    ->send();
```

### Reverse/Cancel Transaction

[](#reversecancel-transaction)

```
$response = $client->reverse()
    ->transaction('te001234567')
    ->amount(100.00) // Optional: partial reversal
    ->send();
```

### Split Payment

[](#split-payment)

```
// Split payment between two merchants
$response = $client->splitPayment()
    ->amount(100.00)
    ->orderId('ORDER-003')
    ->splitUser('i000000002') // Second merchant ID
    ->splitAmount(30.00)      // Amount for second merchant
    ->description('Marketplace order')
    ->send();

// Split payment with saved card
$response = $client->splitCardPayment()
    ->cardId('saved-card-id')
    ->amount(100.00)
    ->orderId('ORDER-003')
    ->splitUser('i000000002')
    ->splitAmount(30.00)
    ->execute();

// Split payment with card registration
$response = $client->splitCardRegistrationWithPay()
    ->amount(100.00)
    ->orderId('ORDER-003')
    ->splitUser('i000000002')
    ->splitAmount(30.00)
    ->description('First split payment + save card')
    ->send();

// Get both card_id and transaction from response
$cardId = $response->getCardId();
$transaction = $response->getTransaction();
```

### Preauth (Hold Funds)

[](#preauth-hold-funds)

```
// Step 1: Create preauth request
$response = $client->preauth()
    ->amount(100.00)
    ->orderId('ORDER-004')
    ->description('Hotel reservation')
    ->send();

$transaction = $response->getTransaction();

// Step 2: Complete preauth to capture funds
$completeResponse = $client->preauth()
    ->complete($transaction, 85.00); // Capture partial or full amount
```

### Apple Pay / Google Pay

[](#apple-pay--google-pay)

```
$widget = $client->widget()
    ->amount(75.00)
    ->orderId('ORDER-005')
    ->description('Digital wallet payment')
    ->create();

// Use widget URL in iframe or webview
echo '';
```

### Wallets

[](#wallets)

```
// Get available wallets
$wallets = $client->wallet()->list();

foreach ($wallets->getWallets() as $wallet) {
    echo $wallet['name'];
}

// Make wallet payment
$response = $client->wallet()->payment(
    walletId: 'wallet-id',
    amount: 50.00,
    orderId: 'ORDER-006'
);
```

### Invoices

[](#invoices)

```
// Create invoice
$invoice = $client->invoice()->create([
    'sum' => 150.00,
    'display' => 1,
    'save_as_template' => 0,
    'name' => 'John Doe',
    'phone' => '+994501234567',
    'email' => 'john@example.com',
    'description' => 'Invoice for services',
    'period_from' => '2024-01-01',
    'period_to' => '2024-12-31',
]);

// Send invoice via SMS
$client->invoice()->sendSms($invoice['id'], '+994501234567');

// Send invoice via email
$client->invoice()->sendEmail($invoice['id'], 'john@example.com');
```

### Heartbeat Check

[](#heartbeat-check)

```
$status = $client->heartbeat();

if ($status['status'] === 'ok') {
    echo 'Epoint API is operational';
}
```

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

[](#api-reference)

### EpointClient Methods

[](#epointclient-methods)

MethodDescription`payment()`Create standard payment request`checkStatus()`Check payment status`checkCardStatus()`Check card registration status`registerCard()`Register card without payment`registerCardWithPay()`Register card with payment in one step`savedCardPayment()`Payment with saved card`refund()`Refund payment`reverse()`Reverse/cancel transaction`splitPayment()`Split payment between merchants`splitCardPayment()`Split payment with saved card`splitCardRegistrationWithPay()`Register card with split payment`preauth()`Preauth (hold and capture)`widget()`Apple Pay / Google Pay widget`wallet()`Wallet operations`invoice()`Invoice management`heartbeat()`API health check`verifyCallback()`Verify callback signature### Working with Response Objects

[](#working-with-response-objects)

All API methods return response objects with convenient getter methods and full data access:

```
$response = $client->payment()
    ->amount(100.00)
    ->orderId('ORDER-123')
    ->send();

// Use specific getter methods
$redirectUrl = $response->getRedirectUrl();
$transaction = $response->getTransaction();
$isSuccess = $response->isSuccess();

// Or get full response data as array
$fullData = $response->toArray();
print_r($fullData);

// Example output:
// [
//     'status' => 'success',
//     'redirect_url' => 'https://epoint.az/payment/...',
//     'transaction' => 'te001234567',
//     'message' => 'Payment initiated',
//     'trace_id' => 'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
//     // ... all other response fields
// ]
```

**Available methods on response objects:**

```
// Common methods (available on most responses)
$response->isSuccess()          // Check if request was successful
$response->getStatus()          // Get status: 'success', 'error', 'new', etc.
$response->getMessage()         // Get response message
$response->getTraceId()         // Get trace ID for troubleshooting
$response->toArray()            // Get complete response data as array

// Payment-specific methods
$response->getRedirectUrl()     // Payment page URL (for payment requests)
$response->getTransaction()     // Transaction ID
$response->getAmount()          // Payment amount
$response->getOrderId()         // Your order ID

// Card-specific methods
$response->getCardId()          // Saved card ID (for card registration)
$response->getCardMask()        // Masked card number (e.g., "****1234")

// Widget-specific methods
$response->getWidgetUrl()       // Apple Pay / Google Pay widget URL

// Status check methods
$response->getPaymentStatus()   // PaymentStatus enum (NEW, SUCCESS, ERROR)
$response->getCardStatus()      // CardStatus enum (NEW, ACTIVE, PENDING, REJECTED, EXPIRED, SESSION_EXPIRED)
```

**Pro tip:** Use `->toArray()` for debugging or logging full API responses:

```
$response = $client->payment()->amount(50)->orderId('TEST-001')->send();

// Log full response for debugging
error_log(print_r($response->toArray(), true));

// Get trace_id for support requests
$traceId = $response->getTraceId();
```

**Important:** If you encounter any issues with a payment or API request, always include the `trace_id` when contacting Epoint support. This unique identifier helps them quickly locate and troubleshoot your specific transaction:

```
try {
    $response = $client->payment()->amount(100)->orderId('ORDER-123')->send();
} catch (\Exception $e) {
    // Always log trace_id when errors occur
    $traceId = $response->getTraceId() ?? 'N/A';
    error_log("Payment failed. Trace ID: {$traceId}. Error: " . $e->getMessage());

    // Include trace_id when reporting issues to Epoint support
}

### Enums

```php
use Epoint\Enums\CardStatus;
use Epoint\Enums\Currency;
use Epoint\Enums\Language;
use Epoint\Enums\PaymentStatus;

Currency::AZN
Language::AZ | Language::EN | Language::RU
PaymentStatus::NEW | PaymentStatus::SUCCESS | PaymentStatus::ERROR
CardStatus::NEW | CardStatus::ACTIVE | CardStatus::PENDING | CardStatus::REJECTED | CardStatus::EXPIRED | CardStatus::SESSION_EXPIRED
```

Testing
-------

[](#testing)

```
composer test
```

Code Quality
------------

[](#code-quality)

```
composer cs:fix    # Fix code style
composer cs:check  # Check code style
composer analyse   # Run static analysis
```

Security
--------

[](#security)

- All API requests are signed with SHA1 HMAC signatures
- Callback responses are verified to prevent tampering
- Never store raw card data - use tokenization
- Use HTTPS in production
- Keep your private key secure

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md)

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

Credits
-------

[](#credits)

- [Rauf Abbaszade](https://github.com/rafoabbas)

Support
-------

[](#support)

- [GitHub Issues](https://github.com/rafoabbas/epoint-php/issues)
- [Epoint Documentation](https://epoint.az)

###  Health Score

39

↑

LowBetter than 84% of packages

Maintenance88

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 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

Every ~29 days

Total

5

Last Release

15d ago

### Community

Maintainers

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

---

Top Contributors

[![rafoabbas](https://avatars.githubusercontent.com/u/32704040?v=4)](https://github.com/rafoabbas "rafoabbas (16 commits)")

---

Tags

paymentgatewayApple PaywalletazerbaijanEpointonline-paymentepoint.azgoogle-paycard-paymentsplit-payment

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[checkout/checkout-php-api

Checkout PHP API Library

25450.9k1](/packages/checkout-checkout-php-api)[sudiptpa/omnipay-nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

1019.5k](/packages/sudiptpa-omnipay-nabtransact)[lucassmacedo/omnipay-mercadopago

MercadoPago gateway for OmniPay

155.4k](/packages/lucassmacedo-omnipay-mercadopago)

PHPackages © 2026

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