{"id":24475535,"url":"https://github.com/milvasoft/milvasoft.iyzipay","last_synced_at":"2026-02-28T22:31:57.398Z","repository":{"id":47636075,"uuid":"391643757","full_name":"Milvasoft/Milvasoft.Iyzipay","owner":"Milvasoft","description":"Iyzico client for .Net 8","archived":false,"fork":false,"pushed_at":"2023-11-20T13:56:32.000Z","size":165,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-13T13:07:20.830Z","etag":null,"topics":["client-library","dotnet-core","iyzico","iyzipay","payment","payment-service"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Milvasoft.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":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-01T14:05:02.000Z","updated_at":"2024-10-06T20:35:32.000Z","dependencies_parsed_at":"2025-01-21T09:15:21.179Z","dependency_job_id":"705c0dcd-4c6e-4225-8666-199ccac40f9e","html_url":"https://github.com/Milvasoft/Milvasoft.Iyzipay","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Milvasoft%2FMilvasoft.Iyzipay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Milvasoft%2FMilvasoft.Iyzipay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Milvasoft%2FMilvasoft.Iyzipay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Milvasoft%2FMilvasoft.Iyzipay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Milvasoft","download_url":"https://codeload.github.com/Milvasoft/Milvasoft.Iyzipay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717242,"owners_count":21150389,"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":["client-library","dotnet-core","iyzico","iyzipay","payment","payment-service"],"created_at":"2025-01-21T09:15:11.133Z","updated_at":"2025-04-13T13:07:26.081Z","avatar_url":"https://github.com/Milvasoft.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Milvasoft.Iyzipay Library For .Net 8\n\n[![NuGet](https://img.shields.io/nuget/v/Milvasoft.Iyzipay)](https://www.nuget.org/packages/Milvasoft.Iyzipay/)\n\n[![NuGet](https://img.shields.io/nuget/dt/Milvasoft.Iyzipay)](https://www.nuget.org/packages/Milvasoft.Iyzipay/)\n\nUnofficial Iyzipay client library that is maintained by Milvasoft, a fork of the iyzipay-dotnet\n\nAll methods have been rearranged to use async await.\n\nThe dispose pattern has been implemented in the class where the request was sent. This class can be disposed according to optional usage. The HttpRequestMessage and HttpResponse message objects created in each request were disposed of as a result of the request.\n\nRequired dependency injection operations in Iyzico API integration have been adapted to the .net core structure.\n\nSupports .Net 8.0\n\nYou can sign up for an iyzico account at https://iyzico.com\n\n# Requirements\nOne of the runtime environment is required from below\n* .NET 8.0\n\n# Installation\n\nFor now you'll need to install following libraries:\n\n* To install Milvasoft.Iyzipay, run the following command in the Package Manager Console\n```\nInstall-Package Milvasoft.Iyzipay\n```\n Or you can download the latest .dll from [Github](https://github.com/Milvasoft/Milvasoft.Iyzipay)\n\n# Milvasoft.Iyzipay Usage\n\nIn Startup.cs;\n\n```csharp 1\n\n...\n\t    \n services.AddIyzicoIntegration(i =\u003e\n {\n     i.ApiKey = \"your api key\";\n     i.SecretKey = \"your secret key\";\n     i.BaseUrl = \"https://sandbox-api.iyzipay.com\";\n     i.RestHttpClientLifeTime = ServiceLifetime.Transient;\n     i.RestHttpClientV2LifeTime = ServiceLifetime.Transient;\n });\n\n...\n\n```\n\nSample use;\n\n```csharp 1\n        \nusing Milvasoft.Iyzipay.Model;\nusing Milvasoft.Iyzipay.Request;\nusing Milvasoft.Iyzipay.Utils.Abstract;\n\nprivate readonly IRestHttpClient _restHttpClient;\n\npublic PaymentController(IRestHttpClient restHttpClient)\n{\n    _restHttpClient = restHttpClient;\n}\n\npublic async Task\u003cIActionResult\u003e CancelPaymentAsync()\n{\n    CreateCancelRequest request = new()\n    {\n        ConversationId = \"123456789\",\n        Locale = Locale.TR.ToString(),\n        PaymentId = \"1\",\n        Ip = \"85.34.78.112\"\n    };\n    \n    var cancel = new Cancel(_restHttpClient);\n    \n    cancel = await cancel.CreateAsync(request).ConfigureAwait(false);\n    \n    _restHttpClient.Dispose();\n    \n    if (cancel.Status == Status.SUCCESS.ToString())\n        return Ok();\n    else\n        return BadRequest();\n}\n\n```\n\nOr you can use like official Iyzipay library;\n\n```csharp\n\nIOptions options = new Options\n{\n   ApiKey = \"your api key\",\n   SecretKey = \"your secret key\",\n   BaseUrl = \"https://sandbox-api.iyzipay.com\"\n}\n\t\t\nCreatePaymentRequest request = new();\nrequest.Locale = Locale.TR.ToString();\nrequest.ConversationId = \"123456789\";\nrequest.Price = \"1\";\nrequest.PaidPrice = \"1.2\";\nrequest.Currency = Currency.TRY.ToString();\nrequest.Installment = 1;\nrequest.BasketId = \"B67832\";\nrequest.PaymentChannel = PaymentChannel.WEB.ToString();\nrequest.PaymentGroup = PaymentGroup.PRODUCT.ToString();\n\nPaymentCard paymentCard = new();\npaymentCard.CardHolderName = \"John Doe\";\npaymentCard.CardNumber = \"5528790000000008\";\npaymentCard.ExpireMonth = \"12\";\npaymentCard.ExpireYear = \"2030\";\npaymentCard.Cvc = \"123\";\npaymentCard.RegisterCard = 0;\nrequest.PaymentCard = paymentCard;\n\nBuyer buyer = new();\nbuyer.Id = \"BY789\";\nbuyer.Name = \"John\";\nbuyer.Surname = \"Doe\";\nbuyer.GsmNumber = \"+905350000000\";\nbuyer.Email = \"email@email.com\";\nbuyer.IdentityNumber = \"74300864791\";\nbuyer.LastLoginDate = \"2015-10-05 12:43:35\";\nbuyer.RegistrationDate = \"2013-04-21 15:12:09\";\nbuyer.RegistrationAddress = \"Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1\";\nbuyer.Ip = \"85.34.78.112\";\nbuyer.City = \"Istanbul\";\nbuyer.Country = \"Turkey\";\nbuyer.ZipCode = \"34732\";\nrequest.Buyer = buyer;\n\nAddress shippingAddress = new();\nshippingAddress.ContactName = \"Jane Doe\";\nshippingAddress.City = \"Istanbul\";\nshippingAddress.Country = \"Turkey\";\nshippingAddress.Description = \"Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1\";\nshippingAddress.ZipCode = \"34742\";\nrequest.ShippingAddress = shippingAddress;\n\nAddress billingAddress = new();\nbillingAddress.ContactName = \"Jane Doe\";\nbillingAddress.City = \"Istanbul\";\nbillingAddress.Country = \"Turkey\";\nbillingAddress.Description = \"Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1\";\nbillingAddress.ZipCode = \"34742\";\nrequest.BillingAddress = billingAddress;\n\nList\u003cBasketItem\u003e basketItems = new();\nBasketItem firstBasketItem = new();\nfirstBasketItem.Id = \"BI101\";\nfirstBasketItem.Name = \"Binocular\";\nfirstBasketItem.Category1 = \"Collectibles\";\nfirstBasketItem.Category2 = \"Accessories\";\nfirstBasketItem.ItemType = BasketItemType.PHYSICAL.ToString();\nfirstBasketItem.Price = \"0.3\";\nbasketItems.Add(firstBasketItem);\n\nBasketItem secondBasketItem = new();\nsecondBasketItem.Id = \"BI102\";\nsecondBasketItem.Name = \"Game code\";\nsecondBasketItem.Category1 = \"Game\";\nsecondBasketItem.Category2 = \"Online Game Items\";\nsecondBasketItem.ItemType = BasketItemType.VIRTUAL.ToString();\nsecondBasketItem.Price = \"0.5\";\nbasketItems.Add(secondBasketItem);\n\nBasketItem thirdBasketItem = new();\nthirdBasketItem.Id = \"BI103\";\nthirdBasketItem.Name = \"Usb\";\nthirdBasketItem.Category1 = \"Electronics\";\nthirdBasketItem.Category2 = \"Usb / Cable\";\nthirdBasketItem.ItemType = BasketItemType.PHYSICAL.ToString();\nthirdBasketItem.Price = \"0.2\";\nbasketItems.Add(thirdBasketItem);\nrequest.BasketItems = basketItems;\n\nvar client = new RequestHttpClient(new HttpClient(),options);\n\nvar payment = new Payment(client);\n\npayment = await payment.CreateAsync(request).ConfigureAwait(false);\n\nclient.Dispose();\n\n```\nSee other samples under Milvasoft.Iyzipay.Samples project.\n\n# Testing\n\nYou can run particular sample by passing your credential info to \"Milvasoft.Iyzipay.Samples/Sample.cs\"\n\n### Mock test cards\n\nTest cards that can be used to simulate a *successful* payment:\n\nCard Number      | Bank                       | Card Type\n-----------      | ----                       | ---------\n5890040000000016 | Akbank                     | Master Card (Debit)  \n5526080000000006 | Akbank                     | Master Card (Credit)  \n4766620000000001 | Denizbank                  | Visa (Debit)  \n4603450000000000 | Denizbank                  | Visa (Credit)\n4729150000000005 | Denizbank Bonus            | Visa (Credit)  \n4987490000000002 | Finansbank                 | Visa (Debit)  \n5311570000000005 | Finansbank                 | Master Card (Credit)  \n9792020000000001 | Finansbank                 | Troy (Debit)  \n9792030000000000 | Finansbank                 | Troy (Credit)  \n5170410000000004 | Garanti Bankası            | Master Card (Debit)  \n5400360000000003 | Garanti Bankası            | Master Card (Credit)  \n374427000000003  | Garanti Bankası            | American Express  \n4475050000000003 | Halkbank                   | Visa (Debit)  \n5528790000000008 | Halkbank                   | Master Card (Credit)  \n4059030000000009 | HSBC Bank                  | Visa (Debit)  \n5504720000000003 | HSBC Bank                  | Master Card (Credit)  \n5892830000000000 | Türkiye İş Bankası         | Master Card (Debit)  \n4543590000000006 | Türkiye İş Bankası         | Visa (Credit)  \n4910050000000006 | Vakıfbank                  | Visa (Debit)  \n4157920000000002 | Vakıfbank                  | Visa (Credit)  \n5168880000000002 | Yapı ve Kredi Bankası      | Master Card (Debit)  \n5451030000000000 | Yapı ve Kredi Bankası      | Master Card (Credit)  \n\n*Cross border* test cards:\n\nCard Number      | Country\n-----------      | -------\n4054180000000007 | Non-Turkish (Debit)\n5400010000000004 | Non-Turkish (Credit)    \n\nTest cards to get specific *error* codes:\n\nCard Number       | Description\n-----------       | -----------\n5406670000000009  | Success but cannot be cancelled, refund or post auth\n4111111111111129  | Not sufficient funds\n4129111111111111  | Do not honour\n4128111111111112  | Invalid transaction\n4127111111111113  | Lost card\n4126111111111114  | Stolen card\n4125111111111115  | Expired card\n4124111111111116  | Invalid cvc2\n4123111111111117  | Not permitted to card holder\n4122111111111118  | Not permitted to terminal\n4121111111111119  | Fraud suspect\n4120111111111110  | Pickup card\n4130111111111118  | General error\n4131111111111117  | Success but mdStatus is 0\n4141111111111115  | Success but mdStatus is 4\n4151111111111112  | 3dsecure initialize failed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilvasoft%2Fmilvasoft.iyzipay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilvasoft%2Fmilvasoft.iyzipay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilvasoft%2Fmilvasoft.iyzipay/lists"}