Fix shopify id / order no (#3718)

fixes #3636
This commit is contained in:
Andrew Camilleri 2022-05-09 13:58:05 +02:00 committed by GitHub
parent 4acca4c6f5
commit 21bd35accd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -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")]

View File

@ -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<string>() { invoiceOrderId });