using System.Collections.Generic;
public static void Main()
Options options = new Options();
options.ApiKey = "sandbox-D376GJqCuaG5uQ6OZa5ta7vQUgDREFpi";
options.SecretKey = "sandbox-NbAS8tPKsCG3CI6ZuwqcmU582pGWZ1Gy";
options.BaseUrl = "https://sandbox-api.iyzipay.com";
CreateRefundRequest __CreateRefundRequest = new CreateRefundRequest();
__CreateRefundRequest.ConversationId = Guid.NewGuid().ToString();
__CreateRefundRequest.Locale = Locale.TR.ToString();
__CreateRefundRequest.PaymentTransactionId = "14002872";
__CreateRefundRequest.Price = "60.00";
__CreateRefundRequest.Ip = "127.0.0.1";
__CreateRefundRequest.Currency = Currency.TRY.ToString();
__CreateRefundRequest.Ip = __CreateRefundRequest.Ip.Replace("::1", "127.0.0.1");
Refund __RefundResponse = Refund.Create(__CreateRefundRequest, options);
Console.WriteLine(__RefundResponse.ErrorCode);
Console.WriteLine(__RefundResponse.ErrorMessage);