private static PaymentNotice buildPaymentNotice(PaymentResult paymentresult)
        {
            var transResultCode = paymentresult.resultCode.Replace("Authorised", "AUTHORISATION").Replace("Refused", "REFUSED");
            var paymentNotice = new PaymentNotice
                                    {
                                        paymentRef = paymentRef,
                                        reason = paymentresult.refusalReason,
                                        transactionId = paymentresult.pspReference,
                                        type = transResultCode,
                                        success = true
                                    };

            return paymentNotice;
        }
 public static void save(PaymentNotice paymentNotice)
 {
     try
     {
         var orm = new Orm();
         var result = orm.execObject<Result>(paymentNotice, "api.add_payment_notice");
         if (result.errorMessage != null)
             throw new DivideByZeroException();
     }
     catch (DivideByZeroException exp)
     {
         log.Error("Error saving payment notice to DB" + exp.Message);
         throw;
     }
 }