public static TransactionHistoryEntity CreateForSmartVoucherPayment(ISmartVoucherPayment operation) { return(new TransactionHistoryEntity { CustomerId = operation.CustomerId.ToString(), Timestamp = operation.Timestamp, AssetSymbol = operation.AssetSymbol, TransactionId = operation.PaymentRequestId, Type = OperationType.SmartVoucherPayment.ToString(), }); }
public async Task AddAsync(ISmartVoucherPayment payment) { using (var context = _contextFactory.CreateDataContext()) { var entity = SmartVoucherPaymentEntity.Create(payment); var historyEntity = TransactionHistoryEntity.CreateForSmartVoucherPayment(payment); context.SmartVoucherPayments.Add(entity); context.TransactionHistories.Add(historyEntity); await context.SaveChangesAsync(); } }
public static SmartVoucherPaymentEntity Create(ISmartVoucherPayment payment) { return(new SmartVoucherPaymentEntity { Timestamp = payment.Timestamp, PartnerId = payment.PartnerId, Amount = payment.Amount, ShortCode = payment.ShortCode, AssetSymbol = payment.AssetSymbol, CustomerId = payment.CustomerId, CampaignId = payment.CampaignId, PaymentRequestId = payment.PaymentRequestId, }); }