Exemple #1
0
        public JsonResult SubmitRBTCoursePayment(PaymentParameters model)
        {
            var description = ConfigurationManager.AppSettings["Payments.RBTCourseDescription"].ToString();
            var amount      = int.Parse(ConfigurationManager.AppSettings["Payments.RBTCourseAmount"].ToString());
            var result      = SystemService.ProcessPayment(model, description, amount);

            return(Json(result));
        }
Exemple #2
0
 private void Log(PaymentParameters parameters, PaymentTransactionResult result)
 {
     if (TransactionLogger != null)
     {
         TransactionLogger.Log(new TransactionLogEntry
         {
             Name          = parameters.Name,
             Phone         = parameters.Phone,
             Email         = parameters.Email,
             TransactionId = result.Success ? result.TransactionId : string.Empty
         });
     }
 }
Exemple #3
0
        public object ProcessPayment(PaymentParameters parameters, string description, int amount)
        {
            var month  = parameters.ExpiryDate.Substring(0, 2);
            var year   = parameters.ExpiryDate.Substring(2, 2);
            var result = StripeService.Charge(description, amount, parameters.Name, parameters.CreditCard, month, year, parameters.CVC, parameters.Email);

            if (result.Success)
            {
                Mailer.SendNotification(parameters.Name, parameters.Phone, parameters.Email);
            }
            Log(parameters, result);
            return(result);
        }