fromString static method
Implementation
static PaymentMethod fromString(String name) {
switch (name.toUpperCase()) {
case "CARD":
return PaymentMethod.card;
case "SWISH":
return PaymentMethod.swish;
case "CASH":
return PaymentMethod.cash;
default:
throw Exception('No payment method found for $name');
}
}