fromhome/zenziva-client-api

Unofficial Zenziva client api
9,471
Install
composer require fromhome/zenziva-client-api
Latest Version:6.0.1
PHP:^8.0
License:MIT
Last Updated:Jun 4, 2025
Links: GitHub  ·  Packagist
Maintainer: NoorAdiana

Build Status codecov Latest Stable Version License Total Downloads

ZenzivaClientApi

Ini adalah client api untuk zenziva sms gateway.

Install

composer require ziswapp/zenziva-client-api

Penggunaan


<?php

use Ziswapp\Zenziva\ClientFactory;
use Symfony\Component\HttpClient\HttpClient;

$url = '';
$key = '';
$secret = '';

$httpClient = HttpClient::create();

// Crete client
$regular = ClientFactory::regular($httpClient, $key, $secret); // Regular client
$masking = ClientFactory::masking($httpClient, $key, $secret); // Masking client
$otp = ClientFactory::otp($httpClient, $key, $secret); // Masking with otp client
$smsCenter = ClientFactory::center($httpClient, $key, $secret, $url); // SMS Center client

// Alternative
$regular = ClientFactory::make($httpClient, ClientFactory::TYPE_REGULAR, $key, $secret); // Regular client
$masking = ClientFactory::make($httpClient, ClientFactory::TYPE_MASKING, $key, $secret); // Masking client
$otp = ClientFactory::make($httpClient, ClientFactory::TYPE_MASKING_OTP, $key, $secret); // Masking with otp client
$smsCenter = ClientFactory::make($httpClient, ClientFactory::TYPE_SMS_CENTER, $key, $secret, $url); // SMS Center client

// Zenziva Regular Operation
$httpClient = HttpClient::create();
$regular = ClientFactory::make($httpClient, ClientFactory::TYPE_REGULAR, $key, $secret); // Regular client
$regular->send('081318788271', 'Sending notification.'); // Return array

// Zenziva Masking Operation
$httpClient = HttpClient::create();
$masking = ClientFactory::make($httpClient, ClientFactory::TYPE_MASKING, $key, $secret); // Masking client
$masking->balance(); // Check balance return Credit object
$masking->send('081318788271', 'Sending notification.'); // Return Outbox object
$masking->setIsOtp(true); // Change to masking otp client

// Zenziva SMS Center Operation
$smsCenter = ClientFactory::make($httpClient, ClientFactory::TYPE_SMS_CENTER, $key, $secret, $url); // SMS Center client
$smsCenter->balance(); // Check balance return Credit object, will be throw CreditExpiredException or CreditLimitException if balance is 0 and expired date < now
$smsCenter->send('081318788271', 'Sending notification.'); // Return Outbox object
$smsCenter->outbox(new DateTime(), new DateTime()); // Get outbox by date, return array Outbox object
$smsCenter->inbox(new DateTime(), new DateTime()); // Get inbox by date, return array Inbox object
$smsCenter->status('messageId'); // Get status sms by messageId, return Outbox object

Related Packages

daemon144key/zenziva-notification-channel

Zenziva SMS notifications driver.

4,207 2
toplan/laravel-sms

A mobile phone number validation solution based on laravel

80,664 835
laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

9,173,241 258
kavenegar/laravel

laravel 4 and 5 kavenegar integration

368,693 86
rinvex/laravel-authy

Rinvex Authy is a simple wrapper for Authy TOTP, the best rated Two-Factor Authe...

78,132 32