using System.Collections.Generic;
public static void Main()
Options options = new Options();
options.ApiKey = "sandbox-afXhZPW0MQlE4dCUUlHcEopnMBgXnAZI";
options.SecretKey = "sandbox-wbwpzKIiplZxI3hh5ALI4FJyAcZKL6kq";
options.BaseUrl = "https://sandbox-api.iyzipay.com";
Iyzipay.Request.CreatePaymentRequest request = new Iyzipay.Request.CreatePaymentRequest();
request.Locale = Iyzipay.Model.Locale.TR.ToString();
request.ConversationId = "123456789";
request.PaidPrice = "1.2";
request.Currency = Iyzipay.Model.Currency.TRY.ToString();
request.BasketId = "B67832";
request.PaymentChannel = Iyzipay.Model.PaymentChannel.WEB.ToString();
request.PaymentGroup = Iyzipay.Model.PaymentGroup.LISTING.ToString();
Iyzipay.Model.PaymentCard paymentCard = new Iyzipay.Model.PaymentCard();
paymentCard.CardHolderName = "John Doe";
paymentCard.CardNumber = "5528790000000008";
paymentCard.ExpireMonth = "12";
paymentCard.ExpireYear = "2030";
paymentCard.RegisterCard = 0;
request.PaymentCard = paymentCard;
Iyzipay.Model.Buyer buyer = new Iyzipay.Model.Buyer();
buyer.GsmNumber = "+905350000000";
buyer.Email = "email@email.com";
buyer.IdentityNumber = "74300864791";
buyer.LastLoginDate = "2015-10-05 12:43:35";
buyer.RegistrationDate = "2013-04-21 15:12:09";
buyer.RegistrationAddress = "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1";
buyer.Ip = "85.34.78.112";
buyer.Country = "Turkey";
Iyzipay.Model.Address shippingAddress = new Iyzipay.Model.Address();
shippingAddress.ContactName = "Jane Doe";
shippingAddress.City = "Istanbul";
shippingAddress.Country = "Turkey";
shippingAddress.Description = "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1";
shippingAddress.ZipCode = "34742";
request.ShippingAddress = shippingAddress;
Iyzipay.Model.Address billingAddress = new Iyzipay.Model.Address();
billingAddress.ContactName = "Jane Doe";
billingAddress.City = "Istanbul";
billingAddress.Country = "Turkey";
billingAddress.Description = "Nidakule Göztepe, Merdivenköy Mah. Bora Sok. No:1";
billingAddress.ZipCode = "34742";
request.BillingAddress = billingAddress;
List<Iyzipay.Model.BasketItem> basketItems = new List<Iyzipay.Model.BasketItem>();
Iyzipay.Model.BasketItem firstBasketItem = new Iyzipay.Model.BasketItem();
firstBasketItem.Id = "BI101";
firstBasketItem.Name = "Binocular";
firstBasketItem.Category1 = "Collectibles";
firstBasketItem.Category2 = "Accessories";
firstBasketItem.ItemType =Iyzipay.Model.BasketItemType.PHYSICAL.ToString();
firstBasketItem.Price = "0.3";
basketItems.Add(firstBasketItem);
Iyzipay.Model.BasketItem secondBasketItem = new Iyzipay.Model.BasketItem();
secondBasketItem.Id = "BI102";
secondBasketItem.Name = "Game code";
secondBasketItem.Category1 = "Game";
secondBasketItem.Category2 = "Online Game Items";
secondBasketItem.ItemType = Iyzipay.Model.BasketItemType.VIRTUAL.ToString();
secondBasketItem.Price = "0.5";
basketItems.Add(secondBasketItem);
Iyzipay.Model.BasketItem thirdBasketItem = new Iyzipay.Model.BasketItem();
thirdBasketItem.Id = "BI103";
thirdBasketItem.Name = "Usb";
thirdBasketItem.Category1 = "Electronics";
thirdBasketItem.Category2 = "Usb / Cable";
thirdBasketItem.ItemType = Iyzipay.Model.BasketItemType.PHYSICAL.ToString();
thirdBasketItem.Price = "0.2";
basketItems.Add(thirdBasketItem);
request.BasketItems = basketItems;
Iyzipay.Model.ThreedsInitialize threedsInitialize = Iyzipay.Model.ThreedsInitialize.Create(request, options);
Iyzipay.Model.Payment paymentResult = Iyzipay.Model.Payment.Create(request, options);
Console.WriteLine(paymentResult.CardAssociation);