Ejemplo n.º 1
0
        public async Task <IPaymentRequest> CreateAsync(IPaymentRequest paymentRequest)
        {
            paymentRequest.Status = PaymentRequestStatus.New;

            paymentRequest.Timestamp = DateTime.UtcNow;

            DateTime walletDueDate = paymentRequest.DueDate.Add(_expirationPeriods.WalletExtra);

            IVirtualWallet wallet = await _walletsManager.CreateAsync(paymentRequest.MerchantId, walletDueDate);

            paymentRequest.WalletAddress = wallet.Id;

            IPaymentRequest createdPaymentRequest = await _paymentRequestRepository.InsertAsync(paymentRequest);

            _log.Info("Payment request created", paymentRequest.ToJson());

            return(createdPaymentRequest);
        }