定制 alphaolomi/swahilies-php 二次开发

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

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

alphaolomi/swahilies-php

最新稳定版本:v0.1.0

Composer 安装命令:

composer require alphaolomi/swahilies-php

包简介

Swahilies for PHP

README 文档

README

Latest Version on Packagist Tests Total Downloads

Installation

You can install the package via composer:

composer require alphaolomi/swahilies-php

Usage

use Alphaolomi\Swahilies\Swahilies;

$swahilies = new Swahilies([]);
// Or
$swahilies = Swahilies::create([
    'apiKey' => 'csdheruvhhjdhvjadmvjehrve',
    'username' => 'Company name',
    'isLive' => false, // ie. sandbox mode
]);

$response = $swahilies->payments()->request([
    // TZS by default
    'amount' => 50000,
    // 255 is country code for Tanzania, Only Tanzania is supported for now
    'orderId' => $order->id,
    'phoneNumber' => "255783262616",
    'cancelUrl' => "https://yoursite.com/cancel",
    'webhookUrl' => "https://yoursite.com/response",
    'successUrl' => "https://yoursite.com/success",
    'metadata' => [],
]);

print_r($response);

// Output:
// [
//     "payment_url" => "https://swahiliespay.invict.site/make-payment-1.html?order=jdhvjadmvjehrve"
// ]
// Webhooks
// You can use the following code to verify the webhook signature

$requestBody = /** get the request body from the webhook request **/;

$isValid = $swahilies->webhooks()
    ->verify($request->getContent()); // true/false

Available APIs

Payments

  • all() - Get all payment transactions
  • directRequest($data) - Make a direct Push USSD from your app
  • request($data) - Make a payment request
  • find($id) - Get payment transaction information

Webhooks

🚧 Work in progress

  • getDisget($data) - Generate requery body digest
  • verify($data) - Verify request body

Testing

Using PestPHP for testing.

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固