PHP code example of blutekic / emola-sdk
1. Go to this page and download the library: Download blutekic/emola-sdk library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
blutekic / emola-sdk example snippets
Bluteki\Sdk\Emola;
// configuring api access credentials
Emola::config(
'Emola WSDL',
'Your Username',
'Your Password',
'You Key',
'Partner Code',
'Language (pt | en)'
);
$transactionID = strtoupper(bin2hex(random_bytes(8)));
$transactionReference = strtoupper(bin2hex(random_bytes(8)));
$response = Emola::c2b( 10, '877777777', $transactionID, $transactionReference, 'SMS CONTENT WITHOUT AMOUNT');
echo '<pre>';
print_r($response->toArray());
Bluteki\Sdk\Emola;
// configuring api access credentials
Emola::config(
'Emola WSDL',
'Your Username',
'Your Password',
'You Key',
'Partner Code',
'Language (pt | en)'
);
$transactionID = strtoupper(bin2hex(random_bytes(8)));
$transactionReference = strtoupper(bin2hex(random_bytes(8)));
$response = Emola::b2c( 10, '877777777', $transactionID, 'SMS CONTENT');
echo '<pre>';
print_r($response->toArray());
Bluteki\Sdk\Emola;
// configuring api access credentials
Emola::config(
'Emola WSDL',
'Your Username',
'Your Password',
'You Key',
'Partner Code',
'Language (pt | en)'
);
Emola::fake();
$transactionID = strtoupper(bin2hex(random_bytes(8)));
$transactionReference = strtoupper(bin2hex(random_bytes(8)));
// start c2b fake transaction
$response = Emola::c2b( 10, '877777777', $transactionID, $transactionReference, 'SMS CONTENT WITHOUT AMOUNT');
// start b2c fake transaction
$response = Emola::b2c( 10, '877777777', $transactionID, 'SMS CONTENT');
echo '<pre>';
print_r($response->toArray());