PHPackages                             mskayali/moka-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. [API Development](/categories/api)
4. /
5. mskayali/moka-php

ActiveLibrary[API Development](/categories/api)

mskayali/moka-php
=================

Moka PHP Client

1.1(3y ago)057↓93.3%MITPHPPHP &gt;=5.6

Since Sep 26Pushed 2y agoCompare

[ Source](https://github.com/mskayali/moka-php)[ Packagist](https://packagist.org/packages/mskayali/moka-php)[ RSS](/packages/mskayali-moka-php/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

Moka API PHP Client
===================

[](#moka-api-php-client)

The Moka API PHP Client provides convenient access to the [Moka API](https://developer.moka.com/) from applications written in the PHP language.

[![image](https://camo.githubusercontent.com/cc5944a8196cfbad4843e51ffa6035385dfa37e62f593d49def27ecda5f3c1f5/68747470733a2f2f6f7074696d6973746875622e636f6d2f63646e2f6d6f6b612f6d6f6b612d6170692d7068702d636c69656e742e706e673f7632)](https://camo.githubusercontent.com/cc5944a8196cfbad4843e51ffa6035385dfa37e62f593d49def27ecda5f3c1f5/68747470733a2f2f6f7074696d6973746875622e636f6d2f63646e2f6d6f6b612f6d6f6b612d6170692d7068702d636c69656e742e706e673f7632)

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

[](#requirements)

PHP 5.6.0 and later.

Composer
--------

[](#composer)

You can install the bindings via [Composer](http://getcomposer.org/). Run the following command:

```
composer require moka/moka-php
```

To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading):

```
require_once('vendor/autoload.php');
```

Manual Installation
-------------------

[](#manual-installation)

If you do not wish to use Composer, you can download the [latest release](https://github.com/optimisthub/moka-php/releases). Then, to use the bindings, include the `autoload.php` file.

```
require_once('autoload.php');
```

Dependencies
------------

[](#dependencies)

The bindings require the following extensions in order to work properly:

- [`curl`](https://secure.php.net/manual/en/book.curl.php)
- [`json`](https://secure.php.net/manual/en/book.json.php)

If you use Composer, these dependencies should be handled automatically. If you install manually, you'll want to make sure that these extensions are available.

SSL / TLS
=========

[](#ssl--tls)

PCI-DSS rules only allow the use of TLS 1.2 and above protocols. Please ensure that your application POST to Moka URL over these protocols. Otherwise, errors such as 'Connection will be closed or Connection Closed' will be received.

Getting Started
---------------

[](#getting-started)

Simple usage looks like

```
$moka = new \Moka\MokaClient([
    'dealerCode' => 'xxx',
    'username' => 'xxx',
    'password' => 'xxx',
]);
```

By default PHP client connects to Live Environment URL:  For testing purposes please use Test Environment URL:

```
$moka = new \Moka\MokaClient([
    'dealerCode' => 'xxx',
    'username' => 'xxx',
    'password' => 'xxx',
    'baseUrl' => 'https://service.refmoka.com'
]);
```

Create Payment
--------------

[](#create-payment)

```
$moka = new \Moka\MokaClient([
    'dealerCode' => 'xxx',
    'username' => 'xxx',
    'password' => 'xxx',
]);

$request = new Moka\Model\CreatePaymentRequest();

$request->setCardHolderFullName('John Doe');
$request->setCardNumber('5555666677778888');
$request->setExpMonth('09');
$request->setExpYear('2024');
$request->setCvcNumber('123');
$request->setAmount(0.01);
$request->setCurrency('TL');
$request->setInstallmentNumber(1);
$request->setClientIp('192.168.1.116');
$request->setOtherTrxCode('3D5ABC24-456"');
$request->setIsPoolPayment(0);
$request->setIsTokenized(0);
$request->setIntegratorId(0);
$request->setSoftware('Software');
$request->setDescription('');
$request->setIsPreAuth(0);

$buyer = new Moka\Model\Buyer();
$buyer->setBuyerFullName('John Doe');
$buyer->setBuyerGsmNumber('5551110022');
$buyer->setBuyerEmail('email@email.com');
$buyer->setBuyerAddress('Levent Mah. Meltem Sok. İş Kuleleri Kule 2 No: 10 / 4 Beşiktaş / İstanbul');

$request->setBuyerInformation($buyer);

$payment = $moka->payments()->create($request);

$payment->getData();
$payment->getResultCode();
$payment->getResultMessage();
$payment->getException();
```

Documentation
-------------

[](#documentation)

See the [Moka API docs](https://developer.moka.com).

Test Cards
----------

[](#test-cards)

See the [Test Cards](https://developer.moka.com/home.php?page=test-kartlari).

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.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 ~121 days

Total

2

Last Release

1254d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9249493?v=4)[Mehmet Şeref Kayalı](/maintainers/mskayali)[@mskayali](https://github.com/mskayali)

---

Top Contributors

[![mskayali](https://avatars.githubusercontent.com/u/9249493?v=4)](https://github.com/mskayali "mskayali (7 commits)")[![optimistlab](https://avatars.githubusercontent.com/u/62239469?v=4)](https://github.com/optimistlab "optimistlab (3 commits)")[![fatihtoprak](https://avatars.githubusercontent.com/u/2514952?v=4)](https://github.com/fatihtoprak "fatihtoprak (1 commits)")

---

Tags

mokamoka phpmoka apimoka php client

### Embed Badge

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

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k15](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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