static void Main(string[] args) { VPOSConfig config = new VPOSConfig(); config.ApiKey = API_RESULT_KEY; config.ApiUrl = URL_WEB_API; config.RedirectKey = START_KEY_VPOS; config.RedirectUrl = URL_REDIRECT; //config.Timeout = 15; config.ShopID = SHOP_ID; var vposClient = new VPOSClient(config); var response = vposClient.ThreeDSAuthorize1(BuildThreeDSAuthorize1()); Console.WriteLine(response); //TestAccounting(); //TestAuth3ds(); //TestOrderStatus(); //TestVerify(); //TestRefund(); //TestAuthorize(); //TestThreeDSAuthorize0(); //TestThreeDSAuthorize1(); //TestThreeDSAuthorize2(); //TestGetHtmlDocument(); //TestGetHtmlDocumentTOKEN(); //TestVerifyMac(); }
static void TestGetHtmlDocumentTOKEN() { var vposClient = new VPOSClient(URL_WEB_API, API_RESULT_KEY, START_KEY_VPOS, SHOP_ID, URL_REDIRECT); var paymentInfo = new PaymentInfo(); paymentInfo.Amount = "1000"; paymentInfo.Currency = "978"; paymentInfo.OrderId = new Random().Next(999999999).ToString(); paymentInfo.UrlBack = URL_BACK; paymentInfo.UrlDone = URL_DONE; paymentInfo.UrlMs = URLMS; paymentInfo.AccountingMode = "D"; paymentInfo.AuthorMode = "I"; //paymentInfo.AddOption('M'); paymentInfo.Data3DS = build3DSData(); paymentInfo.Token = "0000500550493297466"; paymentInfo.ExpDate = "2112"; paymentInfo.TRecurr = "U"; paymentInfo.CRecurr = "899107067200401"; paymentInfo.NameCH = "Mario"; paymentInfo.SurnameCH = "Rossi"; paymentInfo.Network = "98"; paymentInfo.Email = "*****@*****.**"; paymentInfo.Exponent = "2"; paymentInfo.ShopEmail = "*****@*****.**"; Console.WriteLine(vposClient.BuildHtmlPaymentFragment(paymentInfo)); }
static void TestVerifyMac() { var vposClient = new VPOSClient(URL_WEB_API, API_RESULT_KEY, START_KEY_VPOS, SHOP_ID, URL_REDIRECT); var response = vposClient.VerifyMac("http://localhost:8080/payment-gateway/vpos/tokenize?ORDERID=1585919322092143568728681910679428531949566&SHOPID=129289999900002&AUTHNUMBER=413889&AMOUNT=10&CURRENCY=978&TRANSACTIONID=8032112928SL211ntcm0icwf4&ACCOUNTINGMODE=D&AUTHORMODE=I&RESULT=00&TRANSACTIONTYPE=TT07&TRECURR=U&CRECURR=899107067200401&NETWORK=02&MAC=105e962d0727ef0d30a1ce21d14e6813449daa6375c433d2cc2fa631bc3bf680"); Console.WriteLine(response.ToString()); }
static void TestOrderStatus() { var vposClient = new VPOSClient(URL_WEB_API, API_RESULT_KEY, START_KEY_VPOS, SHOP_ID, URL_REDIRECT); var requestData = new OrderStatusRequest(SHOP_ID, OPERATOR_ID, "516774135"); var response = vposClient.GetOrderStatus(requestData); Console.WriteLine(response); }
static void TestThreeDSAuthorize2() { var vposClient = new VPOSClient(URL_WEB_API, API_RESULT_KEY, START_KEY_VPOS, SHOP_ID, URL_REDIRECT); var test = new ThreeDSAuthorization2Request(); test.OperatorID = "Operator id"; test.ThreeDSTransId = "aded56a0-177d-40e3-b7a1-2d95251279cf"; var response = vposClient.ThreeDSAuthorize2(test); Console.WriteLine(response); }
static void TestAuthorize() { var vposClient = new VPOSClient(URL_WEB_API, API_RESULT_KEY, START_KEY_VPOS, SHOP_ID, URL_REDIRECT); Random rand = new Random(); var requestData = new AuthorizeRequest("12345676912" + rand.Next(1000), "OPERATOR", "4598250000000027", "2112", "6000", "978", "I", "93"); requestData.CVV2 = "111"; requestData.EmailCh = "*****@*****.**"; var response = vposClient.Authorize(requestData); Console.WriteLine(response); }
static void TestAccounting() { var vposClient = new VPOSClient(URL_WEB_API, API_RESULT_KEY, START_KEY_VPOS, SHOP_ID, URL_REDIRECT); var requestData = new CaptureRequest(); requestData.Amount = "10"; requestData.Currency = "978"; requestData.TransactionID = "8032112928SL1ljjcuqqyek44"; requestData.OrderId = "516774135"; requestData.OperatorID = OPERATOR_ID; var response = vposClient.Capture(requestData); Console.WriteLine(response.ToString()); }