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

Tüm methodlar async await yapısına geçirildi #141

Open
wants to merge 1 commit into
base: basefy-development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 22 additions & 11 deletions Iyzipay/Model/Apm.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,28 @@
using Iyzipay.Request;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
public class Apm : ApmResource
{
public static Apm Create(CreateApmInitializeRequest request, Options options)
{
return RestHttpClient.Create().Post<Apm>(options.BaseUrl + "/payment/apm/initialize", GetHttpHeaders(request, options), request);
}
public class Apm : ApmResource
{
public static Apm Create(CreateApmInitializeRequest request, Options options)
{
return RestHttpClient.Create().Post<Apm>(options.BaseUrl + "/payment/apm/initialize", GetHttpHeaders(request, options), request);
}
public static Task<Apm> CreateAsync(CreateApmInitializeRequest request, Options options)
{
return RestHttpClient.Create().PostAsync<Apm>(options.BaseUrl + "/payment/apm/initialize", GetHttpHeaders(request, options), request);
}

public static Apm Retrieve(RetrieveApmRequest request, Options options)
{
return RestHttpClient.Create().Post<Apm>(options.BaseUrl + "/payment/apm/retrieve", GetHttpHeaders(request, options), request);
}
}
public static Apm Retrieve(RetrieveApmRequest request, Options options)
{
return RestHttpClient.Create().Post<Apm>(options.BaseUrl + "/payment/apm/retrieve", GetHttpHeaders(request, options), request);
}

public static Task<Apm> RetrieveAsync(RetrieveApmRequest request, Options options)
{
return RestHttpClient.Create().PostAsync<Apm>(options.BaseUrl + "/payment/apm/retrieve", GetHttpHeaders(request, options), request);
}
}
}

5 changes: 3 additions & 2 deletions Iyzipay/Model/Approval.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
using Iyzipay.Request;
using System;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
public class Approval : IyzipayResource
{
public String PaymentTransactionId { get; set; }

public static Approval Create(CreateApprovalRequest request, Options options)
public static Task<Approval> Create(CreateApprovalRequest request, Options options)
{
return RestHttpClient.Create().Post<Approval>(options.BaseUrl + "/payment/iyzipos/item/approve", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<Approval>(options.BaseUrl + "/payment/iyzipos/item/approve", GetHttpHeaders(request, options), request);
}
}
}
5 changes: 3 additions & 2 deletions Iyzipay/Model/BasicBkm.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Iyzipay.Request;
using System;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -9,9 +10,9 @@ public class BasicBkm : BasicPaymentResource
public String CallbackUrl { get; set; }
public String PaymentStatus { get; set; }

public static BasicBkm Retrieve(RetrieveBkmRequest request, Options options)
public static Task<BasicBkm> Retrieve(RetrieveBkmRequest request, Options options)
{
return RestHttpClient.Create().Post<BasicBkm>(options.BaseUrl + "/payment/bkm/auth/detail/basic", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<BasicBkm>(options.BaseUrl + "/payment/bkm/auth/detail/basic", GetHttpHeaders(request, options), request);
}
}
}
5 changes: 3 additions & 2 deletions Iyzipay/Model/BasicBkmInitialize.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Iyzipay.Request;
using System;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -8,9 +9,9 @@ public class BasicBkmInitialize : IyzipayResource
public String HtmlContent { get; set; }
public String Token { get; set; }

