承接 ossycodes/nigeriabulksms-php 相关项目开发

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

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

ossycodes/nigeriabulksms-php

Composer 安装命令:

composer require ossycodes/nigeriabulksms-php

包简介

Nigeriabulksms REST API client for PHP

README 文档

README

This repository contains the open source PHP client for Nigeriabulksms's API. Documentation can be found at: https://nigeriabulksms.com/sms-gateway-api-in-nigeria/

Latest Version on Packagist Total Downloads GitHub Actions

Requirements

  • Sign up for a free Nigeriabulksms account
  • after signing up, your username and password will be used for authenticating with the APIs
  • Nigeriabulksms API client for PHP requires PHP >= 7.4.

Installation

Composer installation

Manual installation

When you do not use Composer. You can git checkout or download this repository and include the Nigeriabulksms API client manually.

Usage

We have put some self-explanatory examples in the src/Examples directory, but here is a quick breakdown on how it works. First, you need to set up a Nigeriabulksms\Client. Be sure to replace YOUR_USERNAME and YOUR_PASSWORD with your real credentials.

require 'autoload.php';

$config = \Ossycodes\Nigeriabulksms\Configuration::getDefaultConfiguration()
            ->setUsername('YOUR_USERNAME')
            ->setPassword('YOUR_PASSWORD')
            ->setTimeout(10) //optional defaults to 10
            ->setConnectionTimeout(2); //optional defaults to 2

$client = new \Ossycodes\Nigeriabulksms\Client($config);

That's easy enough. Now we can query the server for information. Lets use getting your balance overview as an example:

try {

    // Get your balance
    $balance = $client->balance->read();

    var_dump($balance);
    
} catch (\Ossycodes\Nigeriabulksms\Exceptions\AuthenticateException $e) {

    // That means that your username and/or password is incorrect
    echo 'invalid credentials';

}
catch (\Ossycodes\Nigeriabulksms\Exceptions\BalanceException $e) {

    // That means that your balance is insufficient
    echo 'insufficient balance';

}
catch (\Exception $e) {
 
 var_dump($e->getMessage());

}

Sending Text SMS Message

require_once(__DIR__ . '/../autoload.php');

$config = \Ossycodes\Nigeriabulksms\Configuration::getDefaultConfiguration()
    ->setUsername('YOUR_USERNAME')
    ->setPassword('YOUR_PASSWORD')
    ->setTimeout(10) //optional defaults to 10
    ->setConnectionTimeout(2); //optional defaults to 2

$client = new \Ossycodes\Nigeriabulksms\Client($config);

try {

    $message = new \Ossycodes\Nigeriabulksms\Objects\TextMessage();
    $message->sender = 'YOUR_SENDER_NAME';
    $message->recipients = '2342222222222';
    $message->body =  'body of text message goes in here'; //should be less than 160 characters
    
    //send the text sms message
    $response = $client->message->send($message);
    
    var_dump($response);

} catch (\Ossycodes\Nigeriabulksms\Exceptions\AuthenticateException $e) {

    // That means that your username and/or password is incorrect
    echo 'invalid credentials';

} catch (\Ossycodes\Nigeriabulksms\Exceptions\BalanceException $e) {

    // That means that your balance is insufficient
    echo 'insufficient balance';

} catch (\Ossycodes\Nigeriabulksms\Exceptions\RequestDeniedException $e) {

    // That means that you do not have permission to perform this action
    echo 'this action is not permitted';

} catch (\Exception $e) {

    var_dump($e->getMessage());

}

Documentation

Complete documentation, instructions, and examples are available at: https://nigeriabulksms.com/sms-gateway-api-in-nigeria/

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 osaigbovoemmanuel1@gmail.com instead of using the issue tracker.

Credits

License

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

How do I say Thank you?

Please buy me a cup of coffee https://www.paypal.com/paypalme/osaigbovoemmanuel , Leave a star and follow me on Twitter .

ossycodes/nigeriabulksms-php 适用场景与选型建议

ossycodes/nigeriabulksms-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 172 次下载、GitHub Stars 达 5, 最近一次更新时间为 2023 年 09 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「ossycodes」 「nigeriabulksms-php」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ossycodes/nigeriabulksms-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ossycodes/nigeriabulksms-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 ossycodes/nigeriabulksms-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-09-21