stacks/mpesa

此包的最新版本(dev-master)没有可用的许可信息。

Mpesa 库

dev-master 2022-01-24 09:05 UTC

This package is auto-updated.

Last update: 2024-09-24 15:01:57 UTC


README

https://stackbooks.org

Mpesa 库

安装

composer require stacks/mpesa

账户设置和身份验证 `

<?php
use Stacks\Mpesa\Account;

$key='application-key';
$secret='application secret';

// authentication is handled automatically when the credentials are valid
$account = new Account($key,$secret);

`

注册客户到业务回调 `

<?php
use Stacks\Mpesa\Account;

$key='application-key';
$secret='application secret';
$shortcode='pabill or till shortcode provided';
$confirm_url='https://example.com/confirm';
$validate_url='https://example.com/validate';

// authentication is handled automatically when the credentials are valid
$account = new Account($key,$secret,null,$shortcode);

// default command used is 'Completed'
$account->register($confirm_url,$validate_url);

//to  override the default, i.e in cases where you need validation, pass a third parameter 'Cancelled/Completed'
$account->register($confirm_url,$validate_url,'Cancelled');