Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove field on db transaction #234

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
e9c2461
fix saman card number, fix mellat response, fix composer for install …
hosseinizadeh May 19, 2019
92a4852
Merge pull request #1 from hosseinizadeh/dev
hosseinizadeh May 19, 2019
ecc6e71
change readme
hosseinizadeh May 19, 2019
0616fa2
change readme
hosseinizadeh May 19, 2019
5d8cbac
Update composer.json
hosseinizadeh May 20, 2019
da27895
Update composer.json
hosseinizadeh May 21, 2019
97c35e2
Update composer.json
hosseinizadeh May 21, 2019
1c17b4e
Update README.md
hosseinizadeh Jun 18, 2019
763d2e8
add yekpay gateway
hosseinizadeh Oct 27, 2019
4683014
add checkip and exchange to yekpay
hosseinizadeh Oct 27, 2019
4506aa0
add setFrom and setTo method
hosseinizadeh Oct 27, 2019
6c87c0e
update readme
hosseinizadeh Oct 27, 2019
f2ec922
Update README.md
hosseinizadeh Oct 27, 2019
6abfc0f
update rate_up in yekpay
hosseinizadeh Oct 28, 2019
6bad5e1
Merge branch 'master' of https://github.com/hosseinizadeh/gateway
hosseinizadeh Oct 28, 2019
f30df96
fixed asan pardakht with new documents
shahriyaaar Jul 22, 2020
93d3960
fix asan pardakht
hosseinizadeh Jul 22, 2020
1408aa6
change guzzle to curl (#3)
shahriyaaar Aug 2, 2020
52d0eb2
fix result asan pardakht
hosseinizadeh Aug 3, 2020
a274680
change function client post (#4)
shahriyaaar Aug 4, 2020
f1f3158
fix
hosseinizadeh Aug 5, 2020
4c2f64f
changed verify asan pardakht (#5)
shahriyaaar Aug 5, 2020
bfdc0c3
some fix
hosseinizadeh Aug 5, 2020
afa436c
fix asan pardakht
hosseinizadeh Aug 5, 2020
09cc739
fix asan pardakht
hosseinizadeh Aug 5, 2020
16eaf64
fix callback asan pardakht
hosseinizadeh Aug 9, 2020
4dfdc4e
ZarinaPal Wages and asanpardakht Wages
hosseinizadeh Aug 20, 2020
2043f9f
zarinpal fix
hosseinizadeh Sep 16, 2020
2e2579a
fix laravel 7 bug
hosseinizadeh Sep 17, 2020
358b79b
change ZarinpalWages to Zarinpalwages (#9)
shahriyaaar Oct 13, 2020
9a3287b
change ZarinpalWages to Zarinpalwages
hosseinizadeh Oct 13, 2020
5f34753
change exception asan pardakht for php 7.4 (#10)
shahriyaaar Oct 21, 2020
b9961d7
fix zarinpal wages
hosseinizadeh Nov 7, 2020
b1b3f74
fix zarinpal wages
hosseinizadeh Nov 7, 2020
c45f86e
fix zarinpal wages
hosseinizadeh Nov 7, 2020
28e3e00
fix zarinpal error
hosseinizadeh Dec 7, 2020
4b90951
rial to toman zarinpal wages
hosseinizadeh Dec 7, 2020
3f4d23e
asanpardakht change to iran server
hosseinizadeh Jan 18, 2021
0a07e75
update payir api address
hosseinizadeh Jul 13, 2022
eb6eaa3
add novin pardakht
hosseinizadeh Jul 25, 2022
26e20e6
add signature certificate to novin pardakht
hosseinizadeh Jul 26, 2022
c7376fc
fix novin pardakht exception
hosseinizadeh Jul 26, 2022
dba0977
fix novin pardakht exception
hosseinizadeh Jul 26, 2022
94798a2
add new gateway of Novin Pardakht
hosseinizadeh Aug 31, 2024
8d54806
add new gateway of Novin Pardakht
hosseinizadeh Aug 31, 2024
6d8c5d8
add new gateway of Novin Pardakht
hosseinizadeh Aug 31, 2024
045c608
add new gateway of Novin Pardakht
hosseinizadeh Aug 31, 2024
24a1f20
Update composer.json
hosseinizadeh Nov 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Larabook
Copyright (c) 2019 HosseiniZadeh.ir

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
61 changes: 49 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

package's home : [larabook.ir](http://larabook.ir/اتصال-درگاه-بانک-لاراول/)

by this package we are able to connect to all Iranian bank with one unique API.
by this package we are able to connect to all Iranian bank and Paypal with one unique API.

( This Package is now compatible with both **4.\* and 5.\* versions of Laravel** )

Please inform us once you've encountered [bug](https://github.com/larabook/gateway/issues) or [issue](https://github.com/larabook/gateway/issues) .
Please inform us once you've encountered [bug](https://github.com/hosseinizadeh/gateway/issues) or [issue](https://github.com/hosseinizadeh/gateway/issues) .

Available Banks:
1. MELLAT
Expand All @@ -14,9 +12,11 @@ Available Banks:
4. PARSIAN
5. PASARGAD
6. ZARINPAL
7. PAYPAL (**New**)
8. ASAN PARDAKHT (**New**)
9. PAY.IR (**New**) (to use : new \Payir())
7. PAYPAL
8. ASAN PARDAKHT
9. PAY.IR (to use : new \Payir())
10. YEKPAY
11. NOVIN (EGHTESADEH NOVIN) (**New**)
----------


Expand All @@ -26,24 +26,24 @@ Run below statements on your terminal :

STEP 1 :

composer require larabook/gateway
composer require hosseinizadeh/gateway

STEP 2 : Add `provider` and `facade` in config/app.php

'providers' => [
...
Larabookir\Gateway\GatewayServiceProvider::class, // <-- add this line at the end of provider array
Hosseinizadeh\Gateway\GatewayServiceProvider::class, // <-- add this line at the end of provider array
],


'aliases' => [
...
'Gateway' => Larabookir\Gateway\Gateway::class, // <-- add this line at the end of aliases array
'Gateway' => Hosseinizadeh\Gateway\Gateway::class, // <-- add this line at the end of aliases array
]

Step 3:

php artisan vendor:publish --provider=Larabookir\Gateway\GatewayServiceProvider
php artisan vendor:publish --provider=Hosseinizadeh\Gateway\GatewayServiceProvider5

Step 4:

Expand Down Expand Up @@ -102,7 +102,7 @@ and in your callback :
// تراکنش با موفقیت سمت بانک تایید گردید
// در این مرحله عملیات خرید کاربر را تکمیل میکنیم

} catch (\Larabookir\Gateway\Exceptions\RetryException $e) {
} catch (\Hosseinizadeh\Gateway\Exceptions\RetryException $e) {

// تراکنش قبلا سمت بانک تاییده شده است و
// کاربر احتمالا صفحه را مجددا رفرش کرده است
Expand All @@ -116,6 +116,43 @@ and in your callback :
echo $e->getMessage();
}


for yekpay you can use like this:

try {
$gateway = Gateway::yekpay();

/// can check country return true or false
$gateway->checkip(\request()->ip());

/// can get exchange currency
$exchange = $gateway->exchange(978,364);

$gateway->setCallback(route('bank.callback'));
$gateway->setFrom(364);
$gateway->setTo(364);
$gateway->setFname('ftest');
$gateway->setLname('ltest');
$gateway->setEmail('[email protected]');
$gateway->setMobile('+44123456789');
$gateway->setAddress('address');
$gateway->setPostalcode('9656789');
$gateway->setCountry('iran');
$gateway->setCity('tehran');
$gateway->setDescription('description');
$gateway->price(10000)->ready(10000);
$refId = $gateway->refId();
$transID = $gateway->transactionId();

$payurl = $gateway->payurl();

return redirect($payurl);

} catch (YekpayException $e) {
$message = $e->getMessage();
dd($message);
}

If you are intrested to developing this package you can help us by these ways :

1. Improving documents.
Expand Down
30 changes: 19 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "larabook/gateway",
"homepage": "https://github.com/larabook/gateway",
"description": "A Laravel package for connecting to all Iraninan payment gateways",
"name": "hosseinizadeh/gateway",
"homepage": "https://github.com/hosseinizadeh/gateway",
"description": "A Laravel package for connecting to all Iranian bank and Paypal with one unique API.",
"keywords": [
"laravel",
"iran",
Expand All @@ -28,7 +28,8 @@
"ipay",
"asan-pardakht",
"pay-ir",
"paypal"
"paypal",
"yekpay"
],
"license": "MIT",
"authors": [
Expand All @@ -43,27 +44,34 @@
{
"name": "Amir Khorsandi",
"email": "[email protected]"
},
{
"name": "Alireza Hosseinizadeh",
"email": "[email protected]"
},
{
"name": "Shahriyar Hosseinzadeh",
"email": "[email protected]"
}
],
"require": {
"nesbot/carbon": "~1.20",
"nesbot/carbon": "^1.26.3 || ^2.0 || ^3.0",
"paypal/rest-api-sdk-php": "*"
},
"autoload": {
"psr-4": {
"Larabookir\\Gateway\\": "src/",
"Larabookir\\Gateway\\Tests\\": "tests/"
"Hosseinizadeh\\Gateway\\": "src/",
"Hosseinizadeh\\Gateway\\Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"extra": {
"laravel": {
"providers": [
"Larabookir\\Gateway\\GatewayServiceProvider"
"Hosseinizadeh\\Gateway\\GatewayServiceProvider"
],
"aliases": {
"Gateway": "Larabookir\\Gateway\\Gateway"
"Gateway": "Hosseinizadeh\\Gateway\\Gateway"
}
}
}
}
}
117 changes: 82 additions & 35 deletions config/gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,110 +12,157 @@
// Zarinpal gateway
//--------------------------------
'zarinpal' => [
'merchant-id' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'type' => 'zarin-gate', // Types: [zarin-gate || normal]
'merchant-id' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'type' => 'zarin-gate', // Types: [zarin-gate || normal]
'callback-url' => '/',
'server' => 'germany', // Servers: [germany || iran || test]
'email' => '[email protected]',
'mobile' => '09xxxxxxxxx',
'description' => 'description',
'server' => 'iran', // Servers: [germany || iran || test]
'email' => '[email protected]',
'mobile' => '09xxxxxxxxx',
'description' => 'description',
],

//--------------------------------
// Zarinpal wages gateway
//--------------------------------
'zarinpalwages' => [
'merchant-id' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
'type' => 'zarin-gate', // Types: [zarin-gate || normal]
'callback-url' => '/',
'server' => 'iran', // Servers: [germany || iran || test]
'email' => '[email protected]',
'mobile' => '09xxxxxxxxx',
'description' => 'description',

'iban' => 'IRxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'iban2' => 'IRxxxxxxxxxxxxxxxxxxxxxxxxxxx',
/// and other iban
],

//--------------------------------
// Novin gateway
//--------------------------------
'novin' => [
'username' => '',
'password' => '',
'signature' => true,
'certificate_password' => '',
'certificate_path' => storage_path('gateway/novin/PardakhtNovin.pem'),
'temp_files_dir' => storage_path('gateway/novin'),
'callback-url' => '/'
],

//--------------------------------
// Novin New gateway
//--------------------------------
'novinnew' => [
'CorporationPin' => '',
'callback-url' => '/'
],

//--------------------------------
// Mellat gateway
//--------------------------------
'mellat' => [
'username' => '',
'password' => '',
'terminalId' => 0000000,
'username' => '',
'password' => '',
'terminalId' => 0000000,
'callback-url' => '/'
],

//--------------------------------
// Saman gateway
//--------------------------------
'saman' => [
'merchant' => '',
'password' => '',
'callback-url' => '/',
'merchant' => '',
'password' => '',
'callback-url' => '/',
],

//--------------------------------
// PayIr gateway
//--------------------------------
'payir' => [
'api' => 'xxxxxxxxxxxxxxxxxxxx',
'payir' => [
'api' => 'test',
'callback-url' => '/'
],

//--------------------------------
// Sadad gateway
//--------------------------------
'sadad' => [
'merchant' => '',
'transactionKey'=> '',
'terminalId' => 000000000,
'callback-url' => '/'
'merchant' => '',
'transactionKey' => '',
'terminalId' => 000000000,
'callback-url' => '/'
],

//--------------------------------
// Parsian gateway
//--------------------------------
'parsian' => [
'pin' => 'xxxxxxxxxxxxxxxxxxxx',
'pin' => 'xxxxxxxxxxxxxxxxxxxx',
'callback-url' => '/'
],
//--------------------------------
// Pasargad gateway
//--------------------------------
'pasargad' => [
'terminalId' => 000000,
'merchantId' => 000000,
'certificate-path' => storage_path('gateway/pasargad/certificate.xml'),
'terminalId' => 000000,
'merchantId' => 000000,
'certificate-path' => storage_path('gateway/pasargad/certificate.xml'),
'callback-url' => '/gateway/callback/pasargad'
],

//--------------------------------
// Asan Pardakht gateway
//--------------------------------
'asanpardakht' => [
'merchantId' => '',
'merchantConfigId' => '',
'merchantId' => '',
'merchantConfigId' => '',
'username' => '',
'password' => '',
'iban' => '',
'key' => '',
'iv' => '',
'callback-url' => '/',
'callback-url' => '/',
],

//--------------------------------
// Yekpay gateway
//--------------------------------
'yekpay' => [
'merchantId' => 'test',
'callback-url' => '/',
],

//--------------------------------
// Paypal gateway
//--------------------------------
'paypal' => [
'paypal' => [
// Default product name that appear on paypal payment items
'default_product_name' => 'My Product',
'default_shipment_price' => 0,
// set your paypal credential
'client_id' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'secret' => 'xxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'settings' => [
'mode' => 'sandbox', //'sandbox' or 'live'
'secret' => 'xxxxxxxxxx_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'settings' => [
'mode' => 'sandbox', //'sandbox' or 'live'
'http.ConnectionTimeOut' => 30,
'log.LogEnabled' => true,
'log.FileName' => storage_path() . '/logs/paypal.log',
'log.LogEnabled' => true,
'log.FileName' => storage_path() . '/logs/paypal.log',
/**
* Available option 'FINE', 'INFO', 'WARN' or 'ERROR'
*
* Logging is most verbose in the 'FINE' level and decreases as you
* proceed towards ERROR
*/
'call_back_url' => '/gateway/callback/paypal',
'log.LogLevel' => 'FINE'
'call_back_url' => '/gateway/callback/paypal',
'log.LogLevel' => 'FINE'

]
],
//-------------------------------
// Tables names
//--------------------------------
'table' => 'gateway_transactions',
'table' => 'gateway_transactions',
];
Loading