https://github.com/myckhel/laravel-vtpass
Vtpass for Laravel
https://github.com/myckhel/laravel-vtpass
airtime api dstv-recharge electric laravel mobile-topup purchase vtpass
Last synced: about 2 months ago
JSON representation
Vtpass for Laravel
- Host: GitHub
- URL: https://github.com/myckhel/laravel-vtpass
- Owner: myckhel
- License: other
- Created: 2020-07-04T11:32:05.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-14T11:40:53.000Z (about 4 years ago)
- Last Synced: 2025-03-24T12:56:16.283Z (2 months ago)
- Topics: airtime, api, dstv-recharge, electric, laravel, mobile-topup, purchase, vtpass
- Language: PHP
- Homepage: https://www.vtpass.com
- Size: 38.1 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Contributing: contributing.md
- Funding: .github/FUNDING.yml
- License: license.md
Awesome Lists containing this project
README
# Laravel Vtpass
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Total Downloads][ico-downloads]][link-downloads]
[![Build Status][ico-travis]][link-travis]This is where your description should go. Take a look at [contributing.md](contributing.md) to see a to do list.
## Installation
Via Composer
```bash
$ composer require myckhel/laravel-vtpass
```## Setup
The package will automatically register a service provider.You need to publish the configuration file:
```bash
php artisan vendor:publish --provider="Myckhel\Vtpass\VtpassServiceProvider"
```This is the default content of the config file ```vtpass.php```:
```php
env("VTPASS_USERNAME"),
"password" => env("VTPASS_PASSWORD"),
// specify to use sandbox mode or live mode
"mode" => env("VTPASS_MODE", "sandbox"), // app mode sandbox ?? live
];
```
Update Your Projects `.env` with:
```bash
[email protected]
VTPASS_PASSWORD=XXXXXXXXXXXXXXXXXXXX
VTPASS_MODE=sandbox
```## Basic Usage
```php
use Vtpass;Vtpass::verify($parameters);
Vtpass::purchase($parameters);
Vtpass::status($parameters);
Vtpass::variations($parameters);
```## Available Api's Model
```php
Myckhel\Vtpass\Support\MobileAirtime;
Myckhel\Vtpass\Support\MobileData;
Myckhel\Vtpass\Support\Electric;
Myckhel\Vtpass\Support\TvSub;
Myckhel\Vtpass\Support\Education;
```## Explicit Usage
### Airtime
```php
use Myckhel\Vtpass\Support\MobileAirtime;public function buyAirtime(){
$serviceID = 'mtn'
$phone = '111111111'
$amount = 100return MobileAirtime::purchase([
'serviceID' => $serviceID,
'phone' => $phone,
'amount' => $amount,
]);
}
```
#### Response
```json
{
"code":"000",
"response_description":"TRANSACTION SUCCESSFUL",
"requestId":"SAND0192837465738253A1HSD",
"transactionId":"1563873435424",
"amount":"50.00",
"transaction_date":{
"date":"2019-07-23 10:17:16.000000",
"timezone_type":3,
"timezone":"Africa/Lagos"
},
"purchased_code":""
}
```
#### Status
```php
MobileAirtime::status([
'request_id' => '24545544'
]);
```
#### Verify Electricity
```php
use Myckhel\Vtpass\Support\Electric;$serviceID = 'ikeja-electric'
$meter = '111111111'
$type = 'prepaid'Electric::verify([
'serviceID' => $serviceID,
'billersCode' => $meter,
'type' => $type,
]);
```## Change log
Please see the [changelog](changelog.md) for more information on what has changed recently.
## Testing
``` bash
$ composer test
```## Contributing
Please see [contributing.md](contributing.md) for details and a todolist.
## Security
If you discover any security related issues, please email author instead of using the issue tracker.
## Credits
- [Myckhel][link-author]
- [All Contributors][link-contributors]## License
license. Please see the [license file](license.md) for more information.
[ico-version]: https://img.shields.io/packagist/v/myckhel/laravel-vtpass.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/myckhel/laravel-vtpass.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/myckhel/laravel-vtpass/master.svg?style=flat-square
[ico-styleci]: https://styleci.io/repos/12345678/shield[link-packagist]: https://packagist.org/packages/myckhel/laravel-vtpass
[link-downloads]: https://packagist.org/packages/myckhel/laravel-vtpass
[link-travis]: https://travis-ci.org/myckhel/laravel-vtpass
[link-styleci]: https://styleci.io/repos/12345678
[link-author]: https://github.com/myckhel
[link-contributors]: ../../contributors