Skip to content

Commit

Permalink
Merge pull request #804 from recurly/add-action-result-field
Browse files Browse the repository at this point in the history
[V2] Add action_result to Subscription and Transaction
  • Loading branch information
douglaslise authored Aug 8, 2023
2 parents 2e07d6b + e7edd45 commit e02b0f5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Library/Subscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ public SubscriptionAddOnList AddOns

public string TransactionType { get; set; }

public string ActionResult { get; set; }

/// <summary>
/// The ramp intervals representing the pricing schedule for the subscription
/// </summary>
Expand Down Expand Up @@ -980,6 +982,10 @@ internal override void ReadXml(XmlTextReader reader)
case "shipping_amount_in_cents":
ShippingAmountInCents = reader.ReadElementContentAsInt();
break;

case "action_result":
ActionResult = reader.ReadElementContentAsString();
break;
}
}
}
Expand Down Expand Up @@ -1147,6 +1153,9 @@ internal void WriteSubscriptionXml(XmlTextWriter xmlWriter, bool embedded)
xmlWriter.WriteEndElement();
}

if (ActionResult != null)
xmlWriter.WriteElementString("action_result", ActionResult);

xmlWriter.WriteEndElement(); // End: subscription
}

Expand Down
5 changes: 5 additions & 0 deletions Library/Transaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public Account Account
public int? Invoice { get; private set; }
public string InvoicePrefix { get; private set; }

public string ActionResult { get; set; }

public string InvoiceNumberWithPrefix()
{
Expand Down Expand Up @@ -308,6 +309,9 @@ internal override void ReadXml(XmlTextReader reader)
CollectedAt = d;
}
break;
case "action_result":
ActionResult = reader.ReadElementContentAsString();
break;
case "transaction_error":
Error = new TransactionError(reader);
break;
Expand All @@ -327,6 +331,7 @@ internal override void WriteXml(XmlTextWriter xmlWriter)
xmlWriter.WriteElementString("tax_exempt", TaxExempt.AsString().ToLower());
xmlWriter.WriteStringIfValid("tax_code", TaxCode);
xmlWriter.WriteStringIfValid("accounting_code", AccountingCode);
xmlWriter.WriteStringIfValid("action_result", ActionResult);

if (Account != null)
{
Expand Down

0 comments on commit e02b0f5

Please sign in to comment.