private void PushMemoReleaseAndUpdateSync(ShopifyRefund refundRecord) { try { // Workarounds for Acumatica bug that prevents storage of Payment Nbr // var acumaticaMemo = RetrieveCreditMemoWithMissingId(refundRecord); // Release the actual Memo // _invoiceClient.ReleaseInvoice(acumaticaMemo.AcumaticaRefNbr, acumaticaMemo.AcumaticaDocType); _syncOrderRepository.MemoIsReleased(acumaticaMemo.ShopifyRefundMonsterId); _syncOrderRepository.ResetOrderErrorCount(refundRecord.ShopifyOrderId); } catch (Exception ex) { _systemLogger.Error(ex); _logService.Log($"Encounter error syncing {refundRecord.LogDescriptor()}"); _syncOrderRepository.IncreaseOrderErrorCount(refundRecord.ShopifyOrderId); return; } }
public static string LogDescriptor(this ShopifyRefund shopifyRefund) { return($"Shopify Refund {shopifyRefund.ShopifyRefundId} " + $"(Order #{shopifyRefund.ShopifyOrder.ShopifyOrderNumber})"); }
public static string DetectedNewShopifyRefund(ShopifyRefund refund) { return($"Detected new {refund.LogDescriptor()}"); }
public static string ReleaseAcumaticaMemo(ShopifyRefund refund) { return($"Releasing Acumatica Memo for {refund.LogDescriptor()}"); }
public static string CreateAcumaticaMemo(ShopifyRefund refund) { return($"Creating Acumatica Memo from {refund.LogDescriptor()}"); }
public void InsertRefund(ShopifyRefund refund) { Entities.ShopifyRefunds.Add(refund); Entities.SaveChanges(); }
public static bool HasShipping(this ShopifyRefund refund) { return((Math.Abs(refund.Shipping) + Math.Abs(refund.ShippingTax)) > 0); }