private async Task PayFor(Appointment appointment)
        {
            var availablePayments = await _checkoutService.GetAppointmentPaymentMethodsAsync(appointment.Id);

            var summary = await _priceCalculationService.CalculatePriceAsync(appointment);

            var paymentMethod = summary.Total == decimal.Zero
                ? availablePayments.SingleOrDefault(payment => payment.Type == PaymentType.FreePayment)
                : GetAutoPaymentMethod(availablePayments);

            if (paymentMethod is null)
            {
                _logger.LogCritical(
                    "No auto-payment method found for patient {patientId}, appointment {appointmentId}",
                    appointment.Patient.Id,
                    appointment.Id);
                return;
            }
            _logger.LogDebug("Found payment-method {paymentMethod}", paymentMethod.Type);
            var paymentInfo = new ProcessPaymentInfo(paymentMethod);

            try
            {
                var transaction = await _checkoutService.ProcessAppointmentPaymentAsync(appointment, paymentInfo);

                _logger.LogInformation("Auto-payment is completed with {transactionId}", transaction.Id);
            }
            catch (Exception exception)
            {
                _logger.LogError(exception, "Auto-payment Failed to process payment.");
            }
        }