Skip to content

abdulmueid/entity-reference

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Entity Reference Generator

This library generates Payment References for use with SIMO Banking System (Mozambique)

Installation

Install using composer

composer require abdulmueid/entity-reference

Usage

Here is a sample:

<?php

require_once "vendor/autoload.php";

$entity = '202020';
$amount = '500';
$referencesToGenerate = 10;
$generator = new abdulmueid\EntityReference\Generator();

// Generate a reference
$reference = $generator->generateReference($entity, $amount);

// Validate Reference, should return true
$generator->isReferenceValid($entity, $amount, $reference); // Should return true

// Generate n number of references
// Should return an array with valid references
$references = $generator->generateReferences($entity, $amount, $referencesToGenerate);

Tests

Run tests using phpunit

phpunit tests/GeneratorTest.php

License

See LICENSE.md