simpaypl/sms_client

Official SimPay API Client

dev-master 2019-07-31 20:46 UTC

README

Official SimPay.pl PHP API Client

Requirements

  • PHP 5.3+

Installation

The SimPay_PHP_SMS_Client can be installed using Composer.

Composer

Inside of composer.json specify the following:

{
  "require": {
    "simpaypl/sms_client": "dev-master"
  }
}
<?php
// load Composer
require 'vendor/autoload.php';

define('API_KEY', 	'XXXXXXXX');
define('API_SECRET', 	'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');

try {
	
	$api = new Simpay(API_KEY, API_SECRET );

    	$api->getStatus(array(
			'service_id' 	=>	'2',							
			'number'		=>	'7355',
			'code'			=>	'5DB554',						
	));

	if( $api -> check() ){
		echo 'Kod poprawny';

		echo 'Numer telefonu z ktorego sms zostal wyslany ' . $api -> getSMSNumberFrom();

		echo 'Wartosc SMSa ' . $api -> getSMSValue( '7355' );
	}
	else{
		echo 'Kod nie poprawny';
	}


	
} catch(Exception $e) {
	echo	'Error:	'	.$e->getMessage();
}