Code Monkey home page Code Monkey logo

laravel-vtpass's Introduction

Laravel Vtpass

Latest Version on Packagist Total Downloads Build Status

This is where your description should go. Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require myckhel/laravel-vtpass

Setup

The package will automatically register a service provider.

You need to publish the configuration file:

php artisan vendor:publish --provider="Myckhel\Vtpass\VtpassServiceProvider"

This is the default content of the config file vtpass.php:

<?php

return [
  "username"          => 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:

[email protected]
VTPASS_PASSWORD=XXXXXXXXXXXXXXXXXXXX
VTPASS_MODE=sandbox

Basic Usage

use Vtpass;

Vtpass::verify($parameters);
Vtpass::purchase($parameters);
Vtpass::status($parameters);
Vtpass::variations($parameters);

Available Api's Model

Myckhel\Vtpass\Support\MobileAirtime;
Myckhel\Vtpass\Support\MobileData;
Myckhel\Vtpass\Support\Electric;
Myckhel\Vtpass\Support\TvSub;
Myckhel\Vtpass\Support\Education;

Explicit Usage

Airtime

use Myckhel\Vtpass\Support\MobileAirtime;

public function buyAirtime(){ 
  $serviceID = 'mtn'
  $phone = '111111111'
  $amount = 100

  return MobileAirtime::purchase([
    'serviceID'   => $serviceID,
    'phone'       => $phone,
    'amount'      => $amount,
  ]);
}

Response

{  
   "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

MobileAirtime::status([
  'request_id' => '24545544'
]);

Verify Electricity

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 for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see 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

License

license. Please see the license file for more information.

laravel-vtpass's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kennyendowed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.