public async Task Refresh() { var selectedPaymentMethodId = PaymentMethods.FirstOrDefault(p => p.Selected)?.PaymentMethod.Id; PaymentMethods.Clear(); try { var stripeClient = await EphemeralService.Instance.GetClient(); var customerId = await EphemeralService.Instance.GetCustomerId(); var customerService = new CustomerService(stripeClient); _customer = await customerService.GetAsync(customerId); var paymentMethodService = new PaymentMethodService(stripeClient); var paymentMethodListOptions = new PaymentMethodListOptions { Customer = _customer.Id, Type = "card" }; var methods = await paymentMethodService.ListAsync(paymentMethodListOptions); foreach (var paymentMethod in methods) { PaymentMethods.Add(new PaymentMethodViewModel(paymentMethod, PaymentMethodSelected)); } if (PaymentMethods.Any()) { var toSelect = PaymentMethods.FirstOrDefault(pm => pm.PaymentMethod.Id == selectedPaymentMethodId) ?? PaymentMethods.First(); SelectPaymentMethod(toSelect); } } catch (Exception ex) { await Navigator.ShowMessage("Error", ex.Message); } }