PHPackages                             maksekeskus/makecommerce-php-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. [HTTP &amp; Networking](/categories/http)
4. /
5. maksekeskus/makecommerce-php-sdk

ActiveLibrary[HTTP &amp; Networking](/categories/http)

maksekeskus/makecommerce-php-sdk
================================

MakeCommerce payment SDK

1.1.0(2w ago)040↓25%MITPHPPHP ^8.1CI passing

Since Oct 28Pushed 2w agoCompare

[ Source](https://github.com/maksekeskus/makecommerce-php-sdk)[ Packagist](https://packagist.org/packages/maksekeskus/makecommerce-php-sdk)[ RSS](/packages/maksekeskus-makecommerce-php-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (4)Dependencies (5)Versions (4)Used By (0)

MakeCommerce PHP SDK
====================

[](#makecommerce-php-sdk)

PHP SDK for the [MakeCommerce](https://makecommerce.net/) payment gateway — accepting bank transfers, cards, and pay-later payments.

- **Developer portal:**
- **API reference:**
- **Merchant portal (test):**
- **Merchant portal (production):**

---

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

[](#requirements)

- PHP 8.1+
- ext-json

---

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

[](#installation)

```
composer require maksekeskus/makecommerce-php-sdk
```

---

Test Credentials
----------------

[](#test-credentials)

Use these public test credentials to get real API responses immediately — no sign-up required:

CredentialValue**Shop ID**`3425d8b7-0225-4367-8c6f-16b1aba8d766`**Secret key**`J5S4lcVjC1QfJec8IQPhHSKeAiEf10bPV7KrHPx9AmIl9nCoEtNtJo63SF0YKpFQ`**Publishable key**`79p15UvwBLlZfqmoMY8D8LAjq4CwI8Tn`Also available as `Environment::TEST_SHOP_ID`, `Environment::TEST_SECRET_KEY`, `Environment::TEST_PUBLISHABLE_KEY`.

---

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

[](#quick-start)

```
use MakeCommerce\MakeCommerceClient;
use MakeCommerce\MCException;
use MakeCommerce\Environment;

// Public test credentials — works immediately, no account needed
$client = new MakeCommerceClient(
    shopId: Environment::TEST_SHOP_ID,
    secretKey: Environment::TEST_SECRET_KEY,
    platform: 'MyPlatform',
    platformVersion: '1.0.0',
    module: 'MyPlugin',
    moduleVersion: '1.0.0',
    testEnv: true
);
```

For production, get your own credentials from the [merchant portal](https://merchant.maksekeskus.ee/).

---

Payment Flow
------------

[](#payment-flow)

The typical integration is three steps: create a transaction, redirect the customer, verify the result.

### 1. Create a transaction

[](#1-create-a-transaction)

```
try {
    $response = $client->createTransaction([
        'transaction' => [
            'amount'    => '49.90',       // string, not float
            'currency'  => 'EUR',
            'reference' => 'ORDER-123',   // your order ID
            'transaction_url' => [
                'return_url'       => ['url' => 'https://myshop.com/payment/return', 'method' => 'GET'],
                'cancel_url'       => ['url' => 'https://myshop.com/payment/cancel', 'method' => 'GET'],
                'notification_url' => ['url' => 'https://myshop.com/payment/notify', 'method' => 'POST'],
            ],
        ],
        'customer' => [
            'ip'    => $_SERVER['REMOTE_ADDR'],  // required
            'email' => 'buyer@example.com',
        ],
    ]);

    $transactionId = $response->body['id'];
    $paymentUrl    = $response->body['_links']['Pay']['href'];

    header('Location: ' . $paymentUrl);
    exit;

} catch (MCException $e) {
    echo $e->getMessage(); // validation or API error
}
```

### 2. Verify the return

[](#2-verify-the-return)

After the customer pays, MakeCommerce redirects them to your `return_url` with `json` and `mac` query parameters. Always verify the MAC before trusting the result.

```
if (isset($_GET['json'], $_GET['mac'])) {
    if ($client->verifyMac(['json' => $_GET['json'], 'mac' => $_GET['mac']])) {
        $data = json_decode($_GET['json'], true);

        if ($data['transaction']['status'] === 'COMPLETED') {
            // Payment confirmed — mark order as paid
        }
    }
}
```

### 3. Handle server notification

[](#3-handle-server-notification)

MakeCommerce also sends a server-to-server POST to your `notification_url`. This is more reliable than the return URL (fires even if the browser closes). Same MAC check applies.

```
$posted  = json_decode(file_get_contents('php://input'), true);

if ($client->verifyMac(['json' => $posted['json'], 'mac' => $posted['mac']])) {
    $payload = json_decode($posted['json'], true);

    if ($payload['transaction']['status'] === 'COMPLETED') {
        // Authoritative payment confirmation
    }
}
```

---

Refunds
-------

[](#refunds)

```
$response = $client->createRefund('txn_abc123', [
    'amount'  => '49.90',
    'comment' => 'Customer request',
]);

$refundId = $response->body['id'];
```

---

Method Reference
----------------

[](#method-reference)

### Shop

[](#shop)

MethodDescription`getShopConfiguration()`Shop settings, enabled payment methods, features`getShopPaymentMethods(array $params = [])`Available payment methods, optionally filtered`getAccountStatement(array $params)`Account statement as JSON. Requires `since` or `payout_id``getAccountStatementXML(array $params)`Account statement as XML. Requires `since`/`payout_id` + `until``getAccountStatementCAMT053(array $params)`Account statement in CAMT053 banking XML format`getShopFees(array $params = [])`Monthly service fees (not transaction fees)### Transactions

[](#transactions)

MethodDescription`createTransaction(array $data)`Create a payment transaction. Returns payment URL in `_links.Pay.href``getTransaction(string $id)`Get a single transaction by ID`getTransactions(array $params = [])`Paginated transaction list with date/status filters`getTransactionStatement(string $id)`Accounting entries for a single transaction`addMerchantDataToTransaction(string $id, array $data)`Attach custom data to a transaction`verifyMac(array $data)`Verify MAC on payment return/notification callback`createPayment(string $id, string $token)`Initiate a recurring payment with a saved card token### Refunds

[](#refunds-1)

MethodDescription`createRefund(string $transactionId, array $data)`Refund a completed transaction (full or partial)`getRefund(string $refundId)`Get a single refund by ID`getRefunds(array $params = [])`Paginated refund list with date/status filters---

Query Parameter Reference
-------------------------

[](#query-parameter-reference)

**`getShopPaymentMethods`**

ParameterTypeRequiredDescription`transaction`stringnoFilter to methods valid for this transaction ID`amount`stringnoFilter by amount`currency`stringnoFilter by currency`country`stringnoFilter by customer country (ISO 3166-1 alpha-2)**`getAccountStatement`**

ParameterTypeRequiredDescription`since`string (YYYY-MM-DD)yes\*Start date. \*Required if `payout_id` not given`payout_id`stringyes\*Payout ID. \*Required if `since` not given`until`string (YYYY-MM-DD)noEnd date`page`stringnoPage number`per_page`stringnoResults per page**`getAccountStatementXML` / `getAccountStatementCAMT053`** — same as above but `until` is also required.

**`getTransactions`**

ParameterTypeRequiredDescription`since`string (YYYY-MM-DD)noCreated from date`until`string (YYYY-MM-DD)noCreated to date`completed_since`string (YYYY-MM-DD)noCompleted from date`completed_until`string (YYYY-MM-DD)noCompleted to date`refunded_since`string (YYYY-MM-DD)noRefunded from date`refunded_until`string (YYYY-MM-DD)noRefunded to date`status`stringnoOne or more statuses, comma-separated: `COMPLETED,CANCELLED``page`integernoPage number`per_page`integernoResults per page**`getRefunds`**

ParameterTypeRequiredDescription`since`string (YYYY-MM-DD)noFrom date`until`string (YYYY-MM-DD)noTo date`status`stringnoOne or more statuses, comma-separated`page`integernoPage number`per_page`integernoResults per page---

Responses
---------

[](#responses)

Every method returns an `MCResponse` object:

```
$response->code;      // int   — HTTP status (200 or 201)
$response->body;      // array — JSON-decoded body (null for XML responses)
$response->rawBody;   // string — raw response body
$response->headers;   // array — response headers
```

For XML responses (`getAccountStatementXML`, `getAccountStatementCAMT053`), use `$response->rawBody` — `$response->body` will be null.

Paginated responses include:

```
$response->headers['X-Total-Count'][0]; // total number of records
$response->headers['Link'][0];          // RFC 5988 pagination links
```

---

Error Handling
--------------

[](#error-handling)

All methods throw `MakeCommerce\MCException` on failure.

```
use MakeCommerce\MCException;

try {
    $response = $client->createTransaction([...]);
} catch (MCException $e) {
    $e->getMessage(); // Human-readable error or validation failure list
    $e->getCode();    // HTTP status code: 400, 401, 500, etc.
}
```

Common causes: missing required fields, invalid field format (amount must be a string), wrong credentials, invalid transaction ID.

---

Transaction Statuses
--------------------

[](#transaction-statuses)

StatusMeaning`CREATED`Transaction created, awaiting payment`PENDING`Payment in progress`COMPLETED`Payment successful`CANCELLED`Cancelled by customer`EXPIRED`Transaction expired without paymentRefund Statuses
---------------

[](#refund-statuses)

StatusMeaning`CREATED`Refund initiated`PENDING`Processing`SETTLED`Refund paid out to customer`CANCELLED`Refund cancelled`FAILED`Refund failed---

Notes
-----

[](#notes)

- **Amount is always a string** — pass `'49.90'`, not `49.90`
- **`customer.ip` is required** when creating a transaction
- **`app_info` is injected automatically** by the SDK — do not pass it yourself
- **`verifyMac` must always be called** before trusting return or notification data
- **`createPayment` is only for recurring card payments** with a saved token — not for regular checkout

---

License
-------

[](#license)

MIT

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance96

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.6% 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 ~68 days

Total

4

Last Release

18d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5ac646f411db49566209c6af8e121da7e9c1e26657d20b5ebb744bd82ee72b5c?d=identicon)[MakeCommerce](/maintainers/MakeCommerce)

---

Top Contributors

[![MathiasRanna](https://avatars.githubusercontent.com/u/46851862?v=4)](https://github.com/MathiasRanna "MathiasRanna (22 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")

---

Tags

restpsr7php-sdk

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/maksekeskus-makecommerce-php-sdk/health.svg)

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

###  Alternatives

[jlevers/selling-partner-api

PHP client for Amazon's Selling Partner API

4355.4M2](/packages/jlevers-selling-partner-api)[quickbooks/v3-php-sdk

The Official PHP SDK for QuickBooks Online Accounting API

28110.2M31](/packages/quickbooks-v3-php-sdk)[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.6M18](/packages/xeroapi-xero-php-oauth2)[paycore/openfintech-data

Openfintech data

21910.0k](/packages/paycore-openfintech-data)[onesignal/onesignal-php-api

A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com

34199.5k2](/packages/onesignal-onesignal-php-api)[dreamfactory/df-core

DreamFactory(tm) Core Components

1652.0k38](/packages/dreamfactory-df-core)

PHPackages © 2026

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