Skip to content

Commit

Permalink
add card_network_preference field
Browse files Browse the repository at this point in the history
  • Loading branch information
gilv93 committed Mar 19, 2024
1 parent d33855c commit c460a6c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Library/BillingInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public enum CreditCardType : short
Laser,
Unknown,
DinersClub,
UnionPay
UnionPay,
CartesBancaires
}

public enum HppType : short
Expand Down Expand Up @@ -94,6 +95,7 @@ public enum OnlineBankingPmtType : short
public CreditCardType CardType { get; set; }
public int ExpirationMonth { get; set; }
public int ExpirationYear { get; set; }
public CreditCardType CardNetworkPreference { get; set; }

public string NameOnAccount { get; set; }
public string RoutingNumber { get; set; }
Expand Down Expand Up @@ -428,6 +430,12 @@ internal override void ReadXml(XmlTextReader reader)
LastTwo = reader.ReadElementContentAsString();
break;

case "card_network_preference":
var cardNetworkPreference = reader.ReadElementContentAsString();
if (!cardNetworkPreference.IsNullOrEmpty())
CardNetworkPreference = cardNetworkPreference.ParseAsEnum<CreditCardType>();
break;

case "paypal_billing_agreement_id":
PaypalBillingAgreementId = reader.ReadElementContentAsString();
break;
Expand Down Expand Up @@ -564,6 +572,11 @@ internal override void WriteXml(XmlTextWriter xmlWriter)
xmlWriter.WriteStringIfValid("verification_value", VerificationValue);
}

if (!CardNetworkPreference.Equals(CreditCardType.Invalid))
{
xmlWriter.WriteElementString("card_network_preference", CardNetworkPreference.ToString().EnumNameToTransportCase());
}

if (!RoutingNumber.IsNullOrEmpty())
{
xmlWriter.WriteElementString("routing_number", RoutingNumber);
Expand Down

0 comments on commit c460a6c

Please sign in to comment.