コード例 #1
0
        public async Task ProcessFormAsync()
        {
            var existingPaymentMethods = await _checkoutDataRepository.GetAllPaymentMethodsAsync();

            var matchingExistingPaymentMethod = FindMatchingPaymentMethod(PaymentMethod, existingPaymentMethods);

            if (matchingExistingPaymentMethod != null)
            {
                PaymentMethod = matchingExistingPaymentMethod;
            }
            else
            {
                await _checkoutDataRepository.SavePaymentMethodAsync(PaymentMethod);
            }
        }