Skip to content

Commit

Permalink
Updated and Cleaned up code
Browse files Browse the repository at this point in the history
- Set Origin and Hostname from config
- Updated README
  • Loading branch information
abdulmueid committed Dec 29, 2018
1 parent ce8c498 commit b766ad3
Show file tree
Hide file tree
Showing 187 changed files with 13,451 additions and 7,779 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.idea/
/docs/cache/
/vendor/
/tests/coverage/
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@

This library provides easy way to integrate PHP applications with the M-Pesa API.

## NOTICE

Currently, this library is only usable if you are in the M-Pesa test group and have access to the API portal and credentials.

The M-Pesa API is quickly evolving. Therefore the code is currently for testing purposes only and will evolve with the M-Pesa API until it reaches a stable state.

**DO NOT USE IN PRODUCTION!**

## Installation

Install using composer:
Expand All @@ -23,12 +15,12 @@ composer require abdulmueid/mpesa
```php
$config = \abdulmueid\mpesa\Config::loadFromFile('/path/to/config.php');
```
See sample configuration file in examples folder.

2. Create a Transaction using the configuration.
```php
$transaction = new \abdulmueid\mpesa\Transaction($config);
```
See sample configuration file in examples folder.

3. Execute API operations and pass appropriate parameters.

Expand All @@ -49,6 +41,18 @@ composer require abdulmueid/mpesa
$query = $transaction->query(...);
```
## Testing
1. Update tests/config.test.php with required parameters
2. Enter the test MSISDN in tests/MPesaTest.php on line 35
3. Run **PHPUnit 7** phar archive in the project folder (https://phar.phpunit.de/phpunit-7.phar)
4. Check the phone for M-Pesa payment requests

The test case currently creates a new transaction, queries the transaction status and refunds the transaction.
**Tests may be billable when running on production.**

## Generating Docs
1. Run **phpDocumentor 2.9** phar archive in the project folder (http://phpdoc.org/phpDocumentor.phar)

## License

This library is release under the MIT License. See LICENSE file for details.
Expand Down
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
"require": {
"php": "^7.0"
},
"require-dev": {
"phpunit/phpunit": "^6.5"
},
"autoload": {
"psr-4": {
"abdulmueid\\mpesa\\": "src/"
Expand Down
Loading

0 comments on commit b766ad3

Please sign in to comment.