コード例 #1
0
        public async Task <PaymentDetails> RetrievePaymentDetailsAsync(string identifier)
        {
            this.logger?.LogInformation(
                "Trying to retrieve payment with id: {identifier}.",
                identifier);

            var transaction = await this.context.Transactions
                              .AsQueryable()
                              .Where(o => o.PaymentIdentifier == identifier)
                              .FirstOrDefaultAsync();

            return(MongoModelConverter.From(transaction));
        }
コード例 #2
0
        public async Task <bool> SavePaymentDetailsAsync(PaymentRequest request, PaymentResponse response)
        {
            var transaction = MongoModelConverter.To(request, response);

            if (transaction == null)
            {
                return(false);
            }

            this.logger?.LogInformation(
                "Trying to save payment with id: {identifier}.",
                response.Identifier);

            await this.context.Transactions.InsertOneAsync(transaction);

            return(true);
        }