mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
Commenting code to elaborate on decisions made
This commit is contained in:
parent
5b958d7ff6
commit
1c510d45f0
1 changed files with 6 additions and 3 deletions
|
@ -41,14 +41,15 @@ namespace BTCPayServer.Services.Shopify
|
|||
{
|
||||
var invoice = b.Invoice;
|
||||
var shopifyOrderId = invoice.Metadata?.OrderId;
|
||||
// TODO: Don't code on live webcast, take time offline with Kukks to verify all flows
|
||||
// Lightning it can just be paid
|
||||
if ((invoice.Status == Client.Models.InvoiceStatus.Complete || invoice.Status == Client.Models.InvoiceStatus.Confirmed)
|
||||
// We're only registering transaction on confirmed or complete and if invoice has orderId
|
||||
if ((invoice.Status == Client.Models.InvoiceStatus.Confirmed || invoice.Status == Client.Models.InvoiceStatus.Complete)
|
||||
&& shopifyOrderId != null)
|
||||
{
|
||||
var storeData = await _storeRepository.FindStore(invoice.StoreId);
|
||||
var storeBlob = storeData.GetStoreBlob();
|
||||
|
||||
// ensure that store in question has shopify integration turned on
|
||||
// and that invoice's orderId has shopify specific prefix
|
||||
if (storeBlob.Shopify?.IntegratedAt.HasValue == true &&
|
||||
shopifyOrderId.StartsWith(SHOPIFY_ORDER_ID_PREFIX, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
|
@ -63,6 +64,8 @@ namespace BTCPayServer.Services.Shopify
|
|||
return;
|
||||
}
|
||||
|
||||
// if we got this far, we likely need to register this invoice's payment on Shopify
|
||||
// OrderTransactionRegisterLogic has check if transaction is already registered which is why we're passing invoice.Id
|
||||
try
|
||||
{
|
||||
await _shopifyEventsSemaphore.WaitAsync();
|
||||
|
|
Loading…
Add table
Reference in a new issue