public StripePayment(IGlobal global) { _global = global; if (_global.GetAllConfigs().FirstOrDefault(x => x.Key == "StripeMode").Value.ToLower() == "test") { StripeConfiguration.ApiKey = _global.GetAllConfigs().FirstOrDefault(x => x.Key == "StripeSecretKeyTest").Value; } else { StripeConfiguration.ApiKey = _global.GetAllConfigs().FirstOrDefault(x => x.Key == "StripeSecretKeyProduction").Value; } }
public ActionResult Confirm() { IPayment payment = _payments.GetPayment(_global.GetAllConfigs().FirstOrDefault(x => x.Key == "PaymentClass").Value); AuthoriseRequest authoriseRequest = new AuthoriseRequest() { }; var response = payment.Authorise(authoriseRequest); return(View()); }