Beispiel #1
0
        public async Task <IActionResult> RedeliverWebhook(string storeId, string invoiceId, string deliveryId)
        {
            var invoice = (await _InvoiceRepository.GetInvoices(new InvoiceQuery()
            {
                InvoiceId = new[] { invoiceId },
                StoreId = new[] { storeId },
                UserId = GetUserId()
            })).FirstOrDefault();

            if (invoice is null)
            {
                return(NotFound());
            }
            var delivery = await _InvoiceRepository.GetWebhookDelivery(invoiceId, deliveryId);

            if (delivery is null)
            {
                return(NotFound());
            }
            var newDeliveryId = await WebhookNotificationManager.Redeliver(deliveryId);

            if (newDeliveryId is null)
            {
                return(NotFound());
            }
            TempData[WellKnownTempData.SuccessMessage] = "Successfully planned a redelivery";
            return(RedirectToAction(nameof(Invoice),
                                    new
            {
                invoiceId
            }));
        }
Beispiel #2
0
        public async Task <IActionResult> RedeliverWebhook(string webhookId, string deliveryId)
        {
            var delivery = await _Repo.GetWebhookDelivery(CurrentStore.Id, webhookId, deliveryId);

            if (delivery is null)
            {
                return(NotFound());
            }
            var newDeliveryId = await WebhookNotificationManager.Redeliver(deliveryId);

            if (newDeliveryId is null)
            {
                return(NotFound());
            }
            TempData[WellKnownTempData.SuccessMessage] = "Successfully planned a redelivery";
            return(RedirectToAction(nameof(ModifyWebhook),
                                    new
            {
                storeId = CurrentStore.Id,
                webhookId
            }));
        }