You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Identify function should return a result model class (serializable) instead of an IEnumerable. It will be scalable and better.
A few suggestions, when return card types from Identify function, there are 3 scenarios
1 - Card is invalid or symbols or shady
return should be CardType.Invalid
2 - Card is not yet supported, so not found
return should be CardType.Unkown or CardType.NotYetSupported
3 - Wrap everything inside Identify with try - catch
return CardType.ErrorIdentifying from catch block
To add new type
Invalid
ErrorIdentifying (this should be instead wrapped by another class instead)
Now, cardtype should only have card types(imo). A new model should be used for Identify result which could have
[Serializable]
IdentifyResult.cs
{
"Card Number": user_inputed numbe
"Identified Card Type" : {result}
"Error Identifying" : // bool? some string error? discuss?
"IsInvalid" : // if do not want to use cardtype for error handling
}
this should also in future could be wrapped in a bulkIdentify function which could have another property "Count".
The text was updated successfully, but these errors were encountered:
I will close this issue to continue this thread on #3. One point though, I think CardType.NotYetSupported should be CardType.NotImplemented to follow NotImplementedException Class.
Identify function should return a result model class (serializable) instead of an IEnumerable. It will be scalable and better.
A few suggestions, when return card types from Identify function, there are 3 scenarios
1 - Card is invalid or symbols or shady
2 - Card is not yet supported, so not found
3 - Wrap everything inside Identify with try - catch
To add new type
Now, cardtype should only have card types(imo). A new model should be used for Identify result which could have
[Serializable]
IdentifyResult.cs
this should also in future could be wrapped in a bulkIdentify function which could have another property "Count".
The text was updated successfully, but these errors were encountered: