From 07094574dff1f92e67e46964f546a1dfc1862351 Mon Sep 17 00:00:00 2001 From: Hamed Date: Mon, 2 May 2016 21:03:51 +0430 Subject: [PATCH] first commit --- README.md | 2 + composer.json | 19 ++++++++ src/LICENSE | 21 +++++++++ src/PoolPortFacade.php | 18 ++++++++ src/PoolPortResolver.php | 7 +++ src/PoolPortServiceProvider.php | 34 ++++++++++++++ src/config/poolport-sample.php | 78 +++++++++++++++++++++++++++++++++ 7 files changed, 179 insertions(+) create mode 100644 README.md create mode 100644 composer.json create mode 100644 src/LICENSE create mode 100644 src/PoolPortFacade.php create mode 100644 src/PoolPortResolver.php create mode 100644 src/PoolPortServiceProvider.php create mode 100644 src/config/poolport-sample.php diff --git a/README.md b/README.md new file mode 100644 index 00000000..7c1b547e --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# laravel-gateways +A laravel package for connecting to all Iraninan payments gateways diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..061b0597 --- /dev/null +++ b/composer.json @@ -0,0 +1,19 @@ +{ + "name": "larabook/laravel-gateways", + "homepage": "https://github.com/larabook/laravelgateways", + "description": "A Laravel package for connecting to all Iraninan payments gateways", + "license": "MIT", + "authors": [ + { + "name": "Hamed Pakdaman", + "email": "pakdaman.it@gmail.com" + } + ], + "autoload": { + "psr-4": { "Larabook\\PoolPort\\": "src/" } + }, + "require": { + "PoolPort/PoolPort" : "*" + }, + "minimum-stability": "dev" +} diff --git a/src/LICENSE b/src/LICENSE new file mode 100644 index 00000000..24947d2f --- /dev/null +++ b/src/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 PoolPort + +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. diff --git a/src/PoolPortFacade.php b/src/PoolPortFacade.php new file mode 100644 index 00000000..898df46b --- /dev/null +++ b/src/PoolPortFacade.php @@ -0,0 +1,18 @@ +publishes([ + __DIR__.'/../poolport-sample.php' => config_path('poolport.php') + ],'config'); + + } + + /** + * Register the application services. + * + * @return void + */ + public function register() + { + $this->app->singleton('poolport',function() { + return new PoolPort(null,config_path('poolport.php')); + }); + + } +} diff --git a/src/config/poolport-sample.php b/src/config/poolport-sample.php new file mode 100644 index 00000000..c96811a3 --- /dev/null +++ b/src/config/poolport-sample.php @@ -0,0 +1,78 @@ + 'Asia/Tehran', + + //-------------------------------- + // Database configuration + //-------------------------------- + 'database' => array( + 'host' => '127.0.0.1', + 'dbname' => '', + 'username' => '', + 'password' => '', + 'create' => true // For first time you must set this to true for create tables in database + ), + + //-------------------------------- + // Zarinpal gateway + //-------------------------------- + 'zarinpal' => array( + 'merchant-id' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', + 'type' => 'zarin-gate', // Types: [zarin-gate || normal] + 'callback-url' => 'http://www.example.org/result', + 'server' => 'germany', // Servers: [germany || iran] + 'email' => 'email@gmail.com', + 'mobile' => '09xxxxxxxxx', + 'description' => 'description', + ), + + //-------------------------------- + // Mellat gateway + //-------------------------------- + 'mellat' => array( + 'username' => '', + 'password' => '', + 'terminalId' => 0000000, + 'callback-url' => 'http://www.example.org/result' + ), + + //-------------------------------- + // Payline gateway + //-------------------------------- + 'payline' => array( + 'api' => 'xxxxx-xxxxx-xxxxx-xxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxx', + 'callback-url' => 'http://www.example.org/result' + ), + + //-------------------------------- + // Sadad gateway + //-------------------------------- + 'sadad' => array( + 'merchant' => '', + 'transactionKey'=> '', + 'terminalId' => 000000000, + 'callback-url' => 'http://example.org/result' + ), + + //-------------------------------- + // JahanPay gateway + //-------------------------------- + 'jahanpay' => array( + 'api' => 'xxxxxxxxxxx', + 'callback-url' => 'http://example.org/result' + ), + + //-------------------------------- + // Parsian gateway + //-------------------------------- + 'parsian' => array( + 'pin' => 'xxxxxxxxxxxxxxxxxxxx', + 'callback-url' => 'http://example.org/result' + ), +);