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↓50%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 1mo ago

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 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

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

1209d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00d27c7f2736db2bfc1de08541fe26a1d23289898a3f8f98fa47096872379202?d=identicon)[mskayali](/maintainers/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

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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