Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new PhpCsFixer\Config())
->setRules([
'@PSR12' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
'blank_line_before_statement' => [
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
],
'phpdoc_single_line_var_spacing' => true,
'phpdoc_var_without_name' => true,
'class_attributes_separation' => [
'elements' => [
'method' => 'one',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
12 changes: 8 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
"php": "^7.2|^8.0",
"ext-json": "*",
"ext-openssl": "*",
"guzzlehttp/guzzle": "^6.0|^7.4",
"phpseclib/phpseclib": "~3.0"
"guzzlehttp/guzzle": "^6.5|^7.4"
},
"require-dev": {
"phpunit/phpunit": "^8.5|^9.5"
"phpunit/phpunit": "^8.5|^9.5",
"friendsofphp/php-cs-fixer": "^3.0",
"pestphp/pest": "^1.20"
},
"autoload": {
"psr-4": {
Expand All @@ -50,6 +51,9 @@
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
}
}
41 changes: 41 additions & 0 deletions docs/docs/tigopesa/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Tigopesa

## Usage:

```php
<?php
$igo = new Tigopesa([
'clientId' => 'your-client-id',
'secret' => 'consumer secret',
'apiUrl' => 'your provided tigopesa api url',
'pin' => 'your provided tigopesa pin number',
'accountNumber' => 'your provided tigopesa account number',
'accountId' => 'your provided tigopesa account id',
'appUrl' => 'your app url',
'redirectUrl' => 'your redirect url',
'callbackUrl' => 'your callback url',
'currencyCode' => 'TZS', // currency put TZS for Tanzanian Shillings
'lang' => 'sw', // language code en for English and sw for Swahili
]);

$refId = generateRandomString(); // sample: TIGOPESA12KHJGKJHKJHG

$response = $tigo->c2b([
"customerFirstName" => "James",
"customerFirstName" => "Hilton",
"customerEmail" => "[email protected]",
"amount" => 4000,
"referenceId" => "123456789", // unique reference id
]);

var_dump($response);
```

## Response:

```php

```

## Misc

2 changes: 1 addition & 1 deletion examples/pesa-demo/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Simple SDK usage",
"type": "project",
"require": {
"openpesa/pesa": "^0.0.7"
"openpesa/pesa": "dev-multi-venfor"
},
"license": "MIT",
"authors": [
Expand Down
18 changes: 18 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
<directory suffix=".php">./src</directory>
</include>
</coverage>
</phpunit>
21 changes: 0 additions & 21 deletions phpunit.xml.dist

This file was deleted.

Loading