定制 moka/moka-php 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

moka/moka-php

最新稳定版本:1.1

Composer 安装命令:

composer require moka/moka-php

包简介

Moka United PHP Client

README 文档

README

The Moka United API PHP Client provides convenient access to the Moka United API from applications written in the PHP language.

image

Requirements

PHP 5.6.0 and later.

Composer

You can install the bindings via Composer. Run the following command:

composer require moka/moka-php

To use the bindings, use Composer's autoload:

require_once('vendor/autoload.php');

Manual Installation

If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the autoload.php file.

require_once('autoload.php');

Dependencies

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

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

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

Simple usage looks like

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

By default PHP client connects to Live Environment URL: https://service.moka.com For testing purposes please use Test Environment URL: https://service.refmoka.com

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

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

See the Moka United API docs.

Test Cards

See the Test Cards.

统计信息

  • 总下载量: 129
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固