All Projects → Soghandi → BankPayment

Soghandi / BankPayment

Licence: LGPL-2.1 license
Persian Bank Payment Server

Programming Languages

C#
18002 projects
HTML
75241 projects

Projects that are alternatives of or similar to BankPayment

php-ipg-ir
IPG (Internet Payment Gateway) manager for Iran Banking System
Stars: ✭ 26 (-29.73%)
Mutual labels:  banking, mellat, saman, parsian
az-iranian-bank-gateways
درگاه اتصال به بانک های ایرانی ( درگاه پرداخت بانک ملی ایران،بانک سامان، بانک ملت، درگاه پرداخت زرین پال و ... ) با استفاده از پایتون
Stars: ✭ 308 (+732.43%)
Mutual labels:  mellat, behpardakht, saman
persian-tools-rs
An anthology of a variety of tools for the Persian language in Rust
Stars: ✭ 17 (-54.05%)
Mutual labels:  banking, persian
iran-payment
a Laravel package to handle Internet Payment Gateways for Iran Banking System
Stars: ✭ 16 (-56.76%)
Mutual labels:  saman, saman-bank
sep-pay
Pay.ir Payment Package for Laravel 5.3+
Stars: ✭ 17 (-54.05%)
Mutual labels:  saman, saman-bank
Nozha-rtl-Dashboard
Nozha is a rtl / ltr Admin Panel with Dark Mode
Stars: ✭ 31 (-16.22%)
Mutual labels:  persian
gahshomar
A Persian (Jalali/Farsi) calendar for Linux
Stars: ✭ 69 (+86.49%)
Mutual labels:  persian
node-cba-netbank
Unofficial The Commonwealth Bank of Australia NetBank API wrap for Node.js
Stars: ✭ 68 (+83.78%)
Mutual labels:  banking
psd2
API client for banks supporting PSD2 APIs with OAuth2 authentication.
Stars: ✭ 26 (-29.73%)
Mutual labels:  banking
materialize-rtl
RTL version of materializecss framework v1.0.0
Stars: ✭ 80 (+116.22%)
Mutual labels:  persian
Persian-OCR
Optical character recognition of Farsi and Arabic letters
Stars: ✭ 36 (-2.7%)
Mutual labels:  persian
PersianTools.Core
Persian Tools for .Net and .Net Core
Stars: ✭ 25 (-32.43%)
Mutual labels:  persian
bash-mardom-azar
بشِ مردم آزار!
Stars: ✭ 19 (-48.65%)
Mutual labels:  persian
coderz
coderz.ir
Stars: ✭ 25 (-32.43%)
Mutual labels:  persian
PersianDateRangePicker
Select range of date and time in the Persian
Stars: ✭ 41 (+10.81%)
Mutual labels:  persian
Karej
سایت و خبرنامه موقعیت‌های شغلی خارج از ایران
Stars: ✭ 73 (+97.3%)
Mutual labels:  persian
alreq
Documenting gaps and requirements for support of Arabic and Persian on the Web and in eBooks.
Stars: ✭ 51 (+37.84%)
Mutual labels:  persian
Loan-calculator-bank-payment
Loan Calculator a small web application encoded in HTML, PHP, JS, and CSS. If you want to earn from BANK NICHE then you can use Loan Calculator script.
Stars: ✭ 32 (-13.51%)
Mutual labels:  banking
python-emv
EMV Smartcard Protocol Tool and Library
Stars: ✭ 72 (+94.59%)
Mutual labels:  banking
public
This is a repository of BIAN artefacts, currently the BIAN Semantic APIs
Stars: ✭ 42 (+13.51%)
Mutual labels:  banking

BankPayment

Persian Bank Payment Gateway

Easily connect to Iranian bank gateways without getting involved with their contractual protocol.

Supported Banks:

  • Saman
  • Mellat (behpardakht)
  • Efarda (Ertebat Farda - efarda.ir)
  • Parsian

How to setup server:
clone project, build and run Adin.BankPayment in your server (Windows, Linux, Mac)
build command:
dotnet build Adin.BankPayment

add connectionstring to appsettings in Adin.Bankpayment project
{
"ConnectionString": "Server=SERVERNAME;Database=DATABASENAME;User Id=DATABASEUSER;Password=PASSWORD;MultipleActiveResultSets=True"
}

run below command to create tables with default values:
dotnet ef database update -p .\Adin.BankPayment.Domain\Adin.BankPayment.Domain.csproj -s .\Adin.BankPayment\Adin.BankPayment.csproj

publish command:
dotnet publish .\Adin.BankPayment\Adin.BankPayment.csproj

run command:
dotnet .\Adin.BankPayment\bin\Debug\netcoreapp2.1\publish\Adin.BankPayment.dll

after project started successfully you can easily add various applications with multiple bank gateways from swagger url: http://localhost:5000/api-docs/index.html
server configuration finish!


How to setup client:

First add connector dll to client project

Install-Package Adin.BankPayment.Connector

use it in your project (like sample project)

send request:

 public async Task<IActionResult> GotoBankPage()
 {
   var currentBaseUrl = string.Format("{0}://{1}", Request.Scheme, Request.Host);
   var model = new Connector.Model.PayInfoModel
   {
       Amount = 1000,
       BankCode = BankCodeEnum.Saman,
       CallbackUrl = currentBaseUrl + "/Home/Callback",
       Mobile = 989354762696,
       PriceUnit = Connector.Enum.PriceUnitEnum.Rial,
       TrackCode = DateTime.Now.ToString("hhmmssfff")
   };
   var response = await client.RequestPay(model);
   if (response.Status == Connector.Enum.ApiStatusCodeEnum.Success)
   {
     return Redirect(response.Body.Url);
   }
   else
   {
       throw new Exception(response.Status + ":" + response.Body);
   }
 }

callback:

  public async Task<IActionResult> CallBack()
  {
    Guid payId = Guid.Parse(Request.Query["id"]);
    string trackCode = Request.Query["trackCode"];
    bool status = bool.Parse(Request.Query["status"]);
    string message = Request.Query["message"];
    if (status == false)
    {
        int errorCode = int.Parse(Request.Query["errorCode"]);
        BankErrorCodeEnum errCode = (BankErrorCodeEnum)errorCode;
        ViewBag.Result = message;
    }
    else
    {
        try
        {
            //Todo: deliver product to customer here


            var res = await client.Verify(payId);
            if (res.Status == Connector.Enum.ApiStatusCodeEnum.Success && res.Body.Status)
            {
                //Transaction Done
                ViewBag.Result = res.Body.Message;
            }
            else
            {
                //Transaction Failed
                ViewBag.Result = res.Body.Message + "<br/>" + "تا 24 ساعت دیگر مبلغ به حساب شما بازگردانده خواهد شد";
            }
        }
        catch
        {            
            //Reverse Transaction
        }
    }
    return View();
  }



enjoy it.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].