Skip to content

Commit f83d4ce

Browse files
committed
init project from old repository
0 parents  commit f83d4ce

39 files changed

+3420
-0
lines changed

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Laravel Online Payment Module v1.0.0 for Laravel 5
2+
3+
## Laravel
4+
5+
6+
The MIT License (MIT)
7+
8+
Copyright (c) 2016 Aboozar Ghaffari
9+
10+
Permission is hereby granted, free of charge, to any person obtaining a copy
11+
of this software and associated documentation files (the "Software"), to deal
12+
in the Software without restriction, including without limitation the rights
13+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14+
copies of the Software, and to permit persons to whom the Software is
15+
furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included in all
18+
copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26+
SOFTWARE.

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Laravel Online Payment
2+
3+
Online Payment Module handler for Laravel 5+
4+
5+
## Installation
6+
7+
1.Installing via composer
8+
9+
```bash
10+
composer require iamtartan/laravel-online-payment:"^2.0"
11+
```
12+
2.Add this to your app service providers for laravel version < 5.4 :
13+
14+
```php
15+
Tartan\Larapay\LarapayServiceProvider::class,
16+
```
17+
3.Add this to your aliases :
18+
19+
```php
20+
'Larapay' => Tartan\Larapay\Facades\Larapay::class,
21+
```
22+
4.Publish the package assets and configs
23+
24+
```bash
25+
php artisan vendor:publish
26+
```
27+
28+
5. Preparing your db (eloquent) model for larapay integration
29+
30+
* Your Transaction/Invoice (Eloquent) model MUST implement
31+
32+
```php
33+
namespace App\Model;
34+
35+
use Tartan\Larapay\Transaction;
36+
37+
class Transaction extends Model implements TransactionInterface
38+
{
39+
public function setReferenceId($referenceId, $save = true){}
40+
41+
public function checkForRequestToken(){}
42+
43+
public function checkForVerify(){}
44+
45+
public function checkForInquiry(){}
46+
47+
public function checkForReverse(){}
48+
49+
public function checkForAfterVerify(){}
50+
51+
public function setCardNumber($cardNumber){}
52+
53+
public function setVerified(){}
54+
55+
public function setAfterVerified(){}
56+
57+
public function setSuccessful($flag){}
58+
59+
public function setReversed(){}
60+
61+
public function getAmount(){}
62+
63+
public function setPaidAt($time = 'now'){}
64+
65+
public function setExtra($key, $value, $save = false){}
66+
}
67+
```
68+
69+
70+
71+
## Team
72+
73+
This component is developed by the following person(s) and a bunch of [awesome contributors](https://github.com/iamtartan/laravel-online-payment/graphs/contributors).
74+
75+
[![Aboozar Ghaffari](https://avatars2.githubusercontent.com/u/502961?v=3&s=70)](https://github.com/iamtartan) |
76+
--- |
77+
[Aboozar Ghaffari](https://github.com/iamtartan) |
78+
79+
80+
## Support This Project
81+
82+
[![Donate via Paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LXEL22GFTXTKN)
83+
84+
### License
85+
86+
The Laravel Online Payment Module is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

composer.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": "iamtartan/laravel-online-payment",
3+
"description": "All Iranian payment gateways handler for laravel applications",
4+
"keywords": ["payment","shetab", "bank", "online payment", "gateway", "iran"],
5+
"type": "library",
6+
"license": "MIT",
7+
"authors": [
8+
{
9+
"name": "Aboozar Ghafari <Tartan>",
10+
"email": "[email protected]",
11+
"website" : "tartan.us.to"
12+
}
13+
],
14+
"require": {
15+
"php": ">=5.4.0",
16+
"illuminate/support": "5.x.x"
17+
},
18+
"autoload": {
19+
"psr-4": {
20+
"Tartan\\Larapay\\": "src/"
21+
}
22+
},
23+
"minimum-stability": "stable"
24+
}

config/larapay.php

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<?php
2+
3+
return [
4+
5+
/*
6+
|--------------------------------------------------------------------------
7+
| Tartan e-payment component`s operation mode
8+
|--------------------------------------------------------------------------
9+
|
10+
| *** very important config ***
11+
| please do not change it if you don't know what BankTest is
12+
|
13+
| production: component operates with real payments gateways
14+
| development: component operates with simulated "Bank Test" (banktest.ir) gateways
15+
|
16+
*/
17+
'mode' => env('LARAPAY_MODE', 'production'),
18+
19+
/*
20+
|--------------------------------------------------------------------------
21+
| ready to serve gateways
22+
|--------------------------------------------------------------------------
23+
|
24+
| specifies ready to serve gateways.
25+
| gateway characters are case sensitive and should be exactly same as their folder name.
26+
| eg, "Jahanpay" is correct not "JahanPay" or "jahanpay"
27+
| the gateways list is comma separated
28+
|
29+
*/
30+
'gateways' => env('LARAPAY_GATES', 'Mellat,Saman,Pasargad'),
31+
32+
/*
33+
|--------------------------------------------------------------------------
34+
| Mellat gateway configuration
35+
|--------------------------------------------------------------------------
36+
*/
37+
'mellat' => [
38+
'username' => env('MELLAT_USERNAME', ''),
39+
'password' => env('MELLAT_PASSWORD',''),
40+
'terminal_id' => env('MELLAT_TERMINAL_ID', ''),
41+
'callback_url' => env('MELLAT_CALLBACK_URL', '')
42+
],
43+
44+
/*
45+
|--------------------------------------------------------------------------
46+
| Parsian gateway configuration
47+
|--------------------------------------------------------------------------
48+
*/
49+
'parsian' => [
50+
'pin' => env('PARSIAN_PIN', ''),
51+
],
52+
/*
53+
|--------------------------------------------------------------------------
54+
| Pasargad gateway configuration
55+
|--------------------------------------------------------------------------
56+
*/
57+
'pasargad' => [
58+
'terminalId' => env('PASARGAD_TERMINAL_ID', ''),
59+
'merchantId' => env('PASARGAD_MERCHANT_ID', ''),
60+
'certificate_path' => storage_path(env('PASARGAD_CERT_PATH', 'payment/pasargad/certificate.xml')),
61+
'callback_url' => env('PASARGAD_CALLBACK_URL', '')
62+
],
63+
64+
/*
65+
|--------------------------------------------------------------------------
66+
| Sadad gateway configuration
67+
|--------------------------------------------------------------------------
68+
*/
69+
'sadad' => [
70+
'merchant' => env('SADAD_MERCHANT', ''),
71+
'transaction_key' => env('SADAD_TRANS_KEY', ''),
72+
'terminal_id' => env('SADAD_TERMINAL_ID', ''),
73+
'callback_url' => env('SADAD_CALLBACK_URL', ''),
74+
],
75+
76+
'saderat' => [
77+
'MID' => env('SADERAT_MID', ''),
78+
'TID' => env('SADERAT_TID', ''),
79+
'public_key_path' => storage_path(env('SADERAT_CERT_PATH', 'payment/saderat/public.key')),
80+
'private_key_path' => storage_path(env('SADERAT_CERT_PATH', 'payment/saderat/private.key')),
81+
],
82+
83+
/*
84+
|--------------------------------------------------------------------------
85+
| Saman gateway configuration
86+
|--------------------------------------------------------------------------
87+
*/
88+
'saman' => [
89+
'merchant_id' => env('SAMAN_MERCHANT_ID', ''),
90+
'merchant_pass' => env('SAMAN_MERCHANT_PASS', ''),
91+
],
92+
93+
/*
94+
|--------------------------------------------------------------------------
95+
| Zarinpal gateway configuration
96+
|--------------------------------------------------------------------------
97+
|
98+
| types: acceptable values --- zarin-gate or normal
99+
| server: acceptable values --- germany or iran or test
100+
|
101+
*/
102+
'zarinpal' => [
103+
'merchant_id' => env('ZARINPAL_MERCHANT_ID', ''),
104+
'type' => env('ZARINPAL_TYPE', 'zarin-gate'),
105+
'callback_url' => env('ZARINPAL_CALLBACK_URL', ''),
106+
'server' => env('ZARINPAL_SERVER', 'germany'),
107+
'email' => env('ZARINPAL_EMAIL', ''),
108+
'mobile' => env('ZARINPAL_MOBILE', '09xxxxxxxxx'),
109+
'description' => env('ZARINPAL_MOBILE', 'powered-by-TartanPayment'),
110+
],
111+
112+
/*
113+
|--------------------------------------------------------------------------
114+
| SoapClient Options
115+
|--------------------------------------------------------------------------
116+
|
117+
| useOptions: true/false
118+
| options: soapClient Options
119+
|
120+
*/
121+
'soap' => [
122+
'useOptions' => env('SOAP_HAS_OPTIONS', false),
123+
'options' => [
124+
'proxy_host' => env('SOAP_PROXY_HOST', ''),
125+
'proxy_port' => env('SOAP_PROXY_PORT', ''),
126+
'stream_context' => stream_context_create(
127+
[
128+
'ssl' => [
129+
'verify_peer' => false,
130+
'verify_peer_name' => false,
131+
],
132+
]
133+
),
134+
]
135+
]
136+
];

0 commit comments

Comments
 (0)