             return nil
         }
 
-        lock.lock()
-        let completion = purchaseCompleteCallbacksByProductID.removeValue(forKey: productIdentifier)
-        lock.unlock()
-        return completion
+        return self.purchaseCompleteCallbacksByProductID.modify {
+            $0.removeValue(forKey: productIdentifier)
+        }
     }
 
     func fetchProductsAndPostReceipt(withTransaction transaction: SKPaymentTransaction, receiptData: Data) {

        preventPurchasePopupCallFromTriggeringCacheRefresh(appUserID: appUserID)

        if let presentedOfferingIdentifier = package?.offeringIdentifier {
            lock.lock()
            presentedOfferingIDsByProductID[productIdentifier] = presentedOfferingIdentifier
            lock.unlock()

        }

        productsManager.cacheProduct(sk1Product)

        lock.lock()
        defer {
            lock.unlock()
        }

        guard purchaseCompleteCallbacksByProductID[productIdentifier] == nil else {
            completion(nil, nil, ErrorUtils.operationAlreadyInProgressError(), false)
            return
        }
        purchaseCompleteCallbacksByProductID[productIdentifier] = { transaction, customerInfo, error, cancelled in
            if !cancelled {
                if let error = error {
                    Logger.rcPurchaseError(Strings.purchase.product_purchase_failed(
                        productIdentifier: productIdentifier,
                        error: error
                    ))
                } else {
                    Logger.rcPurchaseSuccess(Strings.purchase.purchased_product(
                        productIdentifier: productIdentifier
                    ))
                }
            }

            completion(transaction, customerInfo, error, cancelled)
        }
        storeKitWrapper.add(payment)
    }

    @available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *)

        guard let delegate = delegate else { return false }

        let storeProduct = StoreProduct(sk1Product: product)
        delegate.readyForPromotedProduct(storeProduct) { completion in
            self.purchaseCompleteCallbacksByProductID.modify { $0[product.productIdentifier] = completion }
            storeKitWrapper.add(payment)
        }
        return false
    }

