public static TransactionResultTypes IsPurchaseValid(CoreAccount payer, ServiceAccount receiver, ChainInfo chainInfo, PurchaseServiceTransaction transaction)
        {
            if (chainInfo == null)
            {
                return(TransactionResultTypes.ChainNotFound);
            }

            if (payer == null || !payer.CanPurchase(transaction.Price))
            {
                return(TransactionResultTypes.InsuficientBalance);
            }

            if (receiver == null)
            {
                return(TransactionResultTypes.InvalidServiceAccount);
            }

            if (!chainInfo.IsPurchaseValid(transaction.PurchaseGroupId, transaction.PurchaseItemId, transaction.Price))
            {
                return(TransactionResultTypes.PurchaseNotFound);
            }

            if (!receiver.CanPurchaseItem(transaction, chainInfo))
            {
                return(TransactionResultTypes.CannotPurchase);
            }

            return(TransactionResultTypes.Ok);
        }