byPriority method

PaymentMethod? byPriority(
  1. PaymentMethodPriority priority
)

Implementation

PaymentMethod? byPriority(PaymentMethodPriority priority) {
  if (priority.matches(PaymentMethodPriority.primary)) {
    return primaryPaymentMethod;
  } else if (priority.matches(PaymentMethodPriority.secondary)) {
    return secondaryPaymentMethod;
  } else {
    return null;
  }
}