Comments (5)
@akselarzuman selamlar.
Problemi görünce kullananlara faydası olması açısından burada issue açıp çözüm önerisini de paylaşmıştım zaten PullRequest#75 Gerçi 8 Şubattan beri bekliyor ama... :)
Sizin de kendi client'ınızı güncellemeniz çok güzel ama şahsi görüşüm iyzico kullananların ilk baktıkları yer burası olması dolayısı ile buradaki kodun güncellenmesinin daha faydalı olacağı yönünde.
Paylaşım için teşekkürler 👍 , iyi çalışmalar.
from iyzipay-dotnet.
Projeyi forklayıp bütün bu konuları gözden geçirerek yeniden yazdık. Kendi kullanımımız için yaptık fakat buraya da bırakmak istedim. Sadece .Net 5 sürümünü destekliyor. Birazcık değiştirdik :)
İstek atılırken HttpClient harici nesneler cevap aldıktan sonra using statement'ı ile dispose ediliyor. Fakat HttpClient'ı tutan nesneyi manuel dispose etmeniz gerekli. Kullanım farklılıklarından dolayı çıkacak problemleri engellemek amaçlı bu şekilde yaptım.
Gözünüze çarpan eksiklerimizi söylerseniz memnun oluruz. Umarım faydalı olur.
https://github.com/Milvasoft/Milvasoft.Iyzipay
from iyzipay-dotnet.
Merhaba,
Kendi client library'mizde bunu düzeltmiş bulunmaktayız.
https://github.com/armutcom/iyzipay-dotnet-client
from iyzipay-dotnet.
Biz bahsettiğiniz 2 numaralı sorunu canlıda yasıyoruz. @enerefe
System.AggregateException: One or more errors occurred. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled. --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Iyzipay.RestHttpClient.Post[T](String url, Dictionary2 headers, BaseRequest request) at Iyzipay.Model.Payment.Create(CreatePaymentRequest request, Options options) at Arabam.Core.Services.Payments.Implementations.IyzicoPaymentV2Service.PayWithOtp(OtpPaymentRequest request) ---> (Inner Exception #0) System.Threading.Tasks.TaskCanceledException: A task was canceled.<---
Iyzipay 2.1.33.0 versiyonu kullanıyoruz.
@akselarzuman Iyzipay yakın zamanda son bir versiyon çıkmış ancak eski yapı tamamen değişmiş gözüküyor. Bundan sonrası için Armut iyzipay projesi farklı bir yoldan ilerleyecek diyebilir miyiz?
1 numara için ise; iyzipay her request icin yeni bir httpClient üretiyor ve dispose etmiyor, armut.com ise ctor'da HttpClient üretiyor ve dispose etmiyor.
Ancak microsoft ne singleton kullanımını ne de her istekte yeni httpClient olusturmayı desteklemiyor bildiğim kadarıyla:
Therefore, HttpClient is intended to be instantiated once and reused throughout the life of an application. Instantiating an HttpClient class for every request will exhaust the number of sockets available under heavy loads. That issue will result in SocketException errors. Possible approaches to solve that problem are based on the creation of the HttpClient object as singleton or static, as explained in this Microsoft article on HttpClient usage.
But there’s a second issue with HttpClient that you can have when you use it as singleton or static object. In this case, a singleton or static HttpClient doesn’t respect DNS changes, as explained in this issue at the .NET Core GitHub repo.
To address those mentioned issues and make the management of HttpClient instances easier, .NET Core 2.1 introduced a new HttpClientFactory that can also be used to implement resilient HTTP calls by integrating Polly with it.
Kaynak: https://dotnet.microsoft.com/download/e-book/microservices-architecture/pdf
from iyzipay-dotnet.
Neredeyse 6 yıl geçmiş ama hala bir düzeltme yok ilgilenen de yok...
from iyzipay-dotnet.
Related Issues (20)
- add ucsToken, consumerToken, cardToken into SubscriptionCardData HOT 1
- Buyer.trusted and bankCardHolderName fields should be added to related objects HOT 1
- Sandbox ortamında yaptığım istekten 2000 hatası alıyorum HOT 4
- Iyzipay HOT 1
- Adding cardToken parameter to CreateCheckoutFormInitializeRequest
- there is no commercial parameter in installment and bin services
- Adding Amount Based Partial Refund API to .NET
- Sandbox hesabıyla Ödeme İşlemleri İşlerken Hata Kodu 11 Alınıyor HOT 2
- 3Dsiz ödemede instance almada exceptiona düşme HOT 2
- subscription CheckoutForm control HOT 1
- FraudStatus boş geliyor ! HOT 1
- Iyzipay.Model.V2.Subscription.PaymentInterval eksik enum değerleri HOT 1
- Kayıtlı Kartı Kullanma HOT 1
- some problems
- checkout form popup
- SHA1 Authentication will no longer be supported after November 31st, 2024
- CheckoutForm'da Başarılı Ödemelerde PaymentStatus FAILURE Olarak Geliyor HOT 2
- Hayatımda gördüğüm ender dandiklik seviyesinde bir API HOT 3
- Authorization sorunu HOT 2
- Sürüm açıklamaları yok HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iyzipay-dotnet.