### Handle 3D Secure Response Source: https://www.vpos.com.tr/docs/satis-3d This snippet demonstrates how to handle the response from the 3D Secure verification process. It parses the incoming request (either GET or POST) and passes it to `VPOSClient.Sale3DResponse` to finalize the transaction. ```csharp 1public class PaymentController 2{ 3 public async Task VirtualPOS3DResponse() 4 { 5 Dictionary? pairs = null; 6 7 if (Request.Method == "GET") 8 pairs = Request.Query.Keys.ToDictionary(k => k, v => (object)Request.Query[v]); 9 else 10 pairs = Request.Form.Keys.ToDictionary(k => k, v => (object)Request.Form[v]); 11 12 SaleResponse response = VPOSClient.Sale3DResponse(new Sale3DResponseRequest 13 { 14 responseArray = pairs 15 }, _qnbPayTest); 16 } 17} 18 ``` -------------------------------- ### Initiate 3D Secure Sale Source: https://www.vpos.com.tr/docs/satis-3d Use this snippet to initiate a 3D Secure sale by setting `payment3D.confirm` to true and providing a `returnURL`. The `VPOSClient.Sale` method is used for this initial request. ```csharp 1VirtualPOSAuth _qnbPayTest = new VirtualPOSAuth 2{ 3 bankCode = CP.VPOS.Services.BankService.QNBpay, 4 merchantID = "20158", 5 merchantUser = "07fb70f9d8de575f32baa6518e38c5d6", 6 merchantPassword = "61d97b2cac247069495be4b16f8604db", 7 merchantStorekey = "$2y$10$N9IJkgazXMUwCzpn7NJrZePy3v.dIFOQUyW4yGfT3eWry6m.KxanK", 8 testPlatform = true 9}; 10 11CustomerInfo customerInfo = new CustomerInfo 12{ 13 taxNumber = "1111111111", 14 emailAddress = "test@test.com", 15 name = "cem", 16 surname = "pehlivan", 17 phoneNumber = "1111111111", 18 addressDesc = "adres", 19 cityName = "istanbul", 20 country = CP.VPOS.Enums.Country.TUR, 21 postCode = "34000", 22 taxOffice = "maltepe", 23 townName = "maltepe" 24}; 25 26SaleRequest saleRequest = new SaleRequest 27{ 28 invoiceInfo = customerInfo, 29 shippingInfo = customerInfo, 30 saleInfo = new SaleInfo 31 { 32 cardNameSurname = "test kart", 33 cardNumber = "4022780520669303", 34 cardExpiryDateMonth = 1, 35 cardExpiryDateYear = 2050, 36 cardCVV = "988", 37 amount = (decimal)10, 38 currency = CP.VPOS.Enums.Currency.TRY, 39 installment = 1, 40 }, 41 payment3D = new Payment3D 42 { 43 confirm = true, 44 returnURL = "https://localhost/Payment/VirtualPOS3DResponse" 45 }, 46 customerIPAddress = "1.1.1.1", 47 orderNumber = Convert.ToInt32((DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds).ToString("X") 48}; 49 50 51var resp = VPOSClient.Sale(saleRequest, _qnbPayTest); ``` -------------------------------- ### Test Ortamını Aktifleştirme Source: https://www.vpos.com.tr/docs/test-ortami-bilgileri Test ortamında işlem yapmak için VirtualPOSAuth sınıfındaki testPlatform parametresini true olarak ayarlayın. ```csharp 1VirtualPOSAuth auth = new VirtualPOSAuth 2{ 3 // Diğer parametreler... 4 testPlatform = true }; ``` -------------------------------- ### Taksit Sorgulama İsteği Oluşturma Source: https://www.vpos.com.tr/docs/taksit-sorgulama Banka API bilgilerini ayarlayın ve taksit sorgulama isteği oluşturun. BINInstallmentQuery metodu, işlem tutarı, kredi kartı BIN'i ve para birimi gibi bilgileri alarak kullanılabilir. ```csharp 1// Banka API bilgilerini ayarlayın 2VirtualPOSAuth auth = new VirtualPOSAuth 3{ 4 bankCode = CP.VPOS.Services.BankService.QNBpay, 5 merchantID = "20158", 6 merchantUser = "07fb70f9d8de575f32baa6518e38c5d6", 7 merchantPassword = "61d97b2cac247069495be4b16f8604db", 8 merchantStorekey = "$2y$10$N9IJkgazXMUwCzpn7NJrZePy3v.dIFOQUyW4yGfT3eWry6m.KxanK", 9 testPlatform = true 10}; 11 12// Taksit sorgulama isteği oluşturun 13BINInstallmentQueryRequest request = new BINInstallmentQueryRequest 14{ 15 amount = 1000, //İşlem tutarı 16 BIN = "375624", //Kredi kartının ilk 6 veya 8 hanesi 17 currency = Enums.Currency.TRY 18}; 19 20var response = VPOSClient.BINInstallmentQuery(request, auth); ``` -------------------------------- ### Perform Standard Sale Transaction Source: https://www.vpos.com.tr/docs/satis This snippet demonstrates how to initialize authentication, customer, and sale details for a standard sale transaction. Ensure unique order numbers and set testPlatform to true for test environments. ```csharp 1VirtualPOSAuth _qnbPayTest = new VirtualPOSAuth 2{ 3 bankCode = CP.VPOS.Services.BankService.QNBpay, 4 merchantID = "20158", 5 merchantUser = "07fb70f9d8de575f32baa6518e38c5d6", 6 merchantPassword = "61d97b2cac247069495be4b16f8604db", 7 merchantStorekey = "$2y$10$N9IJkgazXMUwCzpn7NJrZePy3v.dIFOQUyW4yGfT3eWry6m.KxanK", 8 testPlatform = true 9}; 10 11CustomerInfo customerInfo = new CustomerInfo 12{ 13 taxNumber = "1111111111", 14 emailAddress = "test@test.com", 15 name = "cem", 16 surname = "pehlivan", 17 phoneNumber = "1111111111", 18 addressDesc = "adres", 19 cityName = "istanbul", 20 country = CP.VPOS.Enums.Country.TUR, 21 postCode = "34000", 22 taxOffice = "maltepe", 23 townName = "maltepe" 24}; 25 26SaleRequest saleRequest = new SaleRequest 27{ 28 invoiceInfo = customerInfo, 29 shippingInfo = customerInfo, 30 saleInfo = new SaleInfo 31 { 32 cardNameSurname = "test kart", 33 cardNumber = "4022780520669303", 34 cardExpiryDateMonth = 1, 35 cardExpiryDateYear = 2050, 36 cardCVV = "988", 37 amount = (decimal)10, 38 currency = CP.VPOS.Enums.Currency.TRY, 39 installment = 1, 40 }, 41 payment3D = new Payment3D 42 { 43 confirm = false 44 }, 45 customerIPAddress = "1.1.1.1", 46 orderNumber = Convert.ToInt32((DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds).ToString("X") 47}; 48 49 50var resp = VPOSClient.Sale(saleRequest, _qnbPayTest); ``` -------------------------------- ### Satış İşlemini İptal Etme Source: https://www.vpos.com.tr/docs/iptal Bu kod parçacığı, bir satış işlemini iptal etmek için VPOSClient.Cancel metodunu nasıl kullanacağınızı gösterir. Banka API bilgilerini ayarlamanız ve iptal isteği için gerekli alanları doldurmanız gerekmektedir. ```csharp 1// Banka API bilgilerini ayarlayın 2VirtualPOSAuth auth = new VirtualPOSAuth 3{ 4 bankCode = CP.VPOS.Services.BankService.QNBpay, 5 merchantID = "20158", 6 merchantUser = "07fb70f9d8de575f32baa6518e38c5d6", 7 merchantPassword = "61d97b2cac247069495be4b16f8604db", 8 merchantStorekey = "$2y$10$N9IJkgazXMUwCzpn7NJrZePy3v.dIFOQUyW4yGfT3eWry6m.KxanK", 9 testPlatform = true 10}; 11 12// İptal isteği oluşturun 13CancelRequest cancelRequest = new CancelRequest 14{ 15 currency = Enums.Currency.TRY, 16 customerIPAddress = "1.1.1.1", 17 orderNumber = "A1B2C3D4", 18 transactionId = "12345678" // Satış işleminden alınmış olan transactionId 19}; 20 21var response = VPOSClient.Cancel(cancelRequest, auth); 22 23Console.WriteLine($"statu: {response.statu.ToString()}"); 24Console.WriteLine($"message: {response.message}"); ``` -------------------------------- ### QNBpay Test Ortamı Ayarları Source: https://www.vpos.com.tr/docs/test-ortami-bilgileri QNBpay test ortamı için VirtualPOSAuth sınıfını yapılandırın. Bu ayarlar, QNBpay test sunucularına bağlanmak için kullanılır. ```csharp 1VirtualPOSAuth _qnbPayTest = new VirtualPOSAuth 2{ 3 bankCode = CP.VPOS.Services.BankService.QNBpay, 4 merchantID = "20158", 5 merchantUser = "07fb70f9d8de575f32baa6518e38c5d6", 6 merchantPassword = "61d97b2cac247069495be4b16f8604db", 7 merchantStorekey = "$2y$10$N9IJkgazXMUwCzpn7NJrZePy3v.dIFOQUyW4yGfT3eWry6m.KxanK", 8 testPlatform = true }; ``` -------------------------------- ### VPOSClient.Cancel Metodu Source: https://www.vpos.com.tr/docs/iptal Daha önce gerçekleştirilmiş bir satış işlemini iptal etmek için VPOSClient.Cancel metodunu kullanın. Bu metot, henüz finansal olarak işlenmemiş (gün sonu yapılmamış) işlemler için uygundur. ```APIDOC ## VPOSClient.Cancel ### Description Bu metot, henüz finansal olarak işlenmemiş (gün sonu yapılmamış) bir satış işlemini iptal etmek için kullanılır. İptal işlemi, satış işlemini tamamen ortadan kaldırır ve müşterinin kartından para çekilmesini engeller. ### Method `VPOSClient.Cancel(CancelRequest cancelRequest, VirtualPOSAuth auth)` ### Parameters #### Request Body - **cancelRequest** (CancelRequest) - Zorunlu - İptal isteği detaylarını içerir. - **currency** (Enums.Currency) - Zorunlu - İşlem para birimi (örn. TRY). - **customerIPAddress** (string) - Zorunlu - Müşterinin IP adresi. - **orderNumber** (string) - Zorunlu - Sipariş numarası. - **transactionId** (string) - Zorunlu - İptal edilecek satış işlemine ait transactionId. - **auth** (VirtualPOSAuth) - Zorunlu - Banka API kimlik bilgileri. - **bankCode** (Enums.BankService) - Zorunlu - Banka kodu. - **merchantID** (string) - Zorunlu - Merchant ID. - **merchantUser** (string) - Zorunlu - Merchant kullanıcı adı. - **merchantPassword** (string) - Zorunlu - Merchant şifresi. - **merchantStorekey** (string) - Zorunlu - Merchant store key. - **testPlatform** (bool) - Zorunlu - Test platformu kullanılıp kullanılmadığı. ### Response #### Success Response (200) - **statu** (string) - İşlem durumu. - **message** (string) - İşlem mesajı. #### Response Example ```json { "statu": "Success", "message": "İşlem başarıyla iptal edildi." } ``` ### Error Handling - İptal işlemi başarısız olursa, işlemin durumunu banka ile kontrol etmeniz ve gerekirse iade işlemi yapmanız gerekebilir. ``` -------------------------------- ### Gerçekleştirilmiş Satış İşlemini İade Etme Source: https://www.vpos.com.tr/docs/iade Finansal olarak işlenmiş bir satış işlemini iade etmek için VPOSClient.Refund metodunu kullanın. Banka API bilgilerini ve iade isteği detaylarını ayarlayın. İade işlemi birkaç gün sürebilir. ```csharp 1// Banka API bilgilerini ayarlayın 2VirtualPOSAuth auth = new VirtualPOSAuth 3{ 4 bankCode = CP.VPOS.Services.BankService.QNBpay, 5 merchantID = "20158", 6 merchantUser = "07fb70f9d8de575f32baa6518e38c5d6", 7 merchantPassword = "61d97b2cac247069495be4b16f8604db", 8 merchantStorekey = "$2y$10$N9IJkgazXMUwCzpn7NJrZePy3v.dIFOQUyW4yGfT3eWry6m.KxanK", 9 testPlatform = true 10}; 11 12// İade isteği oluşturun 13RefundRequest refundRequest = new RefundRequest 14{ 15 currency = Enums.Currency.TRY, 16 customerIPAddress = "1.1.1.1", 17 orderNumber = "A1B2C3D4", 18 transactionId = "12345678", // Satış işleminden alınmış olan transactionId 19 refundAmount = 100.50m // İade edilecek tutar 20}; 21 22var response = VPOSClient.Refund(refundRequest, auth); 23 24Console.WriteLine($"statu: {response.statu.ToString()}"); 25Console.WriteLine($"message: {response.message}"); ``` -------------------------------- ### İş Bankası Test Ortamı Ayarları Source: https://www.vpos.com.tr/docs/test-ortami-bilgileri İş Bankası test ortamı için VirtualPOSAuth sınıfını yapılandırın. Bu ayarlar, İş Bankası test sunucularına bağlanmak için kullanılır. ```csharp 1VirtualPOSAuth _isbankasiTest = new VirtualPOSAuth 2{ 3 bankCode = CP.VPOS.Services.BankService.IsBankasi, 4 merchantID = "700655000200", 5 merchantUser = "ISBANKAPI", 6 merchantPassword = "ISBANK07", 7 merchantStorekey = "TRPS0200", 8 testPlatform = true }; ``` -------------------------------- ### Tüm Taksit Listesi Sorgulama Source: https://www.vpos.com.tr/docs/tum-taksit-listesi Üye işyeriniz için tanımlanmış tüm taksit seçeneklerini almak için bu metodu kullanın. Banka API bilgilerini ve ödeme tutarını ayarlayın. ```csharp 1// Banka API bilgilerini ayarlayın 2VirtualPOSAuth auth = new VirtualPOSAuth 3{ 4 bankCode = CP.VPOS.Services.BankService.QNBpay, 5 merchantID = "20158", 6 merchantUser = "07fb70f9d8de575f32baa6518e38c5d6", 7 merchantPassword = "61d97b2cac247069495be4b16f8604db", 8 merchantStorekey = "$2y$10$N9IJkgazXMUwCzpn7NJrZePy3v.dIFOQUyW4yGfT3eWry6m.KxanK", 9 testPlatform = true 10}; 11 12// Tüm taksit listesi sorgulama isteği oluşturun 13AllInstallmentQueryRequest request = new AllInstallmentQueryRequest 14{ 15 amount = 100, 16 currency = Enums.Currency.TRY 17}; 18 19var response = VPOSClient.AllInstallmentQuery(request, auth); ``` -------------------------------- ### Garanti Bankası Test Ortamı Ayarları Source: https://www.vpos.com.tr/docs/test-ortami-bilgileri Garanti Bankası test ortamı için VirtualPOSAuth sınıfını yapılandırın. Bu ayarlar, Garanti BBVA test sunucularına bağlanmak için kullanılır. ```csharp 1VirtualPOSAuth _garantiTest = new VirtualPOSAuth 2{ 3 bankCode = CP.VPOS.Services.BankService.GarantiBBVA, 4 merchantID = "7000679", 5 merchantUser = "30691297", 6 merchantPassword = "123qweASD/", 7 merchantStorekey = "12345678", 8 testPlatform = true }; ``` -------------------------------- ### Kredi Kartı BIN Sorgulama Source: https://www.vpos.com.tr/docs/bin-sorgulama Kredi kartının BIN numarasını kullanarak banka bilgilerini sorgulamak için bu metodu kullanın. API bilgisi gerektirmez. ```csharp var creditCardBinQueryRequest = new CreditCardBinQueryRequest { binNumber = "375624" }; var response = VPOSClient.CreditCardBinQuery(creditCardBinQueryRequest); //{"binNumber":"375624","bankCode":"0062","cardType":1,"cardBrand":3,"commercialCard":false,"cardProgram":3,"banksWithInstallments":["0062","0032","0134","0099","0206","0124","0059","0103"]} ``` -------------------------------- ### Canlı Ortama Geçiş Source: https://www.vpos.com.tr/docs/test-ortami-bilgileri Test işlemlerini tamamladıktan sonra canlı ortama geçmek için testPlatform parametresini false olarak ayarlayın ve gerçek API bilgilerinizi kullanın. ```csharp 1VirtualPOSAuth auth = new VirtualPOSAuth 2{ 3 // Gerçek API bilgileri... 4 testPlatform = false }; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.