Giter VIP home page Giter VIP logo

termiiphp's Introduction

Termii PHP

Github top language License Github issues Github forks


About   |   Requirements   |   Usage   |   Contribution   |   License   |   Author


🎯 About

PHP Library for Termii API

✅ Requirements

Before starting 🏁, you need to have Git and PHP 7+ installed.

🏁 Usage

# Installation
$ composer require okolaa/termiiphp

#Usage

  • Send sms
$termii = new Termii('TERMII_SENDER_ID', 'TERMII_API_KEY');

$sent = $termii->sendMessage(
    [
        "phone_number" => $_ENV["TEST_PHONE_NUMBER"],
        "message" => "Unit Test Message"
    ]
);
  • SendToken
$termii = new Termii('TERMII_SENDER_ID', 'TERMII_API_KEY');

//Set Options
$termii->setMaxAttempts(2);
  ->setPinTimeToLive(5);
  ->SetPinLength(4);
  ->setPinType("NUMERIC");
  ->setMaxAttempts(1);

$sent = $termii->sendToken(
    [
        "phone_number" => $_ENV["TEST_PHONE_NUMBER"],
        "message" => "Your pin is < _pin_ >"
    ]
);
  • verifyToken
$termii = new Termii('TERMII_SENDER_ID', 'TERMII_API_KEY');
$response = $termii->verifyToken(
    [
        "pin_id" => "f862cb33-9dd3-42b3-b705-18200c0e800f",
        "pin" => "1234",
    ]
);
  • InApp Token
$termii = new Termii('TERMII_SENDER_ID', 'TERMII_API_KEY');
$response = $termii->InAppToken(
    [
        "phone_number" => $_ENV["TEST_PHONE_NUMBER"],
    ]
);
  • Available Methods
$termii = new Termii('TERMII_SENDER_ID', 'TERMII_API_KEY');

$termii->sendMessage();
$termii->sendToken();
$termii->verifyToken();
$termii->InAppToken();
$termii->sendWithAutoGeneratedNumber();
$termii->getSenderIds();
$termii->getResponse();
$termii->setMaxAttempts();
$termii->setPinTimeToLive();
$termii->setPinType();
$termii->setChannel();
$termii->SetPinPlaceholder();
$termii->setMessageType();
$termii->setTokenMessageType();
$termii->SetPinLength();
$termii->setSender();
$termii->setAPIKey();
$termii->getSenderIds();
$termii->getBallance();
$termii->search();

🔨 Countribution

# fork and Clone the fork project
# Access the folder
$ cd termiiphp

# Install dependencies
$ composer Install

# Create .env and update
$ cp .ev.example .env

# Run test
$ ./vendor/phpunit/phpunit/phpunit tests

📝 License

This project is under license from MIT. For more details, see the LICENSE file.

Made with ❤️ by Douglas Okolaa

 

Todo:

  • Update Readme with Usage

Back to top

termiiphp's People

Contributors

douglasokolaa avatar drchibs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.