findVisibleGooglePayMethod function

AvailablePaymentMethod? findVisibleGooglePayMethod(
  1. CheckoutCustomizationData? customization
)

First visible Google Pay wallet row from checkout available_methods, or null.

Implementation

AvailablePaymentMethod? findVisibleGooglePayMethod(
  CheckoutCustomizationData? customization,
) {
  if (customization == null) return null;
  for (final m in customization.availableMethods) {
    if (m.show == 0) continue;
    if (isGooglePayCheckoutMethodType(m.type)) return m;
  }
  return null;
}