fromString static method

PaymentMethodTypes fromString(
  1. String method
)

Creates a PaymentMethodTypes instance from its string representation.

Throws an UnimplementedError if the provided method is not supported.

Implementation

static PaymentMethodTypes fromString(String method) {
  return PaymentMethodTypes.values.firstWhere(
    (value) => value.toStr == method,
    orElse: () =>
        throw UnimplementedError('This payment method is not supported'),
  );
}