explicador/e2payments-php-sdk 问题修复 & 功能扩展

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

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

explicador/e2payments-php-sdk

最新稳定版本:v1.0.4

Composer 安装命令:

composer require explicador/e2payments-php-sdk

包简介

Pacote de integração de pagamentos online por MPesa, eMola, MKesh, conta móvel, BIM, Master Card e mais

README 文档

README

Latest Version on Packagist Build Status Quality Score Total Downloads

Plataforma e2Payments

This package seeks to help php developers implement the e2Payments APIs without much hustle. It is based on the REST API whose documentation is available on https://e2payments.explicador.co.mz/docs.

Installation

You can install the package via composer:

composer require explicador/e2payments-php-sdk

Usage

// Set the consumer key and consumer secret as follows
$mpesa = new \Explicador\E2paymentsPhpSdk\Mpesa();
$mpesa->setClientId('your e2payments client id');
$mpesa->setClientSecret('your e2payments client secret');
$mpesa->setWalletId('your walletId from e2payments');// 'live' production environment 

//This creates transaction between an M-Pesa short code to a phone number registered on M-Pesa.

$result = $mpesa->c2b($phone_number, $amount, $reference);

Example

// Your variables

// The e2payments is REST API based platform
// find or create your credential from: https://e2payments.explicador.co.mz/admin/credentials

$client_id = 'oQPGhzqyDRilpzvTT6g0nhSeomVQ9G7zZrvY4v00'; //you must change
$client_secret = '961022ed-08f6-4980-a1b3-f017fd15b800'; //you must change

// find your wallet_id from: https://e2payments.explicador.co.mz/admin/mpesa
// or in the organizations where you were invited 
// The wallet_id starts by (#), insert here without (#)

$wallet_id = '111111'; //you must change
 
// SDK initiation for mpesa transaction
$mpesa = new \Explicador\E2paymentsPhpSdk\Mpesa([
   'client_secret' => $client_secret,
   'client_id'     => $client_id,
   'wallet_id'     => $wallet_id,
]);

//This creates transaction between an M-Pesa short code to a phone number registered on M-Pesa.
$result = $mpesa->c2b($phone_number, $amount, $reference);

echo var_dump($result);

Common HTTP Status Codes

Status Code Description Explanation
200 OK Request Executed successfully and stored in e2Payments Platform
201 Added The transaction executed successfully and stored in e2Payments Platform
400 Bad Request Wallet, origin or other mpesa issues
403 Forbidden If the Wallet ID does not exists or does not belongs to the user (if walletId belongs to some organization, the user must be invited)
401 Unauthenticated Client ID or Client Secret issues
500 Server error If this happens please, report to Explicador Team.

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email developers@explicador.co.mz instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

PHP Package Boilerplate

This package was generated using the PHP Package Boilerplate.

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-04-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固