public static void LogError(Payment payment, PaymentResponse response) { var context = HttpContext.Current; var log = ErrorLog.GetDefault(context); var ex = new ApplicationException(string.Format("{0} {1}'s donation of {2:C} was unable to be processed. Error Code: {3}. Description: {4}", payment.FirstName, payment.LastName, payment.Amount, response.ResponseCode, response.ReasonText)); log.Log(new Error(ex, context)); }
private PaymentResponse ProcessRecurring(Payment payment) { payment.SubscriptionStart = DateTime.Now.AddDays(1); var response = CreateSubscription(payment); PaymentResponse paymentResponse = new PaymentResponse(response.ResponseCode.ToUpper() == "OK" ? PaymentResponseCode.Approved : PaymentResponseCode.Error, -1, string.Join("|", response.Messages.ToArray())); return paymentResponse; }