Giter Club home page Giter Club logo

budget-sms-php's Introduction

budget-sms-php

Install with composer

composer require buibr/budget-sms-php

Usage:

Example 1:
$budget = new \buibr\Budget\BudgetSMS( [
    'username'=>'xxx',
    'userid'=> 'xxx',
    'handle'=>'xxx',
]);

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

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

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

//  Send the message 
$send = $budget->send();
Example 2:
use buibr\Budget\BudgetSMS;

$budget = new BudgetSMS( [
    'username'=>'xxx',
    'userid'=> 'xxx',
    'handle'=>'xxx',
    'from'=>'Test',
    'price'=> 1, // optional
    'mccmnc'=> 1, // optional
    'credit'=> 1, // optional
]);

$send = $budget->send( '+38971xxxxxx', 'message content' );

Response examples:

Success:
buibr\Budget\BudgetResponse Object
(
    [code] => 200
    [type] => text/plain; charset=UTF-8
    [time] => 0.494388
    [status] => 1
    [response] => Array
        (
            [transaction] => 76208843
            [price] => 0.02
            [time] => 1
            [mccmnc] => 29401
            [credit] => 590.5892
        )

    [data] => OK 76208843 0.02 1 29401 590.5892
)
Error:
buibr\Budget\BudgetResponse Object
(
    [code] => 200
    [type] => text/plain; charset=UTF-8
    [time] => 0.32309
    [status] => 
    [response] => SMS message text is empty
    [data] => ERR 2001
)

Push DLR Handler (webhook to accept requests):

Request:
$budget = new BudgetSMS;
$dlr = $budget->pushDlr( $payload );
Response:
Array
(
    [code] => 
    [type] => 
    [time] => 
    [status] => 
    [smsid] => xxx
    [sms_code] => 7
    [sms_message] => SMSC error, message could not be processed
)

Pull DLR Handler:

Request
$budget = new BudgetSMS( [
    'username'=>'xxx',
    'userid'=> 'xxx',
    'handle'=>'xxx',
]);
$dlr = $budget->pullDLR('xxxx');
Response
Array
(
    [code] => 200
    [type] => text/html; charset=UTF-8
    [time] => 0.261374
    [status] => 
    [smsid] => xxx
    [sms_code] => 8
    [sms_message] => Message not allowed
    [data] => OK 8
)

budget-sms-php's People

Contributors

buibr avatar willytietok avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.