diff --git a/src/app-ropio/AppRopio.Payments/Best2Pay/API/Best2Pay.cs b/src/app-ropio/AppRopio.Payments/Best2Pay/API/Best2Pay.cs index 47180252..cbbf757a 100644 --- a/src/app-ropio/AppRopio.Payments/Best2Pay/API/Best2Pay.cs +++ b/src/app-ropio/AppRopio.Payments/Best2Pay/API/Best2Pay.cs @@ -14,7 +14,7 @@ public class Best2Pay public bool IsTest { get; set; } - public Best2Pay(int sector, string password, string forwardUrl, string forwardVerifyUrl) + public Best2Pay(int sector, string password, string forwardUrl, string forwardVerifyUrl, bool test) { _password = password; _sector = sector; @@ -24,7 +24,7 @@ public Best2Pay(int sector, string password, string forwardUrl, string forwardVe #if DEBUG IsTest = true; #else - IsTest = false; + IsTest = test; #endif } diff --git a/src/app-ropio/AppRopio.Payments/Best2Pay/API/Request/B2PEpaymentRequest.cs b/src/app-ropio/AppRopio.Payments/Best2Pay/API/Request/B2PEpaymentRequest.cs index 27e9c303..12944a11 100644 --- a/src/app-ropio/AppRopio.Payments/Best2Pay/API/Request/B2PEpaymentRequest.cs +++ b/src/app-ropio/AppRopio.Payments/Best2Pay/API/Request/B2PEpaymentRequest.cs @@ -23,7 +23,7 @@ public string RequestString(int sector, string password, string forwardURL) if (ID != -1) data += "&id=" + ID; if (!string.IsNullOrEmpty(firstname) && firstname.Length != 0) data += "&firstname=" + firstname; if (!string.IsNullOrEmpty(lastname) && lastname.Length != 0) data += "&lastname=" + lastname; - if (email.Length != 0) data += "&email=" + email; + if (!string.IsNullOrEmpty(email) && email.Length != 0) data += "&email=" + email; data += "&wm=" + (wm ? "1" : "0"); data += "&ym=" + (ym ? "1" : "0"); data += "&qiwi=" + (qiwi ? "1" : "0"); @@ -48,7 +48,7 @@ public string RequestString(int sector, string password, string forwardURL) if (!string.IsNullOrEmpty(lastname) && lastname.Length != 0) data.Add("lastname", lastname); - if (email.Length != 0) data.Add("email", email); + if (!string.IsNullOrEmpty(email) && email.Length != 0) data.Add("email", email); data.Add("wm", (wm ? "1" : "0")); diff --git a/src/app-ropio/AppRopio.Payments/Best2Pay/API/Request/B2PRegisterRequest.cs b/src/app-ropio/AppRopio.Payments/Best2Pay/API/Request/B2PRegisterRequest.cs index 93327876..ca5352a2 100644 --- a/src/app-ropio/AppRopio.Payments/Best2Pay/API/Request/B2PRegisterRequest.cs +++ b/src/app-ropio/AppRopio.Payments/Best2Pay/API/Request/B2PRegisterRequest.cs @@ -34,8 +34,8 @@ public string RequestString(int sector, string password, string forwardURL) if (description.Length != 0) data += "&description=" + description; data += "§or=" + sector; data += "&url=" + forwardURL; - if (email.Length != 0) data += "&email=" + email; - if (phone.Length != 0) data += "&phone=" + phone; + if (!string.IsNullOrEmpty(email) && email.Length != 0) data += "&email=" + email; + if (!string.IsNullOrEmpty(phone) && phone.Length != 0) data += "&phone=" + phone; if (signature.Length != 0) data += "&signature=" + signature; if (bank_name.Length != 0) data += "&bank_name=" + bank_name; if (address.Length != 0) data += "&address=" + address; @@ -71,9 +71,9 @@ public string RequestString(int sector, string password, string forwardURL) data.Add("sector", sector.ToString()); data.Add("url", forwardURL); - if (email.Length != 0) data.Add("email", email); + if (!string.IsNullOrEmpty(email) && email.Length != 0) data.Add("email", email); - if (phone.Length != 0) data.Add("phone", phone); + if (!string.IsNullOrEmpty(phone) && phone.Length != 0) data.Add("phone", phone); if (signature.Length != 0) data.Add("signature", signature); diff --git a/src/app-ropio/AppRopio.Payments/Best2Pay/Core/Models/Best2PayConfig.cs b/src/app-ropio/AppRopio.Payments/Best2Pay/Core/Models/Best2PayConfig.cs index 133cd49b..dfacccfa 100644 --- a/src/app-ropio/AppRopio.Payments/Best2Pay/Core/Models/Best2PayConfig.cs +++ b/src/app-ropio/AppRopio.Payments/Best2Pay/Core/Models/Best2PayConfig.cs @@ -1,5 +1,4 @@ -using System; -namespace AppRopio.Payments.Best2Pay.Core.Models +namespace AppRopio.Payments.Best2Pay.Core.Models { public class Best2PayConfig { @@ -8,5 +7,7 @@ public class Best2PayConfig public string Password { get; set; } public bool EPayment { get; set; } + + public bool Test { get; set; } } } \ No newline at end of file diff --git a/src/app-ropio/AppRopio.Payments/Best2Pay/Core/ViewModels/Best2Pay/Services/Best2PayVmService.cs b/src/app-ropio/AppRopio.Payments/Best2Pay/Core/ViewModels/Best2Pay/Services/Best2PayVmService.cs index b2047032..e4ef953e 100644 --- a/src/app-ropio/AppRopio.Payments/Best2Pay/Core/ViewModels/Best2Pay/Services/Best2PayVmService.cs +++ b/src/app-ropio/AppRopio.Payments/Best2Pay/Core/ViewModels/Best2Pay/Services/Best2PayVmService.cs @@ -37,7 +37,7 @@ public Best2PayVmService() _forwardUrl = platform == PlatformType.iPhone || platform == PlatformType.iPad ? @"https://best2pay.ru/mobileAPI/iOS" : @"https://best2pay.ru/mobileAPI/Android"; _forwardVerifyUrl = "https://best2pay.ru/mobileAPI/Phone"; - _best2Pay = new API.Best2Pay(Config.Sector, Config.Password, _forwardUrl, _forwardVerifyUrl); + _best2Pay = new API.Best2Pay(Config.Sector, Config.Password, _forwardUrl, _forwardVerifyUrl, Config.Test); } public async Task GetPaymentInfo(string orderId)