public Task <ProcessRejectedPaymentResponse> Handle(ProcessRejectedPaymentRequest request, CancellationToken cancellationToken = default) { var merchantKey = _merchantEncryptionKeyGetter.Key(request.Merchant.Id); var paymentRecord = new PaymentRecord { Id = _guid.NewGuid().ToString(), Source = new PaymentRecord.PaymentSource { CardExpiryEncrypted = _encrypter.EncryptUtf8(request.Source.CardExpiry, merchantKey), CardNumberEncrypted = _encrypter.EncryptUtf8(request.Source.CardNumber, merchantKey), CvvEncrypted = _encrypter.EncryptUtf8(request.Source.Cvv, merchantKey) }, Recipient = new PaymentRecord.PaymentRecipient { AccountNumberEncrypted = _encrypter.EncryptUtf8(request.Recipient.AccountNumber, merchantKey), SortCodeEncrypted = _encrypter.EncryptUtf8(request.Recipient.SortCode, merchantKey), }, Currency = request.Currency, Status = PaymentStatus.Rejected, Amount = request.Amount, CreatedAt = _dateTime.UtcNow(), MerchantId = request.Merchant.Id, FailureReason = request.BankResponse.FailureReason, }; _paymentRecordCreator.Add(paymentRecord); return(Task.FromResult(new ProcessRejectedPaymentResponse { Id = paymentRecord.Id })); }