recurly / recurly-client-dotnet

A .NET API wrapper for Recurly.
https://developers.recurly.com
MIT License
86 stars 80 forks source link

'DinersClub' credit card type missing from enum #255

Closed BenGoldberg closed 6 years ago

BenGoldberg commented 7 years ago

Hi there. In the process of testing out some credit cards, we tried one of the sandbox Diners Club numbers. However, we get an exception when trying to grab the billing info for that account, and I believe it's because 'DinersClub' isn't in the CreditCardType enum list. The exact exception we're getting is provided below.

System.ArgumentException: Requested value 'DinersClub' was not found. at System.Enum.EnumResult.SetFailure(ParseFailureKind failure, String failureMessageID, Object failureMessageFormatArgument) at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult) at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) at Recurly.StringExtensions.ParseAsEnum[T](String source) at Recurly.BillingInfo.ReadXml(XmlTextReader reader) at Recurly.Client.ReadWebResponse(HttpWebResponse response, ReadXmlDelegate readXmlDelegate, ReadXmlListDelegate readXmlListDelegate, ReadResponseDelegate responseDelegate) at Recurly.Client.PerformRequest(HttpRequestMethod method, String urlPath, WriteXmlDelegate writeXmlDelegate, ReadXmlDelegate readXmlDelegate, ReadXmlListDelegate readXmlListDelegate, ReadResponseDelegate reseponseDelegate) at Recurly.BillingInfo.Get(String accountCode)

bhelx commented 6 years ago

Thanks so much, I will submit a PR to address this first chance I get.

bhelx commented 6 years ago

It looks like you are correct for what it's worth: https://github.com/recurly/recurly-client-net/blob/5b23381d50ca2fa47a908e62b34ce0c57c696d8e/Library/BillingInfo.cs#L11-L24