Skip to content

Commit

Permalink
docs: add example on readme
Browse files Browse the repository at this point in the history
  • Loading branch information
alphaolomi committed Mar 3, 2022
1 parent 43a2b96 commit 02e1961
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@

Easy integration to Mobile Money operators like Vodacom's Mpesa in your Laravel application.

## Documentation

🚧 Work in progress

## Example

For more instuction on package usage see example readme here https://github.com/alphaolomi/laravel-pesa-demo

## Installation

Expand All @@ -20,8 +26,25 @@ composer require openpesa/laravel-pesa

## Usage
### Using Facades

```php
//
use Openpesa\Pesa\Facades\Pesa;
// This route will be mapped to => `your-URL/api/charge`
Route::get('/charge', function () {
$response = Pesa::c2b([
'input_Amount' => 5000, // Amount to be charged
'input_Country' => 'TZN',
'input_Currency' => 'TZS',
'input_CustomerMSISDN' => '000000000001', // replace with your phone number
'input_ServiceProviderCode' => '000000', // replace with your service provider code given by M-Pesa
'input_ThirdPartyConversationID' => 'rasderekf', // unique
'input_TransactionReference' => 'asdodfdferre', // unique
'input_PurchasedItemsDesc' => 'Test Item'
]);


return $response;
});
```

## Testing
Expand Down

0 comments on commit 02e1961

Please sign in to comment.