Satuh Library For PHP
Satuh Libarry enables you to work with Satuh APIs such as Satuh Authentication, Satuh SMS, Satuh Notification, Satuh PLN, Satuh Voucher Game, or Satuh Pulsa
Install this libary through composer.
composer require pmb/satuh:^0.3.3.1
satuh\auth is authentication to access our lib. Also to grant our Satuh User information, which you can access it for your login application.
<?php
use satuh\auth;
$satuh = new auth("CLIENT_ID","CLIENT_SECRET","CLIENT_REDIRECT_URI");
$satuh->authorize('code'); //this action will give you an authenticaion code in your CLIENT_REDIRECT_URI
//under your redirect uri;
$code = $_GET['code'];
$satuh->setOauthCode($code);
$accessToken = $satuh->getAccessToken('authorization_code');
$user = $satuh->getUserData($accessToken['access_token']);
print_r($user);Only Cooperate Vendor could use this.
<?php
use satuh\pulsa;
$pulsa = new pulsa("CLIENT_ID","CLIENT_SECRET","ENVIRONMENT");<?php
use satuh\pln;
$pln = new pln("CLIENT_ID","CLIENT_SECRET","ENVIRONMENT");<?php
use satuh\game;
$game = new game("CLIENT_ID","CLIENT_SECRET","ENVIRONMENT");For more information, see the official [API documents]. If it's your first time using this library, we recommend taking a look at our official [API documents]
<?php
use satuh\sms;
$sms = new sms("USERNAME","PASSWORD","ENVIRONMENT");
$reponse = $sms->send_sms("phone","message",true)