byPriority method
- 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;
}
}