asFundingType static method
Converts an unchecked String value to a {@link FundingType} or {@code null}.
@param possibleFundingType a String that might match a {@link FundingType} or be empty @return {@code null} if the input is blank, else the appropriate {@link FundingType}
Implementation
static String? asFundingType(String? possibleFundingType) {
if (possibleFundingType == null || possibleFundingType.trim().isEmpty) {
return null;
}
if (StripeCard.FUNDING_CREDIT == possibleFundingType) {
return StripeCard.FUNDING_CREDIT;
} else if (StripeCard.FUNDING_DEBIT == possibleFundingType) {
return StripeCard.FUNDING_DEBIT;
} else if (StripeCard.FUNDING_PREPAID == possibleFundingType) {
return StripeCard.FUNDING_PREPAID;
} else {
return StripeCard.FUNDING_UNKNOWN;
}
}