fromString static method

LaranjinhaPaymentType fromString(
  1. String value
)

Implementation

static LaranjinhaPaymentType fromString(String value) {
  switch (value) {
    case 'credit_single_payment':
      return LaranjinhaPaymentType.creditSinglePayment;
    case 'credit_installments':
      return LaranjinhaPaymentType.creditInstallments;
    case 'credit_installments_with_interest':
      return LaranjinhaPaymentType.creditInstallmentsWithInterest;
    case 'debit':
      return LaranjinhaPaymentType.debit;
    case 'voucher':
      return LaranjinhaPaymentType.voucher;
    case 'pix':
      return LaranjinhaPaymentType.pix;
    default:
      throw ArgumentError("Invalid paymentType: '$value'");
  }
}