{"id":19992002,"url":"https://github.com/Soghandi/BankPayment","last_synced_at":"2025-05-04T11:30:36.957Z","repository":{"id":33064908,"uuid":"143134828","full_name":"Soghandi/BankPayment","owner":"Soghandi","description":"Persian Bank Payment Server","archived":false,"fork":false,"pushed_at":"2024-08-19T10:18:11.000Z","size":2195,"stargazers_count":43,"open_issues_count":0,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-15T13:44:59.796Z","etag":null,"topics":["banking","behpardakht","gateways","mellat","parsian","persian","saman","saman-bank"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Soghandi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"Security/Adin.BankPayment.TokenProvider/Adin.BankPayment.TokenProvider.csproj","support":null}},"created_at":"2018-08-01T09:32:25.000Z","updated_at":"2025-01-16T07:17:57.000Z","dependencies_parsed_at":"2023-01-14T23:14:35.458Z","dependency_job_id":null,"html_url":"https://github.com/Soghandi/BankPayment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soghandi%2FBankPayment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soghandi%2FBankPayment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soghandi%2FBankPayment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Soghandi%2FBankPayment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Soghandi","download_url":"https://codeload.github.com/Soghandi/BankPayment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252329097,"owners_count":21730548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["banking","behpardakht","gateways","mellat","parsian","persian","saman","saman-bank"],"created_at":"2024-11-13T04:52:00.452Z","updated_at":"2025-05-04T11:30:33.304Z","avatar_url":"https://github.com/Soghandi.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# BankPayment\n\nPersian Bank Payment Gateway\n\nEasily connect to Iranian bank gateways without getting involved with their contractual protocol.\n\u003cbr/\u003e\n\u003cbr/\u003e\n\u003cb\u003e\n  Supported Banks:\u003c/b\u003e\n      \u003cul\u003e\n        \u003cli\u003eSaman\u003c/li\u003e\n        \u003cli\u003eMellat (behpardakht)\u003c/li\u003e\n\t\u003cli\u003eEfarda (Ertebat Farda - efarda.ir)\u003c/li\u003e\n\t\u003cli\u003eParsian\u003c/li\u003e\n \t\u003cli\u003ePasargad\u003c/li\u003e\n  \u003c/ul\u003e\n\u003cbr/\u003e\n\u003cb\u003e\n  How to setup server:  \n \u003c/b\u003e\n \u003cbr/\u003e\nclone project, build and run Adin.BankPayment in your server (Windows, Linux, Mac)\n  \u003cbr/\u003e\n  build command:\n\u003cbr/\u003e\n\n```\ndotnet build Adin.BankPayment\n```\n\n\u003cbr/\u003e\n add connectionstring to appsettings in Adin.Bankpayment project \n \u003cbr/\u003e\n \n```\n{\n\"ConnectionString\": \"Server=SERVERNAME;Database=DATABASENAME;User Id=DATABASEUSER;Password=PASSWORD;MultipleActiveResultSets=True\"\n}\n```\n\n \u003cbr/\u003e\n run below command to create tables with default values:\n \u003cbr/\u003e\n \n```\ndotnet ef database update -p .\\Adin.BankPayment.Domain\\Adin.BankPayment.Domain.csproj -s .\\Adin.BankPayment\\Adin.BankPayment.csproj\n```\n\n \u003cbr/\u003e\n publish command:\n \u003cbr/\u003e\n \n ```\ndotnet publish .\\Adin.BankPayment\\Adin.BankPayment.csproj\n```\n\n\u003cbr/\u003e\nrun command:\n\u003cbr/\u003e\n\n```\ndotnet .\\Adin.BankPayment\\bin\\Debug\\netcoreapp2.1\\publish\\Adin.BankPayment.dll\n```\n\n\u003cbr/\u003e\nafter project started successfully you can easily add various applications with multiple bank gateways from swagger url:\nhttp://localhost:5000/api-docs/index.html\n\u003cbr/\u003e\nserver configuration finish!\n\u003cbr/\u003e\n\u003cbr/\u003e\n \u003cbr/\u003e\n\u003cb\u003e\n  How to setup client:  \n \u003c/b\u003e\n \u003cbr/\u003e\n\nFirst add connector dll to client project\n \u003cbr/\u003e\n```\nInstall-Package Adin.BankPayment.Connector\n```\n \u003cbr/\u003e\nuse it in your project (like sample project)\n\nsend request:\n\n```\n public async Task\u003cIActionResult\u003e GotoBankPage()\n {\n   var currentBaseUrl = string.Format(\"{0}://{1}\", Request.Scheme, Request.Host);\n   var model = new Connector.Model.PayInfoModel\n   {\n       Amount = 1000,\n       BankCode = BankCodeEnum.Saman,\n       CallbackUrl = currentBaseUrl + \"/Home/Callback\",\n       Mobile = 989354762696,\n       PriceUnit = Connector.Enum.PriceUnitEnum.Rial,\n       TrackCode = DateTime.Now.ToString(\"hhmmssfff\")\n   };\n   var response = await client.RequestPay(model);\n   if (response.Status == Connector.Enum.ApiStatusCodeEnum.Success)\n   {\n     return Redirect(response.Body.Url);\n   }\n   else\n   {\n       throw new Exception(response.Status + \":\" + response.Body);\n   }\n }\n```\n\ncallback:\n\n```\n  public async Task\u003cIActionResult\u003e CallBack()\n  {\n    Guid payId = Guid.Parse(Request.Query[\"id\"]);\n    string trackCode = Request.Query[\"trackCode\"];\n    bool status = bool.Parse(Request.Query[\"status\"]);\n    string message = Request.Query[\"message\"];\n    if (status == false)\n    {\n        int errorCode = int.Parse(Request.Query[\"errorCode\"]);\n        BankErrorCodeEnum errCode = (BankErrorCodeEnum)errorCode;\n        ViewBag.Result = message;\n    }\n    else\n    {\n        try\n        {\n            //Todo: deliver product to customer here\n\n\n            var res = await client.Verify(payId);\n            if (res.Status == Connector.Enum.ApiStatusCodeEnum.Success \u0026\u0026 res.Body.Status)\n            {\n                //Transaction Done\n                ViewBag.Result = res.Body.Message;\n            }\n            else\n            {\n                //Transaction Failed\n                ViewBag.Result = res.Body.Message + \"\u003cbr/\u003e\" + \"تا 24 ساعت دیگر مبلغ به حساب شما بازگردانده خواهد شد\";\n            }\n        }\n        catch\n        {            \n            //Reverse Transaction\n        }\n    }\n    return View();\n  }\n ```\n \u003cbr/\u003e\n \u003cbr/\u003e\n \u003cbr/\u003e\n enjoy it.\n  \n\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSoghandi%2FBankPayment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSoghandi%2FBankPayment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSoghandi%2FBankPayment/lists"}