private async Task UpdateRefLinkState(IReferralLink refLink, ReferralLinkState state) { refLink.State = state.ToString(); await _referralLinksService.UpdateAsync(refLink); await LogInfo(refLink, ControllerContext, $"RefLink state set to {state.ToString()}"); }
private async void AttachSenderTransferToRefLink(IReferralLink refLink, string transferId) { var transfer = await _offchainTransferRepository.GetTransfer(transferId); refLink.Amount = (double)transfer.Amount; refLink.Asset = (await _assets.GetItemAsync(transfer.AssetId)).Id; refLink.SenderOffchainTransferId = transferId; refLink.State = ReferralLinkState.SentToLykkeSharedWallet.ToString(); await _referralLinksService.UpdateAsync(refLink); await LogInfo(new { RefLink = refLink, TransferId = transferId }, ControllerContext, $"Transfer complete for ref link id {refLink.Id} with amount {transfer.Amount} and asset Id {refLink.Asset}. Offchain transfer Id {transferId} attached with ref link. "); }