定制 yvesniyo/intouch-sms 二次开发

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

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

yvesniyo/intouch-sms

Composer 安装命令:

composer require yvesniyo/intouch-sms

包简介

This is a php library to help developers include sms service, with IntouchSms gateway from RWANDA

README 文档

README

Source Code Latest Version Software License PHP Version Build Status Coverage Status Total Downloads

This is a php library to help developers include sms service, with IntouchSms gateway from RWANDA

Installation

Install this package as a dependency using Composer.

composer require yvesniyo/intouch-sms

Usage

This is the documantion

use Yvesniyo\IntouchSms\SmsSimple;

/** @var \Yvesniyo\IntouchSms\SmsSimple */
$sms = new SmsSimple();
$sms->recipients(["250780588642","0720710379"])
    ->message("Hello world")
    ->sender("intouchSenderId")
    ->username("intouchUsername")
    ->password("intouchPassword")
    ->apiUrl("www.intouchsms.co.rw/api/sendsms/.json")
    ->callBackUrl("");
print_r($sms->send());

That code works well, however it does call some static parameters such as senderId,Username,Password,ApiUrl and CallbackUrl. we can solve this by creating another class Called Sms which extends SmsAbstract

class Sms extends SmsAbstract
{
    public function __construct()
    {
        parent::__construct();

        //
    }

    public function configSender(): string
    {
        return "intouchSenderId";
    }

    public function configUsername(): string
    {
        return "intouchUsername";
    }

    public function configPassword(): string
    {
        return "intouchPassword";
    }

    public function configApiUrl(): string
    {
        return "www.intouchsms.co.rw/api/sendsms/.json";
    }

    public function configCallBackUrl(): string
    {
        return "";
    }


    public static function QuickSend($recipients, String $message, String $senderId = null)
    {
        $sms = new Sms();
        $sms->requiredData($recipients, $message, $senderId);
        return $sms->send();
    }
}

After creating this class you can now use simple codes like

$sms = new Sms();
// first parameter is recipients and second one is message
$sms->requiredData(["250780588642","0720710379"], "wassup");
print_r($sms->send());

NB: For some people who are not using composer remember to add:

include_once("../vendor/autoload.php");

Contributing

Contributions are welcome! Before contributing to this project, familiarize yourself with CONTRIBUTING.md.

To develop this project, you will need PHP 7.4 or greater, Composer,

After cloning this repository locally, execute the following commands:

cd /path/to/repository
composer install

Now, you are ready to develop!

Copyright and License

The yvesniyo/intouch-sms library is free and unencumbered software released into the public domain. Please see UNLICENSE for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unlicense
  • 更新时间: 2021-03-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固