Skip to content

Commit

Permalink
[BILL-111] adds vertex_transaction_type to plan
Browse files Browse the repository at this point in the history
  • Loading branch information
epagerecurly committed Oct 30, 2024
1 parent a5c20c6 commit c9236bb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Library/Plan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public enum IntervalUnit
public string SuccessUrl { get; set; }
public string CancelUrl { get; set; }

/// <summary>
/// VertexTransactionType is one of rental,sale,lease
/// Requires feature flag and vertex integration to use
/// </summary>
public string VertexTransactionType { get; set; }

public bool? DisplayDonationAmounts { get; set; }
public bool? DisplayQuantity { get; set; }
public bool? DisplayPhoneNumber { get; set; }
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions Test/Fixtures/plans/show-200.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ Content-Type: application/xml; charset=utf-8
<USD type="integer">500</USD>
<EUR type="integer">400</EUR>
</setup_fee_in_cents>
<vertex_transaction_type>rental</vertex_transaction_type>
</plan>
12 changes: 12 additions & 0 deletions Test/PlanTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}

0 comments on commit c9236bb

Please sign in to comment.