public void MissingTokenTest() { LibLogic.Helpers.SslSecurity.Callback(); var pay = new LibLogic.Payments.StripePayment(userid, new LibLogic.Email.FakeEmail()); pay.MakePayment("", ""); }
public void HappyPathNoCouponTest() { LibLogic.Helpers.SslSecurity.Callback(); var pay = new LibLogic.Payments.StripePayment(userid, new LibLogic.Email.FakeEmail()); pay.MakePayment(this.token, ""); }
public void Charge() { if (Helpers.SessionVariables.Instance.LoggedIn == false) { return; } // Test credit card number: 4242 4242 4242 4242 string message = ""; try { string stripeToken = Helpers.GlobalHelper.RequestParam("stripeToken"); string couponDiscount = Helpers.GlobalHelper.RequestEncodedParam("discount"); var pay = new LibLogic.Payments.StripePayment(Helpers.SessionVariables.Instance.UserId, new LibLogic.Email.LiveEmail()); pay.MakePayment(stripeToken, couponDiscount); LibLogic.ActionLog.Log_BackgroundThread("Payment made", Helpers.SessionVariables.Instance.UserId); Task.Run(() => SetDefaultVpnServer()); } catch (Exception ex) { LibLogic.Helpers.Logging.Log(ex); message = "fail"; } this.HttpContext.Response.Redirect("/charge?status=" + message, false); }