espressobyte / firemobile-php
Firemobile API Client for PHP
1.0.0
2021-12-22 06:44 UTC
Requires
- php: ^7.2 || ^8.0
- laravie/codex: ^5.1
- laravie/codex-common: ^1.4
- php-http/multipart-stream-builder: ^1.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.4
- laravie/parser: ^2.0
- mockery/mockery: ^1.3
- php-http/guzzle7-adapter: ^0.1.1
- phpunit/phpunit: ^7.5 || ^8.4 || ^9.0
This package is auto-updated.
Last update: 2024-11-18 02:00:31 UTC
README
This package is for sending SMS via Firemobile service providers.
Installation
You can install the package via composer:
composer require espressobyte/firemobile-php
Usage without set option for delivery report callback
<?php use Firemobile\Client; use Firemobile\FiremobileAuth; use Firemobile\Message; use Firemobile\Requests\Sms; use GuzzleHttp\Client as HttpClient; $message = Message::make() ->setFrom('+60123456789') ->setTo('+60123226789') ->setText('Firemobile message.'); $firemobile = Client::make(new HttpClient(),[ 'username' => 'secret', 'password' => 'secret', ]); $response = Sms::make($message,FiremobileAuth::make($firemobile)) ->send(); echo $response->getStatusCode(); echo $response->getBody();
Usage with option for delivery report received
<?php use Firemobile\Client; use Firemobile\FiremobileAuth; use Firemobile\Message; use Firemobile\Requests\Sms; use GuzzleHttp\Client as HttpClient; $callbackUrl = 'https://demo.test/callback'; $message = Message::make() ->setFrom('+60123456789') ->setTo('+60123226789') ->setText('Firemobile message.'); $firemobile = Client::make(new HttpClient(),[ 'endpoint' => 'https://firemobile.send.com:8000/cgi-bin', 'username' => 'c2VjcmV0Cg==', 'password' => 'c2VjcmV0Cg==', ]) ->callback($callbackUrl); $response = Sms::make($message,FiremobileAuth::make($firemobile))->send(); echo $response->getStatusCode(); echo $response->getBody();
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Security
If you discover any security related issues, please email mtajulasri@gmail.com instead of using the issue tracker.