Skip to content

Commit

Permalink
Merge pull request #248 from recurly/api_version_2_8
Browse files Browse the repository at this point in the history
Bump 1.7.0
  • Loading branch information
csmb authored Oct 18, 2017
2 parents 494053d + 7c24c5a commit f36e79f
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 3 deletions.
16 changes: 16 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
Unreleased
===============

1.7.0 (stable) / 2017-10-17
===============

* ImportedTrial flag on Subscription
* Purchases Notes Changes

### Upgrade Notes

This release will upgrade us to API version 2.8.

There is one breaking change in this API version you must consider. All `country` fields must now contain valid [2 letter ISO 3166 country codes](https://www.iso.org/iso-3166-country-codes.html). If your code fails
validation, you will receive a validation error. This affects anywhere and address is collected.


1.6.1 (stable) / 2017-10-04
===============

Expand All @@ -13,6 +27,8 @@ Unreleased
* Gift Card Support
* Purchases Endpoint Support

### Upgrade Notes

This release will upgrade us to API version 2.7. There is only 1 breaking change in this library.

`Invoice` will now use an enum for the `CollectionMethod` property instead of a string. The enum has 2 values (Automatic and Manual). Example:
Expand Down
2 changes: 1 addition & 1 deletion Library/Configuration/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public int PageSize
}

protected const string RecurlyServerUri = "https://{0}.recurly.com/v2{1}";
public const string RecurlyApiVersion = "2.7";
public const string RecurlyApiVersion = "2.8";

// static, unlikely to change
public string UserAgent
Expand Down
4 changes: 2 additions & 2 deletions Library/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.6.1.0")]
[assembly: AssemblyFileVersion("1.6.1.0")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
36 changes: 36 additions & 0 deletions Library/Purchase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,33 @@ public List<string> CouponCodes
}
private List<string> _couponCodes;

/// <summary>
/// Optional notes field. This will default to the Customer Notes
/// text specified on the Invoice Settings page in your Recurly admin.
/// Custom notes made on an invoice for a one time charge will
/// not carry over to subsequent invoices.
/// </summary>
public string CustomerNotes { get; set; }

/// <summary>
/// Optional Terms and Conditions field. This will default to the
/// Terms and Conditions text specified on the Invoice Settings page
/// in your Recurly admin. Custom notes will stay with a subscription
/// on all renewals.
/// </summary>
public string TermsAndConditions { get; set; }

/// <summary>
/// Optional VAT Reverse Charge Notes only appear if you have EU VAT
/// enabled or are using your own Avalara AvaTax account and the customer
/// is in the EU, has a VAT number, and is in a different country than
/// your own. This will default to the VAT Reverse Charge Notes text
/// specified on the Tax Settings page in your Recurly admin, unless
/// custom notes were created with the original subscription. Custom
/// notes will stay with a subscription on all renewals.
/// </summary>
public string VatReverseChargeNotes { get; set; }

#region Constructors

internal Purchase()
Expand Down Expand Up @@ -184,6 +211,15 @@ internal override void WriteXml(XmlTextWriter xmlWriter)
gc.WriteRedemptionXml(xmlWriter);
}

if (CustomerNotes != null)
xmlWriter.WriteElementString("customer_notes", CustomerNotes);

if (TermsAndConditions != null)
xmlWriter.WriteElementString("terms_and_conditions", TermsAndConditions);

if (VatReverseChargeNotes != null)
xmlWriter.WriteElementString("vat_reverse_charge_notes", VatReverseChargeNotes);

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

Expand Down
13 changes: 13 additions & 0 deletions Library/Subscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,11 @@ public SubscriptionAddOnList AddOns
/// </summary>
public DateTime? ConvertedAt { get; private set; }

/// <summary>
/// Optionally set true to denote that this subscription was imported from a trial.
/// </summary>
public bool? ImportedTrial { get; set; }

internal Subscription()
{
IsPendingSubscription = false;
Expand Down Expand Up @@ -702,6 +707,9 @@ internal override void ReadXml(XmlTextReader reader)
case "no_billing_info_reason":
NoBillingInfoReason = reader.ReadElementContentAsString();
break;
case "imported_trial":
ImportedTrial = reader.ReadElementContentAsBoolean();
break;
}
}
}
Expand Down Expand Up @@ -821,6 +829,11 @@ internal void WriteSubscriptionXml(XmlTextWriter xmlWriter, bool embedded)
xmlWriter.WriteElementString("shipping_address_id", ShippingAddressId.Value.ToString());
}

if (ImportedTrial.HasValue)
{
xmlWriter.WriteElementString("imported_trial", ImportedTrial.Value.ToString().ToLower());
}

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

Expand Down

0 comments on commit f36e79f

Please sign in to comment.