diff --git a/Library/Plan.cs b/Library/Plan.cs index fb51e32e..50a48520 100644 --- a/Library/Plan.cs +++ b/Library/Plan.cs @@ -23,6 +23,12 @@ public enum IntervalUnit public string SuccessUrl { get; set; } public string CancelUrl { get; set; } + /// + /// VertexTransactionType is one of rental,sale,lease + /// Requires feature flag and vertex integration to use + /// + public string VertexTransactionType { get; set; } + public bool? DisplayDonationAmounts { get; set; } public bool? DisplayQuantity { get; set; } public bool? DisplayPhoneNumber { get; set; } @@ -320,6 +326,10 @@ internal override void ReadXml(XmlTextReader reader) CancelUrl = reader.ReadElementContentAsString(); break; + case "vertex_transaction_type": + VertexTransactionType = reader.ReadElementContentAsString(); + break; + case "display_donation_amounts": DisplayDonationAmounts = reader.ReadElementContentAsBoolean(); break; @@ -474,6 +484,7 @@ internal override void WriteXml(XmlTextWriter xmlWriter) xmlWriter.WriteStringIfValid("description", Description); xmlWriter.WriteStringIfValid("accounting_code", AccountingCode); xmlWriter.WriteStringIfValid("setup_fee_accounting_code", SetupFeeAccountingCode); + xmlWriter.WriteStringIfValid("vertex_transaction_type", VertexTransactionType); // product revrec features (and setup fee revrec features) WriteRevRecNodes(xmlWriter); diff --git a/Test/Fixtures/plans/show-200.xml b/Test/Fixtures/plans/show-200.xml index 9a123fbb..de5ebae6 100644 --- a/Test/Fixtures/plans/show-200.xml +++ b/Test/Fixtures/plans/show-200.xml @@ -37,4 +37,5 @@ Content-Type: application/xml; charset=utf-8 500 400 + rental diff --git a/Test/PlanTest.cs b/Test/PlanTest.cs index b58cd34c..9ff7bde8 100644 --- a/Test/PlanTest.cs +++ b/Test/PlanTest.cs @@ -303,5 +303,17 @@ public void CheckForRevRecData() plan.SetupFeeRevenueGlAccountId.Should().Be("dlrk123lzabc"); plan.SetupFeePerformanceObligationId.Should().Be("bks6noi"); } + + [RecurlyFact(TestEnvironment.Type.Unit)] + public void GetPlanWithVertexTransactionType() + { + var plan = new Plan(); + + var xmlFixture = FixtureImporter.Get(FixtureType.Plans, "show-200").Xml; + XmlTextReader reader = new XmlTextReader(new System.IO.StringReader(xmlFixture)); + plan.ReadXml(reader); + + plan.VertexTransactionType.Should().Be("rental"); + } } }