コード例 #1
0
 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;
     }
 }
コード例 #2
0
        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());
        }