Skip to content

Instantly share code, notes, and snippets.

@jtrimm007
Created January 27, 2024 14:03
Show Gist options
  • Save jtrimm007/ad00cf3d815ed9d3bd06736b997ced88 to your computer and use it in GitHub Desktop.
Save jtrimm007/ad00cf3d815ed9d3bd06736b997ced88 to your computer and use it in GitHub Desktop.
Custom Stripe enums string converter
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