public async Task ProcessFormAsync() { var existingPaymentMethods = await _checkoutDataRepository.GetAllPaymentMethodsAsync(); var matchingExistingPaymentMethod = FindMatchingPaymentMethod(PaymentMethod, existingPaymentMethods); if (matchingExistingPaymentMethod != null) { PaymentMethod = matchingExistingPaymentMethod; } else { await _checkoutDataRepository.SavePaymentMethodAsync(PaymentMethod); } }