mam-laka/payment-sdk 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mam-laka/payment-sdk

最新稳定版本:1.0.0

Composer 安装命令:

composer require mam-laka/payment-sdk

包简介

A PHP SDK for processing payments with Mamlaka.

README 文档

README

Mamlaka SDK is a PHP library for integrating with the Mamlaka API.

Installation

Install using Composer:

composer require mama-laka/payment-sdk

Usage

1. Set up the MamlakaAPI object and authenticate

$api = new MamlakaAPI('production');
$response1 = $api->getToken('username', 'password');
if(!$response1['error']){
    $response = $api->initiateMobilePayment(
        'merchantid',
        'KES',
        1.0,
        '254768899729',
        'M-Pesa',
        'externalId3',
        'https://b8ca-217-21-116-242.ngrok-free.app'
    );
    print_r($response);
} else {
    echo "Authentication failed
";
}

3. Example API Methods

3.1. getToken

Authenticate and get the token:

$response = $api->getToken('username', 'password');

3.2. initiateMobilePayment

Initiate a mobile payment:

$response = $api->initiateMobilePayment(
    'merchantid',
    'KES',
    1.0,
    '254768899729',
    'M-Pesa',
    'externalId',
    'https://b8ca-217-21-116-242.ngrok-free.app'
);

License

This project is licensed under the MIT License - see the LICENSE file for details.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-12