diff --git a/BTCPayServer/Plugins/Shopify/ApiModels/ShopifyOrder.cs b/BTCPayServer/Plugins/Shopify/ApiModels/ShopifyOrder.cs index 65a2813e1..a77c5bfd2 100644 --- a/BTCPayServer/Plugins/Shopify/ApiModels/ShopifyOrder.cs +++ b/BTCPayServer/Plugins/Shopify/ApiModels/ShopifyOrder.cs @@ -7,6 +7,8 @@ namespace BTCPayServer.Plugins.Shopify.ApiModels { [JsonProperty("id")] public string Id { get; set; } + [JsonProperty("order_number")] + public string OrderNumber { get; set; } [JsonProperty("total_price")] public decimal TotalPrice { get; set; } [JsonProperty("total_outstanding")] diff --git a/BTCPayServer/Plugins/Shopify/UIShopifyController.cs b/BTCPayServer/Plugins/Shopify/UIShopifyController.cs index 04d89be48..e321f5d8a 100644 --- a/BTCPayServer/Plugins/Shopify/UIShopifyController.cs +++ b/BTCPayServer/Plugins/Shopify/UIShopifyController.cs @@ -112,7 +112,7 @@ namespace BTCPayServer.Plugins.Shopify var invoiceOrderId = $"{ShopifyOrderMarkerHostedService.SHOPIFY_ORDER_ID_PREFIX}{orderId}"; var matchedExistingInvoices = await _invoiceRepository.GetInvoices(new InvoiceQuery() { - OrderId = new[] { invoiceOrderId }, + TextSearch = invoiceOrderId, StoreId = new[] { storeId } }); matchedExistingInvoices = matchedExistingInvoices.Where(entity => @@ -190,7 +190,8 @@ namespace BTCPayServer.Plugins.Shopify { Amount = amount < order.TotalOutstanding ? amount : order.TotalOutstanding, Currency = order.PresentmentCurrency, - Metadata = new JObject { ["orderId"] = invoiceOrderId } + Metadata = new JObject { ["orderId"] = order.OrderNumber }, + AdditionalSearchTerms = new []{ "shopify", order.OrderNumber, order.Id, invoiceOrderId} }, store, Request.GetAbsoluteRoot(), new List() { invoiceOrderId });