Created
January 27, 2024 14:03
-
-
Save jtrimm007/ad00cf3d815ed9d3bd06736b997ced88 to your computer and use it in GitHub Desktop.
Custom Stripe enums string converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum BusinessType | |
{ | |
Proprietorship, SingleMemberLLC, Corporation | |
} | |
public static string ConvertToStripe(this BusinessType businessType) | |
{ | |
switch (businessType) | |
{ | |
case BusinessType.Proprietorship: | |
return "sole_proprietorship"; | |
case BusinessType.SingleMemberLLC: | |
return "single_member_llc"; | |
case BusinessType.Corporation: | |
return "private_corporation"; | |
default: | |
return null; | |
} | |
} | |
// implementation | |
connectAccount.BusinessType.ConvertToStripe() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment