public TestServerPaymentSettingsResponse Post(TestBraintreeSettingsRequest request) { var response = new TestServerPaymentSettingsResponse { IsSuccessful = false, Message = "Braintree Settings are invalid" }; try { if (BraintreeClientPaymentService.TestClient(request.BraintreeServerSettings, request.BraintreeClientSettings)) { return(new TestServerPaymentSettingsResponse { IsSuccessful = true, Message = "Braintree Settings are valid" }); } } catch (Exception e) { response.Message += "\n" + e.Message; } return(response); }
public TestServerPaymentSettingsResponse Post(TestMonerisSettingsRequest request) { var response = new TestServerPaymentSettingsResponse { IsSuccessful = false, Message = "Moneris Settings are invalid" }; try { var cc = new TestCreditCards(TestCreditCards.TestCreditCardSetting.Moneris).Visa; var result = MonerisServiceClient.TestClient(request.MonerisPaymentSettings, cc.Number, cc.ExpirationDate, _logger, cc.ZipCode); if (result) { return(new TestServerPaymentSettingsResponse { IsSuccessful = true, Message = "Moneris Settings are valid" }); } } catch (Exception e) { response.Message += "\n" + e.Message; } return(response); }
public TestServerPaymentSettingsResponse Post(TestPayPalSandboxSettingsRequest request) { var response = new TestServerPaymentSettingsResponse { IsSuccessful = false, Message = "Paypal Sandbox Credentials are invalid" }; try { if (_paylServiceFactory.GetInstance().TestCredentials(request.ClientCredentials, request.ServerCredentials, true)) { return(new TestServerPaymentSettingsResponse { IsSuccessful = true, Message = "Paypal Sandbox Credentials are valid" }); } } catch (Exception e) { response.Message += "\n" + e.Message; } return(response); }