blutekic / emola-sdk
online payment manager using emola gateway
v1.0.1
2024-10-21 12:21 UTC
Requires
- php: >=8.0
- guzzlehttp/guzzle: ^7.0
This package is not auto-updated.
Last update: 2025-06-16 15:31:51 UTC
README
Dependency for consumption of the Emola WebService
Installation
To install this dependency, just run the command below:
composer require blutekic/emola-sdk
Usage
To use this manager, just follow the example below:
C2B
<?php require __DIR__.'/../../vendor/autoload.php'; use \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());
B2C
<?php require __DIR__.'/../../vendor/autoload.php'; use \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());
FAKE TRANSACTIONS (C2B & B2C)
<?php require __DIR__.'/../../vendor/autoload.php'; use \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());
Requirements
- PHP 8.0 or higher required