diff --git a/Iyzipay/BaseRequestV2.cs b/Iyzipay/BaseRequestV2.cs index bf29215..00493bb 100644 --- a/Iyzipay/BaseRequestV2.cs +++ b/Iyzipay/BaseRequestV2.cs @@ -2,9 +2,17 @@ namespace Iyzipay { - public class BaseRequestV2 - { - public String Locale { get; set; } - public String ConversationId { get; set; } - } + public class BaseRequestV2 : RequestStringConvertible + { + public string Locale { get; set; } + public string ConversationId { get; set; } + + public virtual string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .Append("locale", Locale) + .Append("conversationId", ConversationId) + .GetRequestString(); + } + } } diff --git a/Iyzipay/HashGenerator.cs b/Iyzipay/HashGenerator.cs index 147892d..f0df2c3 100644 --- a/Iyzipay/HashGenerator.cs +++ b/Iyzipay/HashGenerator.cs @@ -17,5 +17,12 @@ public static String GenerateHash(String apiKey, String secretKey, String random byte[] computeHash = algorithm.ComputeHash(Encoding.UTF8.GetBytes(hashStr)); return Convert.ToBase64String(computeHash); } + public static String GenerateHash(String apiKey, String secretKey, String randomString, BaseRequestV2 request) + { + HashAlgorithm algorithm = new SHA1Managed(); + string hashStr = apiKey + randomString + secretKey + request.ToPKIRequestString(); + byte[] computeHash = algorithm.ComputeHash(Encoding.UTF8.GetBytes(hashStr)); + return Convert.ToBase64String(computeHash); + } } } diff --git a/Iyzipay/IyzipayResourceV2.cs b/Iyzipay/IyzipayResourceV2.cs index d9ea069..e2d0e73 100644 --- a/Iyzipay/IyzipayResourceV2.cs +++ b/Iyzipay/IyzipayResourceV2.cs @@ -9,11 +9,13 @@ namespace Iyzipay { public class IyzipayResourceV2 { - private static readonly String AUTHORIZATION = "Authorization"; - private static readonly String AUTHORIZATION_FALLBACK_HEADER = "AUTHORIZATION_FALLBACK_HEADER"; - private static readonly String CONVERSATION_ID_HEADER_NAME = "x-conversation-id"; - private static readonly String CLIENT_VERSION_HEADER_NAME = "x-iyzi-client-version"; - private static readonly String IYZIWS_V2_HEADER_NAME = "IYZWSv2 "; + private static readonly string AUTHORIZATION = "Authorization"; + private static readonly string AUTHORIZATION_FALLBACK_HEADER = "AUTHORIZATION_FALLBACK_HEADER"; + private static readonly string CONVERSATION_ID_HEADER_NAME = "x-conversation-id"; + private static readonly string CLIENT_VERSION_HEADER_NAME = "x-iyzi-client-version"; + private static readonly string IYZIWS_V2_HEADER_NAME = "IYZWSv2 "; + private static readonly string IYZIWS_HEADER_NAME = "IYZWS "; + private static readonly string COLON = ":"; public String Status { get; set; } public int StatusCode { get; set; } @@ -43,7 +45,7 @@ protected static Dictionary GetHttpHeadersWithRequestBody(BaseRe { Dictionary headers = GetCommonHttpHeaders(request, url, options); headers.Add(AUTHORIZATION, PrepareAuthorizationStringWithRequestBody(request, url, options)); - headers.Add(AUTHORIZATION_FALLBACK_HEADER, PrepareAuthorizationStringWithRequestBody(request, url, options)); + headers.Add(AUTHORIZATION_FALLBACK_HEADER, PrepareAuthorizationString(request, url, options)); return headers; } @@ -83,7 +85,11 @@ private static String PrepareAuthorizationStringWithUrlParam(BaseRequestV2 reque String hash = HashGeneratorV2.GenerateHash(options.ApiKey, options.SecretKey, randomKey, dataToEncrypt); return IYZIWS_V2_HEADER_NAME + hash; } - + private static string PrepareAuthorizationString(BaseRequestV2 request, string randomString, Options options) + { + string hash = HashGenerator.GenerateHash(options.ApiKey, options.SecretKey, randomString, request); + return IYZIWS_HEADER_NAME + options.ApiKey + COLON + hash; + } private static String GenerateRandomKey() { return DateTime.Now.ToString("ddMMyyyyhhmmssffff"); diff --git a/Iyzipay/Request/CreateAmountBasedRefundRequest.cs b/Iyzipay/Request/CreateAmountBasedRefundRequest.cs index edddc3c..223c688 100644 --- a/Iyzipay/Request/CreateAmountBasedRefundRequest.cs +++ b/Iyzipay/Request/CreateAmountBasedRefundRequest.cs @@ -10,5 +10,15 @@ public class CreateAmountBasedRefundRequest : BaseRequestV2 public string PaymentId { get; set; } public string Price { get; set; } public string Ip { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("paymentId", PaymentId) + .AppendPrice("price", Price) + .Append("ip", Ip) + .GetRequestString(); + } } } \ No newline at end of file diff --git a/Iyzipay/Request/CreateApmInitializeRequest.cs b/Iyzipay/Request/CreateApmInitializeRequest.cs index 886da9b..b2c46ed 100644 --- a/Iyzipay/Request/CreateApmInitializeRequest.cs +++ b/Iyzipay/Request/CreateApmInitializeRequest.cs @@ -24,5 +24,30 @@ public class CreateApmInitializeRequest : BaseRequestV2 public Address ShippingAddress { get; set; } public Address BillingAddress { get; set; } public List BasketItems { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .AppendPrice("price", Price) + .AppendPrice("paidPrice", PaidPrice) + .Append("paymentChannel", PaymentChannel) + .Append("paymentGroup", PaymentGroup) + .Append("paymentSource", PaymentSource) + .Append("currency", Currency) + .Append("merchantOrderId", MerchantOrderId) + .Append("countryCode", CountryCode) + .Append("accountHolderName", AccountHolderName) + .Append("merchantCallbackUrl", MerchantCallbackUrl) + .Append("merchantErrorUrl", MerchantErrorUrl) + .Append("merchantNotificationUrl", MerchantNotificationUrl) + .Append("apmType", ApmType) + .Append("basketId", BasketId) + .Append("buyer", Buyer) + .Append("shippingAddress", ShippingAddress) + .Append("billingAddress", BillingAddress) + .AppendList("basketItems", BasketItems) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreateApprovalRequest.cs b/Iyzipay/Request/CreateApprovalRequest.cs index 1e93072..31560bb 100644 --- a/Iyzipay/Request/CreateApprovalRequest.cs +++ b/Iyzipay/Request/CreateApprovalRequest.cs @@ -5,5 +5,13 @@ namespace Iyzipay.Request public class CreateApprovalRequest : BaseRequestV2 { public string PaymentTransactionId { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("paymentTransactionId", PaymentTransactionId) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreateBasicBkmInitializeRequest.cs b/Iyzipay/Request/CreateBasicBkmInitializeRequest.cs index 1080408..bba001d 100644 --- a/Iyzipay/Request/CreateBasicBkmInitializeRequest.cs +++ b/Iyzipay/Request/CreateBasicBkmInitializeRequest.cs @@ -14,6 +14,21 @@ public class CreateBasicBkmInitializeRequest : BaseRequestV2 public string BuyerIp { get; set; } public string PosOrderId { get; set; } public List InstallmentDetails { get; set; } - + + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("connectorName", ConnectorName) + .AppendPrice("price", Price) + .Append("callbackUrl", CallbackUrl) + .Append("buyerEmail", BuyerEmail) + .Append("buyerId", BuyerId) + .Append("buyerIp", BuyerIp) + .Append("posOrderId", PosOrderId) + .AppendList("installmentDetails", InstallmentDetails) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreateBasicPaymentRequest.cs b/Iyzipay/Request/CreateBasicPaymentRequest.cs index ec0b9f2..d420854 100644 --- a/Iyzipay/Request/CreateBasicPaymentRequest.cs +++ b/Iyzipay/Request/CreateBasicPaymentRequest.cs @@ -23,5 +23,23 @@ public CreateBasicPaymentRequest() { this.Installment = SINGLE_INSTALLMENT; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .AppendPrice("price", Price) + .AppendPrice("paidPrice", PaidPrice) + .Append("installment", Installment) + .Append("buyerEmail", BuyerEmail) + .Append("buyerId", BuyerId) + .Append("buyerIp", BuyerIp) + .Append("posOrderId", PosOrderId) + .Append("paymentCard", PaymentCard) + .Append("currency", Currency) + .Append("connectorName", ConnectorName) + .Append("callbackUrl", CallbackUrl) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreateBkmInitializeRequest.cs b/Iyzipay/Request/CreateBkmInitializeRequest.cs index d25c963..28eb415 100644 --- a/Iyzipay/Request/CreateBkmInitializeRequest.cs +++ b/Iyzipay/Request/CreateBkmInitializeRequest.cs @@ -16,5 +16,22 @@ public class CreateBkmInitializeRequest : BaseRequestV2 public List BasketItems { get; set; } public string CallbackUrl { get; set; } public List EnabledInstallments { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .AppendPrice("price", Price) + .Append("basketId", BasketId) + .Append("paymentGroup", PaymentGroup) + .Append("buyer", Buyer) + .Append("shippingAddress", ShippingAddress) + .Append("billingAddress", BillingAddress) + .AppendList("basketItems", BasketItems) + .Append("callbackUrl", CallbackUrl) + .Append("paymentSource", PaymentSource) + .AppendList("enabledInstallments", EnabledInstallments) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreateCancelRequest.cs b/Iyzipay/Request/CreateCancelRequest.cs index 005391e..982fea5 100644 --- a/Iyzipay/Request/CreateCancelRequest.cs +++ b/Iyzipay/Request/CreateCancelRequest.cs @@ -9,5 +9,16 @@ public class CreateCancelRequest : BaseRequestV2 public string Reason { get; set; } public string Description { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("paymentId", PaymentId) + .Append("ip", Ip) + .Append("reason", Reason) + .Append("description", Description) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreateCardBlacklistRequest.cs b/Iyzipay/Request/CreateCardBlacklistRequest.cs index 49be0a6..6db1cb6 100644 --- a/Iyzipay/Request/CreateCardBlacklistRequest.cs +++ b/Iyzipay/Request/CreateCardBlacklistRequest.cs @@ -7,5 +7,14 @@ public class CreateCardBlacklistRequest : BaseRequestV2 { public string CardToken { get; set; } public string CardUserKey { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("cardToken", CardToken) + .Append("cardUserKey", CardUserKey) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreateCardManagementPageInitializeRequest.cs b/Iyzipay/Request/CreateCardManagementPageInitializeRequest.cs index a09633f..d91c4f3 100644 --- a/Iyzipay/Request/CreateCardManagementPageInitializeRequest.cs +++ b/Iyzipay/Request/CreateCardManagementPageInitializeRequest.cs @@ -11,5 +11,19 @@ public class CreateCardManagementPageInitializeRequest : BaseRequestV2 public string CardUserKey { get; set; } public string CallbackUrl { get; set; } public bool DebitCardAllowed { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("addNewCardEnabled", AddNewCardEnabled.ToString().ToLower()) + .Append("validateNewCard", ValidateNewCard.ToString().ToLower()) + .Append("externalId", ExternalId) + .Append("email", Email) + .Append("cardUserKey", CardUserKey) + .Append("callbackUrl", CallbackUrl) + .Append("debitCardAllowed", DebitCardAllowed.ToString().ToLower()) + .GetRequestString(); + } } } \ No newline at end of file diff --git a/Iyzipay/Request/CreateCardRequest.cs b/Iyzipay/Request/CreateCardRequest.cs index e9368bd..2deae80 100644 --- a/Iyzipay/Request/CreateCardRequest.cs +++ b/Iyzipay/Request/CreateCardRequest.cs @@ -9,5 +9,16 @@ public class CreateCardRequest : BaseRequestV2 public string Email { get; set; } public string CardUserKey { get; set; } public CardInformation Card { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("externalId", ExternalId) + .Append("email", Email) + .Append("cardUserKey", CardUserKey) + .Append("card", Card) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreateCheckoutFormInitializeRequest.cs b/Iyzipay/Request/CreateCheckoutFormInitializeRequest.cs index 89e656a..33d579f 100644 --- a/Iyzipay/Request/CreateCheckoutFormInitializeRequest.cs +++ b/Iyzipay/Request/CreateCheckoutFormInitializeRequest.cs @@ -21,5 +21,27 @@ public class CreateCheckoutFormInitializeRequest : BaseRequestV2 public string CardUserKey { get; set; } public string PosOrderId { get; set; } public List EnabledInstallments { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .AppendPrice("price", Price) + .Append("basketId", BasketId) + .Append("paymentGroup", PaymentGroup) + .Append("buyer", Buyer) + .Append("shippingAddress", ShippingAddress) + .Append("billingAddress", BillingAddress) + .AppendList("basketItems", BasketItems) + .Append("callbackUrl", CallbackUrl) + .Append("paymentSource", PaymentSource) + .Append("currency", Currency) + .Append("posOrderId", PosOrderId) + .AppendPrice("paidPrice", PaidPrice) + .Append("forceThreeDS", ForceThreeDS) + .Append("cardUserKey", CardUserKey) + .AppendList("enabledInstallments", EnabledInstallments) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreateCrossBookingRequest.cs b/Iyzipay/Request/CreateCrossBookingRequest.cs index c1b7803..aca57bd 100644 --- a/Iyzipay/Request/CreateCrossBookingRequest.cs +++ b/Iyzipay/Request/CreateCrossBookingRequest.cs @@ -8,5 +8,16 @@ public class CreateCrossBookingRequest : BaseRequestV2 public string Price { get; set; } public string Reason { get; set; } public string Currency { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("subMerchantKey", SubMerchantKey) + .AppendPrice("price", Price) + .Append("reason", Reason) + .Append("currency", Currency) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreatePayWithIyzicoInitializeRequest.cs b/Iyzipay/Request/CreatePayWithIyzicoInitializeRequest.cs index e939a89..97cd6f5 100644 --- a/Iyzipay/Request/CreatePayWithIyzicoInitializeRequest.cs +++ b/Iyzipay/Request/CreatePayWithIyzicoInitializeRequest.cs @@ -21,5 +21,27 @@ public class CreatePayWithIyzicoInitializeRequest : BaseRequestV2 public string CardUserKey { get; set; } public string PosOrderId { get; set; } public List EnabledInstallments { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .AppendPrice("price", Price) + .Append("basketId", BasketId) + .Append("paymentGroup", PaymentGroup) + .Append("buyer", Buyer) + .Append("shippingAddress", ShippingAddress) + .Append("billingAddress", BillingAddress) + .AppendList("basketItems", BasketItems) + .Append("callbackUrl", CallbackUrl) + .Append("paymentSource", PaymentSource) + .Append("currency", Currency) + .Append("posOrderId", PosOrderId) + .AppendPrice("paidPrice", PaidPrice) + .Append("forceThreeDS", ForceThreeDS) + .Append("cardUserKey", CardUserKey) + .AppendList("enabledInstallments", EnabledInstallments) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreatePaymentPostAuthRequest.cs b/Iyzipay/Request/CreatePaymentPostAuthRequest.cs index 141521b..8c38f6c 100644 --- a/Iyzipay/Request/CreatePaymentPostAuthRequest.cs +++ b/Iyzipay/Request/CreatePaymentPostAuthRequest.cs @@ -8,5 +8,17 @@ public class CreatePaymentPostAuthRequest : BaseRequestV2 public string PaidPrice { get; set; } public string Ip { get; set; } public string Currency { get; set; } + + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("paymentId", PaymentId) + .Append("ip", Ip) + .AppendPrice("paidPrice", PaidPrice) + .Append("currency", Currency) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreatePaymentRequest.cs b/Iyzipay/Request/CreatePaymentRequest.cs index fd2df5a..703b906 100644 --- a/Iyzipay/Request/CreatePaymentRequest.cs +++ b/Iyzipay/Request/CreatePaymentRequest.cs @@ -25,5 +25,29 @@ public class CreatePaymentRequest : BaseRequestV2 public LoyaltyReward Reward { get; set; } public string GsmNumber { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .AppendPrice("price", Price) + .AppendPrice("paidPrice", PaidPrice) + .Append("installment", Installment) + .Append("paymentChannel", PaymentChannel) + .Append("basketId", BasketId) + .Append("paymentGroup", PaymentGroup) + .Append("paymentCard", PaymentCard) + .Append("buyer", Buyer) + .Append("shippingAddress", ShippingAddress) + .Append("billingAddress", BillingAddress) + .AppendList("basketItems", BasketItems) + .Append("paymentSource", PaymentSource) + .Append("currency", Currency) + .Append("posOrderId", PosOrderId) + .Append("connectorName", ConnectorName) + .Append("callbackUrl", CallbackUrl) + .Append("gsmNumber", GsmNumber) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/CreateRefundRequest.cs b/Iyzipay/Request/CreateRefundRequest.cs index b210a5c..d65d494 100644 --- a/Iyzipay/Request/CreateRefundRequest.cs +++ b/Iyzipay/Request/CreateRefundRequest.cs @@ -11,5 +11,18 @@ public class CreateRefundRequest : BaseRequestV2 public string Reason { get; set; } public string Description { get; set; } + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("paymentTransactionId", PaymentTransactionId) + .AppendPrice("price", Price) + .Append("ip", Ip) + .Append("currency", Currency) + .Append("reason", Reason) + .Append("description", Description) + .GetRequestString(); + } + } } diff --git a/Iyzipay/Request/CreateSubMerchantRequest.cs b/Iyzipay/Request/CreateSubMerchantRequest.cs index f8c3511..9ec3b8f 100644 --- a/Iyzipay/Request/CreateSubMerchantRequest.cs +++ b/Iyzipay/Request/CreateSubMerchantRequest.cs @@ -21,5 +21,28 @@ public class CreateSubMerchantRequest : BaseRequestV2 public string SettlementDescriptionTemplate { get; set; } public string SwiftCode { get; set; } + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("name", Name) + .Append("email", Email) + .Append("gsmNumber", GsmNumber) + .Append("address", Address) + .Append("iban", Iban) + .Append("taxOffice", TaxOffice) + .Append("contactName", ContactName) + .Append("contactSurname", ContactSurname) + .Append("legalCompanyTitle", LegalCompanyTitle) + .Append("swiftCode", SwiftCode) + .Append("currency", Currency) + .Append("settlementDescriptionTemplate", SettlementDescriptionTemplate) + .Append("subMerchantExternalId", SubMerchantExternalId) + .Append("identityNumber", IdentityNumber) + .Append("taxNumber", TaxNumber) + .Append("subMerchantType", SubMerchantType) + .GetRequestString(); + } + } } diff --git a/Iyzipay/Request/CreateThreedsPaymentRequest.cs b/Iyzipay/Request/CreateThreedsPaymentRequest.cs index bfbee1a..9d8aac2 100644 --- a/Iyzipay/Request/CreateThreedsPaymentRequest.cs +++ b/Iyzipay/Request/CreateThreedsPaymentRequest.cs @@ -6,5 +6,14 @@ public class CreateThreedsPaymentRequest : BaseRequestV2 { public string PaymentId { get; set; } public string ConversationData { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("paymentId", PaymentId) + .Append("conversationData", ConversationData) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/DeleteCardRequest.cs b/Iyzipay/Request/DeleteCardRequest.cs index 02d432a..11f5254 100644 --- a/Iyzipay/Request/DeleteCardRequest.cs +++ b/Iyzipay/Request/DeleteCardRequest.cs @@ -6,5 +6,15 @@ public class DeleteCardRequest : BaseRequestV2 { public string CardUserKey { get; set; } public string CardToken { get; set; } + + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("cardUserKey", CardUserKey) + .Append("cardToken", CardToken) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/LoyaltyInquiryRequest.cs b/Iyzipay/Request/LoyaltyInquiryRequest.cs index 49d121b..831ef64 100644 --- a/Iyzipay/Request/LoyaltyInquiryRequest.cs +++ b/Iyzipay/Request/LoyaltyInquiryRequest.cs @@ -7,5 +7,14 @@ public class LoyaltyInquiryRequest : BaseRequestV2 { public LoyaltyPaymentCard PaymentCard { set; get; } public string Currency { set; get; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("paymentCard", PaymentCard.ToPKIRequestString()) + .Append("currency", Currency) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/RetrieveApmRequest.cs b/Iyzipay/Request/RetrieveApmRequest.cs index 96afb3f..338c635 100644 --- a/Iyzipay/Request/RetrieveApmRequest.cs +++ b/Iyzipay/Request/RetrieveApmRequest.cs @@ -6,5 +6,12 @@ public class RetrieveApmRequest : BaseRequestV2 { public string PaymentId { get; set; } + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("paymentId", PaymentId) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/RetrieveBinNumberRequest.cs b/Iyzipay/Request/RetrieveBinNumberRequest.cs index 447e973..064060a 100644 --- a/Iyzipay/Request/RetrieveBinNumberRequest.cs +++ b/Iyzipay/Request/RetrieveBinNumberRequest.cs @@ -5,5 +5,13 @@ namespace Iyzipay.Request public class RetrieveBinNumberRequest : BaseRequestV2 { public string BinNumber { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("binNumber", BinNumber) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/RetrieveBkmRequest .cs b/Iyzipay/Request/RetrieveBkmRequest .cs index 041bcf3..3ecb08c 100644 --- a/Iyzipay/Request/RetrieveBkmRequest .cs +++ b/Iyzipay/Request/RetrieveBkmRequest .cs @@ -5,5 +5,13 @@ namespace Iyzipay.Request public class RetrieveBkmRequest : BaseRequestV2 { public string Token { set; get; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("token", Token) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/RetrieveCardBlacklistRequest.cs b/Iyzipay/Request/RetrieveCardBlacklistRequest.cs index 4d08adb..c429304 100644 --- a/Iyzipay/Request/RetrieveCardBlacklistRequest.cs +++ b/Iyzipay/Request/RetrieveCardBlacklistRequest.cs @@ -6,5 +6,13 @@ namespace Iyzipay.Request public class RetrieveCardBlacklistRequest : BaseRequestV2 { public string CardNumber { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("cardNumber", CardNumber) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/RetrieveCardListRequest.cs b/Iyzipay/Request/RetrieveCardListRequest.cs index 51e0502..eee537e 100644 --- a/Iyzipay/Request/RetrieveCardListRequest.cs +++ b/Iyzipay/Request/RetrieveCardListRequest.cs @@ -5,5 +5,13 @@ namespace Iyzipay.Request public class RetrieveCardListRequest : BaseRequestV2 { public string CardUserKey { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("cardUserKey", CardUserKey) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/RetrieveCardManagementPageCardRequest.cs b/Iyzipay/Request/RetrieveCardManagementPageCardRequest.cs index 4d4a335..7fe8641 100644 --- a/Iyzipay/Request/RetrieveCardManagementPageCardRequest.cs +++ b/Iyzipay/Request/RetrieveCardManagementPageCardRequest.cs @@ -5,8 +5,8 @@ namespace Iyzipay.Request public class RetrieveCardManagementPageCardRequest : BaseRequest { public string PageToken { get; set; } - - public override String ToPKIRequestString() + + public override string ToPKIRequestString() { return ToStringRequestBuilder.NewInstance() .AppendSuper(base.ToPKIRequestString()) diff --git a/Iyzipay/Request/RetrieveCheckoutFormRequest.cs b/Iyzipay/Request/RetrieveCheckoutFormRequest.cs index 66edffd..0d1cc6c 100644 --- a/Iyzipay/Request/RetrieveCheckoutFormRequest.cs +++ b/Iyzipay/Request/RetrieveCheckoutFormRequest.cs @@ -5,5 +5,13 @@ namespace Iyzipay.Request public class RetrieveCheckoutFormRequest : BaseRequestV2 { public string Token { set; get; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("token", Token) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/RetrieveInstallmentInfoRequest.cs b/Iyzipay/Request/RetrieveInstallmentInfoRequest.cs index 9ba8af3..89f5cd9 100644 --- a/Iyzipay/Request/RetrieveInstallmentInfoRequest.cs +++ b/Iyzipay/Request/RetrieveInstallmentInfoRequest.cs @@ -6,5 +6,14 @@ public class RetrieveInstallmentInfoRequest : BaseRequestV2 { public string BinNumber { get; set; } public string Price { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("binNumber", BinNumber) + .AppendPrice("price", Price) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/RetrievePayWithIyzicoRequest.cs b/Iyzipay/Request/RetrievePayWithIyzicoRequest.cs index 5c4711a..6c61004 100644 --- a/Iyzipay/Request/RetrievePayWithIyzicoRequest.cs +++ b/Iyzipay/Request/RetrievePayWithIyzicoRequest.cs @@ -5,5 +5,13 @@ namespace Iyzipay.Request public class RetrievePayWithIyzicoRequest : BaseRequestV2 { public string Token { set; get; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("token", Token) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/RetrievePaymentRequest.cs b/Iyzipay/Request/RetrievePaymentRequest.cs index 860eae0..1f212a0 100644 --- a/Iyzipay/Request/RetrievePaymentRequest.cs +++ b/Iyzipay/Request/RetrievePaymentRequest.cs @@ -6,5 +6,14 @@ public class RetrievePaymentRequest : BaseRequestV2 { public string PaymentId { get; set; } public string PaymentConversationId { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("paymentId", PaymentId) + .Append("paymentConversationId", PaymentConversationId) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/RetrieveSubMerchantRequest.cs b/Iyzipay/Request/RetrieveSubMerchantRequest.cs index 96c0dfb..b5bd591 100644 --- a/Iyzipay/Request/RetrieveSubMerchantRequest.cs +++ b/Iyzipay/Request/RetrieveSubMerchantRequest.cs @@ -5,5 +5,12 @@ namespace Iyzipay.Request public class RetrieveSubMerchantRequest : BaseRequestV2 { public string SubMerchantExternalId { get; set; } + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("subMerchantExternalId", SubMerchantExternalId) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/RetrieveTransactionsRequest.cs b/Iyzipay/Request/RetrieveTransactionsRequest.cs index 009e71a..18ae86c 100644 --- a/Iyzipay/Request/RetrieveTransactionsRequest.cs +++ b/Iyzipay/Request/RetrieveTransactionsRequest.cs @@ -5,5 +5,14 @@ namespace Iyzipay.Request public class RetrieveTransactionsRequest: BaseRequestV2 { public string Date { get; set; } + + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("date", Date) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/UpdateCardBlacklistRequest.cs b/Iyzipay/Request/UpdateCardBlacklistRequest.cs index 472fc9a..150a523 100644 --- a/Iyzipay/Request/UpdateCardBlacklistRequest.cs +++ b/Iyzipay/Request/UpdateCardBlacklistRequest.cs @@ -8,5 +8,14 @@ public class UpdateCardBlacklistRequest : BaseRequestV2 public string CardToken { get; set; } public string CardUserKey { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("cardToken", CardToken) + .Append("cardUserKey", CardUserKey) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/UpdatePaymentItemRequest.cs b/Iyzipay/Request/UpdatePaymentItemRequest.cs index 6179c66..8c0e99e 100644 --- a/Iyzipay/Request/UpdatePaymentItemRequest.cs +++ b/Iyzipay/Request/UpdatePaymentItemRequest.cs @@ -8,5 +8,15 @@ public class UpdatePaymentItemRequest : BaseRequestV2 public string PaymentTransactionId { get; set; } public string SubMerchantPrice { get; set; } + + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("subMerchantKey", SubMerchantKey) + .Append("paymentTransactionId", PaymentTransactionId) + .Append("subMerchantPrice", SubMerchantPrice) + .GetRequestString(); + } } } diff --git a/Iyzipay/Request/UpdateSubMerchantRequest.cs b/Iyzipay/Request/UpdateSubMerchantRequest.cs index a1a8cde..ad197d8 100644 --- a/Iyzipay/Request/UpdateSubMerchantRequest.cs +++ b/Iyzipay/Request/UpdateSubMerchantRequest.cs @@ -20,5 +20,27 @@ public class UpdateSubMerchantRequest : BaseRequestV2 public string SettlementDescriptionTemplate { get; set; } public string SwiftCode { get; set; } + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("name", Name) + .Append("email", Email) + .Append("gsmNumber", GsmNumber) + .Append("address", Address) + .Append("iban", Iban) + .Append("taxOffice", TaxOffice) + .Append("contactName", ContactName) + .Append("contactSurname", ContactSurname) + .Append("legalCompanyTitle", LegalCompanyTitle) + .Append("swiftCode", SwiftCode) + .Append("currency", Currency) + .Append("settlementDescriptionTemplate", SettlementDescriptionTemplate) + .Append("subMerchantKey", SubMerchantKey) + .Append("identityNumber", IdentityNumber) + .Append("taxNumber", TaxNumber) + .GetRequestString(); + } + } } diff --git a/Iyzipay/Request/VerifyC2CSubMerchantRequest.cs b/Iyzipay/Request/VerifyC2CSubMerchantRequest.cs index c442161..d22d090 100644 --- a/Iyzipay/Request/VerifyC2CSubMerchantRequest.cs +++ b/Iyzipay/Request/VerifyC2CSubMerchantRequest.cs @@ -6,5 +6,14 @@ public class VerifyC2CSubMerchantRequest : BaseRequestV2 { public string TxId { get; set; } public string SmsVerificationCode { get; set; } + public override string ToPKIRequestString() + { + return ToStringRequestBuilder.NewInstance() + .AppendSuper(base.ToPKIRequestString()) + .Append("txId", TxId) + .Append("smsVerificationCode", SmsVerificationCode) + .GetRequestString(); + } + } }