buibr/mizu-voip-sms-php

该软件包最新版本(v2.0.2)没有可用的许可证信息。

使用Mizu VoIP切换发送短信

v2.0.2 2019-06-20 12:34 UTC

This package is auto-updated.

Last update: 2024-09-21 00:34:25 UTC


README

使用composer安装

composer requre buibr/budget-sms-php

用法

示例 1

$mizu = new \buibr\Mizu\mizuSMS( [
    'server' => 'the sip server of yours',
    'authKey'=> 'xxx',
    'authId'=>'xxx',
    'authpwd'=>'xxx',
]);

//  sender name
$mizu->setSender("Test"); // sender name

//  add recepient
$mizu->setRecipient('+38971xxxxxx');

//  add message
$mizu->setMessage('Testing the provider');

//  Send the message 
$send = $mizu->send();

示例 2

use buibr\Mizu\mizuSMS;

$mizu = new mizuSMS( [
    'server' => 'the sip server of yours',
    'anum'=>'xxx', // sender name
    'authKey'=> 'xxx',
    'authId'=>'xxx',
    'authpwd'=>'xxx',
]);

$credit = $mizu->balance();

响应

成功

buibr\Mizu\mizuResponse Object
(
    [code] => 200
    [type] => text/plain
    [time] => 0.417484
    [status] => 1
    [response] => $9.8
    [data] => Your credit is $9.8
)

错误

buibr\Mizu\mizuResponse Object
(
    [code] => 200
    [type] => text/plain
    [time] => 0.454436
    [status] => 
    [response] => auth failed: wrong key xxx NORETRY
    [data] => ERROR: auth failed: wrong key xxx NORETRY
)