Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
youngbobby committed Sep 27, 2016
0 parents commit a340f85
Show file tree
Hide file tree
Showing 13 changed files with 667 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
vendor
.DS_Store
composer.lock
build
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: php
php:
- '5.6'
- '7.0'
- hhvm
- nightly

matrix:
allow_failures:
- php: hhvm

install: travis_retry composer install --no-interaction --prefer-source

script:
- mkdir -p build/logs
- php vendor/bin/phpunit -c phpunit.xml
- phpunit --coverage-text --coverage-clover=coverage.clover
- phpunit --coverage-clover build/logs/clover.xml

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
- travis_retry php vendor/bin/coveralls -v
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [2016] [Devs.NG]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# laravel-interswitch

[![Build Status](https://travis-ci.org/devsng/laravel-interswitch.svg)](https://travis-ci.org/devsng/laravel-interswitch)
[![Latest Stable Version](https://poser.pugx.org/devsng/laravel-interswitch/v/stable)](https://packagist.org/packages/devsng/laravel-interswitch)
[![Total Downloads](https://poser.pugx.org/devsng/laravel-interswitch/downloads)](https://packagist.org/packages/devsng/laravel-interswitch)
[![Latest Unstable Version](https://poser.pugx.org/devsng/laravel-interswitch/v/unstable)](https://packagist.org/packages/devsng/laravel-interswitch)
[![License](https://poser.pugx.org/devsng/laravel-interswitch/license)](https://packagist.org/packages/devsng/laravel-interswitch)


Interswitch WebPay Integration package for Laravel 5.


## Installation

Please proceed to the [community website](https://community.devs.ng/) for instructions on installing this package.

## License

The Laravel Interswitch package is an open-source software initiative of Nigerian Developers Community ([Devs.NG](http://devs.ng)) licensed under the [MIT license](http://opensource.org/licenses/MIT).

## Official Docs

Official Interswitch Documentations can be found here - https://connect.interswitchng.com/documentation/
34 changes: 34 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "devsng/laravel-interswitch",
"description": "Interswitch WebPay Integration package for Laravel 5",
"keywords": ["DevsNG", "Interswitch", "Laravel", "WebPay"],
"license": "MIT",
"authors": [{
"name": "Bobby",
"email": "[email protected]"
}],
"minimum-stability": "stable",
"require": {
"php": ">=5.6.4",
"illuminate/support": "5.*",
"guzzlehttp/guzzle": "5.*|6.*"
},
"require-dev": {
"phpunit/phpunit": "5.*",
"mockery/mockery": "dev-master"
},
"autoload": {
"psr-4": {
"DevsNG\\Interswitch\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"DevsNG\\Interswitch\\Test\\": "tests/"
}
},
"scripts": {
"test": "vendor/bin/phpunit"
}

}
62 changes: 62 additions & 0 deletions config/interswitch.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?php

/*
* Laravel Interswitch Web Pay Configuration File.
*
* (c) Bobby <[email protected]> [http://community.devs.ng]
*
*/

return [

/*
* Product Identifier code provided by Interswitch
*
* If not provided, Test Product ID would be used.
*/

'product_id' => env('INTERSWITCH_PRODUCT_ID', 6205),

/*
* Payment Item ID provided by Interswitch
*
* If not provided, Test Payment ID would be used.
*/

'pay_item_id' => env('INTERSWITCH_PAY_ITEM_ID', 101),

/*
* Mac Key provided by Interswitch
*
* If not provided, Test Mac Key would be used.
*/

'mac_key' => env('INTERSWITCH_MAC_KEY', 'D3D1D05AFE42AD50818167EAC73C109168A0F108F32645C8B59E897FA930DA44F9230910DAC9E20641823799A107A02068F7BC0F4CC41D2952E249552255710F'),

/*
* Default Currency for Transactions.
*
* 566 = Naira.
*
*/

'currency' => 566,

/*
* Set Test Mode to false if you are ready to Go Live
*
*/

'test_mode' => env('INTERSWITCH_TEST_MODE', true),

/*
* Redirect URL for complete transactions on Interswitch.
*
* This can also be provided when calling the form generation
* method.
*
*/

'redirect_url' => 'http://homestead.app/callback',

];
21 changes: 21 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
covertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Interswitch Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
</phpunit>
15 changes: 15 additions & 0 deletions src/Exceptions/InvalidArgException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

namespace DevsNG\Interswitch\Exceptions;


use Exception;


/**
*
*/
class InvalidArgException extends Exception
{

}
18 changes: 18 additions & 0 deletions src/Facades/Interswitch.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace DevsNG\Interswitch\Facades;

use Illuminate\Support\Facades\Facade;

class Interswitch extends Facade
{
/**
* Get the binding in the IoC container.
*
* @return string
*/
public static function getFacadeAccessor()
{
return 'interswitch'; // IoC binding.
}
}
Loading

0 comments on commit a340f85

Please sign in to comment.