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;
            }
        }
Ejemplo n.º 2
0
 public static string LogDescriptor(this ShopifyRefund shopifyRefund)
 {
     return($"Shopify Refund {shopifyRefund.ShopifyRefundId} " +
            $"(Order #{shopifyRefund.ShopifyOrder.ShopifyOrderNumber})");
 }
Ejemplo n.º 3
0
 public static string DetectedNewShopifyRefund(ShopifyRefund refund)
 {
     return($"Detected new {refund.LogDescriptor()}");
 }
Ejemplo n.º 4
0
 public static string ReleaseAcumaticaMemo(ShopifyRefund refund)
 {
     return($"Releasing Acumatica Memo for {refund.LogDescriptor()}");
 }
Ejemplo n.º 5
0
 public static string CreateAcumaticaMemo(ShopifyRefund refund)
 {
     return($"Creating Acumatica Memo from {refund.LogDescriptor()}");
 }
Ejemplo n.º 6
0
 public void InsertRefund(ShopifyRefund refund)
 {
     Entities.ShopifyRefunds.Add(refund);
     Entities.SaveChanges();
 }
Ejemplo n.º 7
0
 public static bool HasShipping(this ShopifyRefund refund)
 {
     return((Math.Abs(refund.Shipping) + Math.Abs(refund.ShippingTax)) > 0);
 }