public static BasicBkmInitialize Create(CreateBasicBkmInitializeRequest request, Options options)
public static async Task<BasicBkmInitialize> Create(CreateBasicBkmInitializeRequest request, Options options)
{
BasicBkmInitialize response = RestHttpClient.Create().Post<BasicBkmInitialize>(options.BaseUrl + "/payment/bkm/initialize/basic", GetHttpHeaders(request, options), request);
BasicBkmInitialize response = await RestHttpClient.Create().PostAsync<BasicBkmInitialize>(options.BaseUrl + "/payment/bkm/initialize/basic", GetHttpHeaders(request, options), request);

if (response != null)
{
Expand Down
5 changes: 3 additions & 2 deletions Iyzipay/Model/BasicPayment.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using Iyzipay.Request;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
public class BasicPayment : BasicPaymentResource
{
public static BasicPayment Create(CreateBasicPaymentRequest request, Options options)
public static Task<BasicPayment> Create(CreateBasicPaymentRequest request, Options options)
{
return RestHttpClient.Create().Post<BasicPayment>(options.BaseUrl + "/payment/auth/basic", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<BasicPayment>(options.BaseUrl + "/payment/auth/basic", GetHttpHeaders(request, options), request);
}
}
}
9 changes: 5 additions & 4 deletions Iyzipay/Model/BasicPaymentPostAuth.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using Iyzipay.Request;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
public class BasicPaymentPostAuth : BasicPaymentResource
{
public static BasicPaymentPostAuth Create(CreatePaymentPostAuthRequest request, Options options)
{
return RestHttpClient.Create().Post<BasicPaymentPostAuth>(options.BaseUrl + "/payment/postauth/basic", GetHttpHeaders(request, options), request);
}
public static Task<BasicPaymentPostAuth> Create(CreatePaymentPostAuthRequest request, Options options)
{
return RestHttpClient.Create().PostAsync<BasicPaymentPostAuth>(options.BaseUrl + "/payment/postauth/basic", GetHttpHeaders(request, options), request);
}
}
}
5 changes: 3 additions & 2 deletions Iyzipay/Model/BasicPaymentPreAuth.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using Iyzipay.Request;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
public class BasicPaymentPreAuth : BasicPaymentResource
{
public static BasicPaymentPreAuth Create(CreateBasicPaymentRequest request, Options options)
public static Task<BasicPaymentPreAuth> Create(CreateBasicPaymentRequest request, Options options)
{
return RestHttpClient.Create().Post<BasicPaymentPreAuth>(options.BaseUrl + "/payment/preauth/basic", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<BasicPaymentPreAuth>(options.BaseUrl + "/payment/preauth/basic", GetHttpHeaders(request, options), request);
}
}
}
5 changes: 3 additions & 2 deletions Iyzipay/Model/BasicThreedsInitialize.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Iyzipay.Request;
using System;
using Newtonsoft.Json;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -9,9 +10,9 @@ public class BasicThreedsInitialize : IyzipayResource
[JsonProperty(PropertyName = "threeDSHtmlContent")]
public String HtmlContent { get; set; }

public static BasicThreedsInitialize Create(CreateBasicPaymentRequest request, Options options)
public static async Task<BasicThreedsInitialize> Create(CreateBasicPaymentRequest request, Options options)
{
BasicThreedsInitialize response = RestHttpClient.Create().Post<BasicThreedsInitialize>(options.BaseUrl + "/payment/3dsecure/initialize/basic", GetHttpHeaders(request, options), request);
BasicThreedsInitialize response = await RestHttpClient.Create().PostAsync<BasicThreedsInitialize>(options.BaseUrl + "/payment/3dsecure/initialize/basic", GetHttpHeaders(request, options), request);

if (response != null)
{
Expand Down
5 changes: 3 additions & 2 deletions Iyzipay/Model/BasicThreedsInitializePreAuth.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Iyzipay.Request;
using System;
using Newtonsoft.Json;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -9,9 +10,9 @@ public class BasicThreedsInitializePreAuth : IyzipayResource
[JsonProperty(PropertyName = "threeDSHtmlContent")]
public String HtmlContent { get; set; }

public static BasicThreedsInitializePreAuth Create(CreateBasicPaymentRequest request, Options options)
public static async Task<BasicThreedsInitializePreAuth> Create(CreateBasicPaymentRequest request, Options options)
{
BasicThreedsInitializePreAuth response = RestHttpClient.Create().Post<BasicThreedsInitializePreAuth>(options.BaseUrl + "/payment/3dsecure/initialize/preauth/basic", GetHttpHeaders(request, options), request);
BasicThreedsInitializePreAuth response = await RestHttpClient.Create().PostAsync<BasicThreedsInitializePreAuth>(options.BaseUrl + "/payment/3dsecure/initialize/preauth/basic", GetHttpHeaders(request, options), request);

if (response != null)
{
Expand Down
5 changes: 3 additions & 2 deletions Iyzipay/Model/BasicThreedsPayment.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using Iyzipay.Request;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
public class BasicThreedsPayment : BasicPaymentResource
{
public static BasicThreedsPayment Create(CreateThreedsPaymentRequest request, Options options)
public static Task<BasicThreedsPayment> Create(CreateThreedsPaymentRequest request, Options options)
{
return RestHttpClient.Create().Post<BasicThreedsPayment>(options.BaseUrl + "/payment/3dsecure/auth/basic", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<BasicThreedsPayment>(options.BaseUrl + "/payment/3dsecure/auth/basic", GetHttpHeaders(request, options), request);
}
}
}
5 changes: 3 additions & 2 deletions Iyzipay/Model/BinNumber.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Iyzipay.Request;
using Newtonsoft.Json;
using System;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -15,9 +16,9 @@ public class BinNumber : IyzipayResource
public long BankCode { get; set; }
public int Commercial { get; set; }

public static BinNumber Retrieve(RetrieveBinNumberRequest request, Options options)
public static Task<BinNumber> Retrieve(RetrieveBinNumberRequest request, Options options)
{
return RestHttpClient.Create().Post<BinNumber>(options.BaseUrl + "/payment/bin/check", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<BinNumber>(options.BaseUrl + "/payment/bin/check", GetHttpHeaders(request, options), request);
}
}
}
5 changes: 3 additions & 2 deletions Iyzipay/Model/Bkm.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Iyzipay.Request;
using System;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -8,9 +9,9 @@ public class Bkm : PaymentResource
public String Token { get; set; }
public String CallbackUrl { get; set; }

public static Bkm Retrieve(RetrieveBkmRequest request, Options options)
public static Task<Bkm> Retrieve(RetrieveBkmRequest request, Options options)
{
return RestHttpClient.Create().Post<Bkm>(options.BaseUrl + "/payment/bkm/auth/detail", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<Bkm>(options.BaseUrl + "/payment/bkm/auth/detail", GetHttpHeaders(request, options), request);
}
}
}
5 changes: 3 additions & 2 deletions Iyzipay/Model/BkmInitialize.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Iyzipay.Request;
using System;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -8,9 +9,9 @@ public class BkmInitialize : IyzipayResource
public String HtmlContent { get; set; }
public String Token { get; set; }

public static BkmInitialize Create(CreateBkmInitializeRequest request, Options options)
public static async Task<BkmInitialize> Create(CreateBkmInitializeRequest request, Options options)
{
BkmInitialize response = RestHttpClient.Create().Post<BkmInitialize>(options.BaseUrl + "/payment/bkm/initialize", GetHttpHeaders(request, options), request);
BkmInitialize response = await RestHttpClient.Create().PostAsync<BkmInitialize>(options.BaseUrl + "/payment/bkm/initialize", GetHttpHeaders(request, options), request);

if (response != null)
{
Expand Down
5 changes: 3 additions & 2 deletions Iyzipay/Model/BouncedBankTransferList.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Collections.Generic;
using Newtonsoft.Json;
using Iyzipay.Request;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -9,9 +10,9 @@ public class BouncedBankTransferList : IyzipayResource
[JsonProperty(PropertyName = "bouncedRows")]
public List<BankTransfer> BankTransfers { get; set; }

public static BouncedBankTransferList Retrieve(RetrieveTransactionsRequest request, Options options)
public static Task<BouncedBankTransferList> Retrieve(RetrieveTransactionsRequest request, Options options)
{
return RestHttpClient.Create().Post<BouncedBankTransferList>(options.BaseUrl + "/reporting/settlement/bounced", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<BouncedBankTransferList>(options.BaseUrl + "/reporting/settlement/bounced", GetHttpHeaders(request, options), request);
}
}
}
9 changes: 5 additions & 4 deletions Iyzipay/Model/Cancel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Iyzipay.Request;
using System;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -12,9 +13,9 @@ public class Cancel : IyzipayResource
public String AuthCode { get; set; }
public String HostReference { get; set; }

public static Cancel Create(CreateCancelRequest request, Options options)
{
return RestHttpClient.Create().Post<Cancel>(options.BaseUrl + "/payment/cancel", GetHttpHeaders(request, options), request);
}
public static Task<Cancel> Create(CreateCancelRequest request, Options options)
{
return RestHttpClient.Create().PostAsync<Cancel>(options.BaseUrl + "/payment/cancel", GetHttpHeaders(request, options), request);
}
}
}
9 changes: 5 additions & 4 deletions Iyzipay/Model/Card.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Iyzipay.Request;
using System;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -18,14 +19,14 @@ public class Card : IyzipayResource
public long? CardBankCode { get; set; }
public String CardBankName { get; set; }

public static Card Create(CreateCardRequest request, Options options)
public static Task<Card> Create(CreateCardRequest request, Options options)
{
return RestHttpClient.Create().Post<Card>(options.BaseUrl + "/cardstorage/card", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<Card>(options.BaseUrl + "/cardstorage/card", GetHttpHeaders(request, options), request);
}

public static Card Delete(DeleteCardRequest request, Options options)
public static Task<Card> Delete(DeleteCardRequest request, Options options)
{
return RestHttpClient.Create().Delete<Card>(options.BaseUrl + "/cardstorage/card", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().DeleteAsync<Card>(options.BaseUrl + "/cardstorage/card", GetHttpHeaders(request, options), request);
}
}
}
13 changes: 7 additions & 6 deletions Iyzipay/Model/CardBlacklist.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Iyzipay.Request;
using System;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -9,19 +10,19 @@ public class CardBlacklist : IyzipayResource
public String CardToken { get; set; }
public String CardNumber { get; set; }
public Boolean Blacklisted { get; set; }
public static CardBlacklist Create(CreateCardBlacklistRequest request, Options options)
public static Task<CardBlacklist> Create(CreateCardBlacklistRequest request, Options options)
{
return RestHttpClient.Create().Post<CardBlacklist>(options.BaseUrl + "/cardstorage/blacklist/card", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<CardBlacklist>(options.BaseUrl + "/cardstorage/blacklist/card", GetHttpHeaders(request, options), request);
}

public static CardBlacklist Update(UpdateCardBlacklistRequest request, Options options)
public static Task<CardBlacklist> Update(UpdateCardBlacklistRequest request, Options options)
{
return RestHttpClient.Create().Post<CardBlacklist>(options.BaseUrl + "/cardstorage/blacklist/card/inactive", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<CardBlacklist>(options.BaseUrl + "/cardstorage/blacklist/card/inactive", GetHttpHeaders(request, options), request);
}

public static CardBlacklist Retrieve(RetrieveCardBlacklistRequest request, Options options)
public static Task<CardBlacklist> Retrieve(RetrieveCardBlacklistRequest request, Options options)
{
return RestHttpClient.Create().Post<CardBlacklist>(options.BaseUrl + "/cardstorage/blacklist/card/retrieve", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<CardBlacklist>(options.BaseUrl + "/cardstorage/blacklist/card/retrieve", GetHttpHeaders(request, options), request);
}
}
}
5 changes: 3 additions & 2 deletions Iyzipay/Model/CardList.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Iyzipay.Request;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -9,9 +10,9 @@ public class CardList : IyzipayResource
public String CardUserKey { get; set; }
public List<Card> CardDetails { get; set; }

public static CardList Retrieve(RetrieveCardListRequest request, Options options)
public static Task<CardList> Retrieve(RetrieveCardListRequest request, Options options)
{
return RestHttpClient.Create().Post<CardList>(options.BaseUrl + "/cardstorage/cards", GetHttpHeaders(request, options), request);
return RestHttpClient.Create().PostAsync<CardList>(options.BaseUrl + "/cardstorage/cards", GetHttpHeaders(request, options), request);
}
}
}
5 changes: 3 additions & 2 deletions Iyzipay/Model/CardManagementPageInitialize.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Iyzipay.Request;
using System.Threading.Tasks;

namespace Iyzipay.Model
{
Expand All @@ -8,8 +9,8 @@ public class CardManagementPageInitialize : IyzipayResource
public string Token { get; set; }
public string CardPageUrl { get; set; }

public static CardManagementPageInitialize Create(CreateCardManagementPageInitializeRequest request, Options options) {
return RestHttpClient.Create().Post<CardManagementPageInitialize>(options.BaseUrl + "/v1/card-management/pages", GetHttpHeaders(request, options), request);
public static Task<CardManagementPageInitialize> Create(CreateCardManagementPageInitializeRequest request, Options options) {
return RestHttpClient.Create().PostAsync<CardManagementPageInitialize>(options.BaseUrl + "/v1/card-management/pages", GetHttpHeaders(request, options), request);
}
}

Expand Down
Loading