承接 silali/laravel-daraja 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

silali/laravel-daraja

最新稳定版本:v4.0.0

Composer 安装命令:

composer require silali/laravel-daraja

包简介

A laravel package for the Safaricom Daraja APIs. Updating stanerz package to php 8.0

README 文档

README

styleci Scrutinizer Code Quality Packagist Packagist Packagist

This package provides you with a simple tool to make requests to Safaricom Daraja APIs so that you can focus on the development of your awesome applications instead of all the set up involved.

Installation

Install via composer

composer require starnerz/laravel-daraja

Register Service Provider

Note! This and next step are optional if you use laravel>=5.5 with package auto discovery feature.

Add service provider to config/app.php in providers section

Starnerz\LaravelDaraja\LaravelDarajaServiceProvider::class,

Register Facade

Register package facade in config/app.php in aliases section

Starnerz\LaravelDaraja\Facades\MpesaApi::class,

Publish Configuration File

php artisan vendor:publish --provider="Starnerz\LaravelDaraja\LaravelDarajaServiceProvider" --tag="config"

Fill in all the details you will be requiring for your application. Here are the env variables for quick copy paste.

DARAJA_CONSUMER_KEY=
DARAJA_CONSUMER_SECRET=

DARAJA_INITIATOR_NAME=
DARAJA_INITIATOR_CREDENTIAL=
DARAJA_INITIATOR_SHORTCODE=

DARAJA_STK_SHORTCODE=
DARAJA_STK_PASS_KEY=

Usage

If you have not created your Safaricom API application yet you can create one at Safaricom Developer

Each Safaricom API except Oauth has been implemented as a class on its own which you can use in your code.

$STK = new STK();
$STK->push('254727123456','10000','New Purchase','R3F3R3NC3');

If you prefer using the facade

MpesaApi::STK()->push('254727123456','10000','New Purchase','R3F3R3NC3');

If you will be using the C2B Api you can easily register the validation and confirmation URLs through artisan.

# php artisan daraja:register-urls

Security

If you discover any security related issues, please email stanleykimathi@gmail.com instead of using the issue tracker.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-05-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固