Skip to content

Commit

Permalink
[DE-1013] Release 5.2.0 (#42)
Browse files Browse the repository at this point in the history
- Added `tax_exempt_reason` and `default_auto_renewal_profile_id` to `Customer`
- Added `received_on` to `InvoicePayment` and `CreateInvoicePayment`
- Added `product_price_point_id` and `product_price_point_handle` to `UpdateSubscription`
- Improved some properties descriptions
  • Loading branch information
maciej-nedza authored Oct 17, 2024
1 parent 569e8e3 commit 665c5d0
Show file tree
Hide file tree
Showing 14 changed files with 311 additions and 71 deletions.
6 changes: 3 additions & 3 deletions AdvancedBilling.Standard/AdvancedBilling.Standard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Maxio.AdvancedBillingSdk</AssemblyName>
<Version>5.1.0.0</Version>
<Version>5.2.0.0</Version>
<Authors>MaxioSdk</Authors>
<Owners></Owners>
<Product>AdvancedBilling.Standard</Product>
<Copyright>Copyright © 2019</Copyright>
<AssemblyVersion>5.1.0.0</AssemblyVersion>
<FileVersion>5.1.0.0</FileVersion>
<AssemblyVersion>5.2.0.0</AssemblyVersion>
<FileVersion>5.2.0.0</FileVersion>
<Description>Ultimate billing and pricing flexibility for B2B SaaS.
Maxio integrates directly into your product, so you can seamlessly manage your product catalog, bill customers, and collect payments.</Description>
<LangVersion>7.3</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion AdvancedBilling.Standard/AdvancedBillingClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public sealed class AdvancedBillingClient : IConfiguration
};

private readonly GlobalConfiguration globalConfiguration;
private const string userAgent = "AB SDK DotNet:5.1.0 on OS {os-info}";
private const string userAgent = "AB SDK DotNet:5.2.0 on OS {os-info}";
private readonly HttpCallback httpCallback;
private readonly Lazy<APIExportsController> aPIExports;
private readonly Lazy<AdvanceInvoiceController> advanceInvoice;
Expand Down
21 changes: 17 additions & 4 deletions AdvancedBilling.Standard/Models/CreateInvoicePayment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,21 @@ public CreateInvoicePayment()
/// <param name="method">method.</param>
/// <param name="details">details.</param>
/// <param name="paymentProfileId">payment_profile_id.</param>
/// <param name="receivedOn">received_on.</param>
public CreateInvoicePayment(
CreateInvoicePaymentAmount amount = null,
string memo = null,
Models.InvoicePaymentMethodType? method = null,
string details = null,
int? paymentProfileId = null)
int? paymentProfileId = null,
DateTime? receivedOn = null)
{
this.Amount = amount;
this.Memo = memo;
this.Method = method;
this.Details = details;
this.PaymentProfileId = paymentProfileId;
this.ReceivedOn = receivedOn;
}

/// <summary>
Expand All @@ -58,7 +61,7 @@ public CreateInvoicePayment(
public CreateInvoicePaymentAmount Amount { get; set; }

/// <summary>
/// A description to be attached to the payment.
/// A description to be attached to the payment. Applicable only to `external` payments.
/// </summary>
[JsonProperty("memo", NullValueHandling = NullValueHandling.Ignore)]
public string Memo { get; set; }
Expand All @@ -70,7 +73,7 @@ public CreateInvoicePayment(
public Models.InvoicePaymentMethodType? Method { get; set; }

/// <summary>
/// Additional information related to the payment method (eg. Check #)
/// Additional information related to the payment method (eg. Check #). Applicable only to `external` payments.
/// </summary>
[JsonProperty("details", NullValueHandling = NullValueHandling.Ignore)]
public string Details { get; set; }
Expand All @@ -81,6 +84,14 @@ public CreateInvoicePayment(
[JsonProperty("payment_profile_id", NullValueHandling = NullValueHandling.Ignore)]
public int? PaymentProfileId { get; set; }

/// <summary>
/// Date reflecting when the payment was received from a customer. Must be in the past. Applicable only to
/// `external` payments.
/// </summary>
[JsonConverter(typeof(CustomDateTimeConverter), "yyyy'-'MM'-'dd")]
[JsonProperty("received_on", NullValueHandling = NullValueHandling.Ignore)]
public DateTime? ReceivedOn { get; set; }

/// <inheritdoc/>
public override string ToString()
{
Expand All @@ -107,7 +118,8 @@ public override bool Equals(object obj)
((this.Memo == null && other.Memo == null) || (this.Memo?.Equals(other.Memo) == true)) &&
((this.Method == null && other.Method == null) || (this.Method?.Equals(other.Method) == true)) &&
((this.Details == null && other.Details == null) || (this.Details?.Equals(other.Details) == true)) &&
((this.PaymentProfileId == null && other.PaymentProfileId == null) || (this.PaymentProfileId?.Equals(other.PaymentProfileId) == true));
((this.PaymentProfileId == null && other.PaymentProfileId == null) || (this.PaymentProfileId?.Equals(other.PaymentProfileId) == true)) &&
((this.ReceivedOn == null && other.ReceivedOn == null) || (this.ReceivedOn?.Equals(other.ReceivedOn) == true));
}

/// <summary>
Expand All @@ -121,6 +133,7 @@ public override bool Equals(object obj)
toStringOutput.Add($"this.Method = {(this.Method == null ? "null" : this.Method.ToString())}");
toStringOutput.Add($"this.Details = {(this.Details == null ? "null" : this.Details)}");
toStringOutput.Add($"this.PaymentProfileId = {(this.PaymentProfileId == null ? "null" : this.PaymentProfileId.ToString())}");
toStringOutput.Add($"this.ReceivedOn = {(this.ReceivedOn == null ? "null" : this.ReceivedOn.ToString())}");

base.ToString(toStringOutput);
}
Expand Down
98 changes: 95 additions & 3 deletions AdvancedBilling.Standard/Models/Customer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public class Customer : BaseModel
private string locale;
private string defaultSubscriptionGroupUid;
private string salesforceId;
private string taxExemptReason;
private int? defaultAutoRenewalProfileId;
private Dictionary<string, bool> shouldSerialize = new Dictionary<string, bool>
{
{ "cc_emails", false },
Expand All @@ -65,6 +67,8 @@ public class Customer : BaseModel
{ "locale", false },
{ "default_subscription_group_uid", false },
{ "salesforce_id", false },
{ "tax_exempt_reason", false },
{ "default_auto_renewal_profile_id", false },
};

/// <summary>
Expand Down Expand Up @@ -105,6 +109,8 @@ public Customer()
/// <param name="locale">locale.</param>
/// <param name="defaultSubscriptionGroupUid">default_subscription_group_uid.</param>
/// <param name="salesforceId">salesforce_id.</param>
/// <param name="taxExemptReason">tax_exempt_reason.</param>
/// <param name="defaultAutoRenewalProfileId">default_auto_renewal_profile_id.</param>
public Customer(
string firstName = null,
string lastName = null,
Expand Down Expand Up @@ -133,7 +139,9 @@ public Customer(
int? parentId = null,
string locale = null,
string defaultSubscriptionGroupUid = null,
string salesforceId = null)
string salesforceId = null,
string taxExemptReason = null,
int? defaultAutoRenewalProfileId = null)
{
this.FirstName = firstName;
this.LastName = lastName;
Expand Down Expand Up @@ -247,6 +255,16 @@ public Customer(
this.SalesforceId = salesforceId;
}

if (taxExemptReason != null)
{
this.TaxExemptReason = taxExemptReason;
}

if (defaultAutoRenewalProfileId != null)
{
this.DefaultAutoRenewalProfileId = defaultAutoRenewalProfileId;
}

}

/// <summary>
Expand Down Expand Up @@ -504,7 +522,7 @@ public string Phone
}

/// <summary>
/// Is the customer verified to use ACH as a payment method. Available only on Authorize.Net gateway
/// Is the customer verified to use ACH as a payment method.
/// </summary>
[JsonProperty("verified")]
public bool? Verified
Expand Down Expand Up @@ -674,6 +692,42 @@ public string SalesforceId
}
}

/// <summary>
/// The Tax Exemption Reason Code for the customer
/// </summary>
[JsonProperty("tax_exempt_reason")]
public string TaxExemptReason
{
get
{
return this.taxExemptReason;
}

set
{
this.shouldSerialize["tax_exempt_reason"] = true;
this.taxExemptReason = value;
}
}

/// <summary>
/// The default auto-renewal profile ID for the customer
/// </summary>
[JsonProperty("default_auto_renewal_profile_id")]
public int? DefaultAutoRenewalProfileId
{
get
{
return this.defaultAutoRenewalProfileId;
}

set
{
this.shouldSerialize["default_auto_renewal_profile_id"] = true;
this.defaultAutoRenewalProfileId = value;
}
}

/// <inheritdoc/>
public override string ToString()
{
Expand Down Expand Up @@ -852,6 +906,22 @@ public void UnsetSalesforceId()
this.shouldSerialize["salesforce_id"] = false;
}

/// <summary>
/// Marks the field to not be serailized.
/// </summary>
public void UnsetTaxExemptReason()
{
this.shouldSerialize["tax_exempt_reason"] = false;
}

/// <summary>
/// Marks the field to not be serailized.
/// </summary>
public void UnsetDefaultAutoRenewalProfileId()
{
this.shouldSerialize["default_auto_renewal_profile_id"] = false;
}

/// <summary>
/// Checks if the field should be serialized or not.
/// </summary>
Expand Down Expand Up @@ -1041,6 +1111,24 @@ public bool ShouldSerializeSalesforceId()
return this.shouldSerialize["salesforce_id"];
}

/// <summary>
/// Checks if the field should be serialized or not.
/// </summary>
/// <returns>A boolean weather the field should be serialized or not.</returns>
public bool ShouldSerializeTaxExemptReason()
{
return this.shouldSerialize["tax_exempt_reason"];
}

/// <summary>
/// Checks if the field should be serialized or not.
/// </summary>
/// <returns>A boolean weather the field should be serialized or not.</returns>
public bool ShouldSerializeDefaultAutoRenewalProfileId()
{
return this.shouldSerialize["default_auto_renewal_profile_id"];
}

/// <inheritdoc/>
public override bool Equals(object obj)
{
Expand Down Expand Up @@ -1080,7 +1168,9 @@ public override bool Equals(object obj)
((this.ParentId == null && other.ParentId == null) || (this.ParentId?.Equals(other.ParentId) == true)) &&
((this.Locale == null && other.Locale == null) || (this.Locale?.Equals(other.Locale) == true)) &&
((this.DefaultSubscriptionGroupUid == null && other.DefaultSubscriptionGroupUid == null) || (this.DefaultSubscriptionGroupUid?.Equals(other.DefaultSubscriptionGroupUid) == true)) &&
((this.SalesforceId == null && other.SalesforceId == null) || (this.SalesforceId?.Equals(other.SalesforceId) == true));
((this.SalesforceId == null && other.SalesforceId == null) || (this.SalesforceId?.Equals(other.SalesforceId) == true)) &&
((this.TaxExemptReason == null && other.TaxExemptReason == null) || (this.TaxExemptReason?.Equals(other.TaxExemptReason) == true)) &&
((this.DefaultAutoRenewalProfileId == null && other.DefaultAutoRenewalProfileId == null) || (this.DefaultAutoRenewalProfileId?.Equals(other.DefaultAutoRenewalProfileId) == true));
}

/// <summary>
Expand Down Expand Up @@ -1117,6 +1207,8 @@ public override bool Equals(object obj)
toStringOutput.Add($"this.Locale = {(this.Locale == null ? "null" : this.Locale)}");
toStringOutput.Add($"this.DefaultSubscriptionGroupUid = {(this.DefaultSubscriptionGroupUid == null ? "null" : this.DefaultSubscriptionGroupUid)}");
toStringOutput.Add($"this.SalesforceId = {(this.SalesforceId == null ? "null" : this.SalesforceId)}");
toStringOutput.Add($"this.TaxExemptReason = {(this.TaxExemptReason == null ? "null" : this.TaxExemptReason)}");
toStringOutput.Add($"this.DefaultAutoRenewalProfileId = {(this.DefaultAutoRenewalProfileId == null ? "null" : this.DefaultAutoRenewalProfileId.ToString())}");

base.ToString(toStringOutput);
}
Expand Down
50 changes: 48 additions & 2 deletions AdvancedBilling.Standard/Models/CustomerAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ public class CustomerAttributes : BaseModel
private string address2;
private int? parentId;
private string salesforceId;
private int? defaultAutoRenewalProfileId;
private Dictionary<string, bool> shouldSerialize = new Dictionary<string, bool>
{
{ "address_2", false },
{ "parent_id", false },
{ "salesforce_id", false },
{ "default_auto_renewal_profile_id", false },
};

/// <summary>
Expand Down Expand Up @@ -60,6 +62,7 @@ public CustomerAttributes()
/// <param name="metafields">metafields.</param>
/// <param name="parentId">parent_id.</param>
/// <param name="salesforceId">salesforce_id.</param>
/// <param name="defaultAutoRenewalProfileId">default_auto_renewal_profile_id.</param>
public CustomerAttributes(
string firstName = null,
string lastName = null,
Expand All @@ -79,7 +82,8 @@ public CustomerAttributes(
string vatNumber = null,
Dictionary<string, string> metafields = null,
int? parentId = null,
string salesforceId = null)
string salesforceId = null,
int? defaultAutoRenewalProfileId = null)
{
this.FirstName = firstName;
this.LastName = lastName;
Expand Down Expand Up @@ -112,6 +116,11 @@ public CustomerAttributes(
this.SalesforceId = salesforceId;
}

if (defaultAutoRenewalProfileId != null)
{
this.DefaultAutoRenewalProfileId = defaultAutoRenewalProfileId;
}

}

/// <summary>
Expand Down Expand Up @@ -264,6 +273,24 @@ public string SalesforceId
}
}

/// <summary>
/// (Optional) The default auto-renewal profile ID for the customer
/// </summary>
[JsonProperty("default_auto_renewal_profile_id")]
public int? DefaultAutoRenewalProfileId
{
get
{
return this.defaultAutoRenewalProfileId;
}

set
{
this.shouldSerialize["default_auto_renewal_profile_id"] = true;
this.defaultAutoRenewalProfileId = value;
}
}

/// <inheritdoc/>
public override string ToString()
{
Expand Down Expand Up @@ -298,6 +325,14 @@ public void UnsetSalesforceId()
this.shouldSerialize["salesforce_id"] = false;
}

/// <summary>
/// Marks the field to not be serailized.
/// </summary>
public void UnsetDefaultAutoRenewalProfileId()
{
this.shouldSerialize["default_auto_renewal_profile_id"] = false;
}

/// <summary>
/// Checks if the field should be serialized or not.
/// </summary>
Expand Down Expand Up @@ -325,6 +360,15 @@ public bool ShouldSerializeSalesforceId()
return this.shouldSerialize["salesforce_id"];
}

/// <summary>
/// Checks if the field should be serialized or not.
/// </summary>
/// <returns>A boolean weather the field should be serialized or not.</returns>
public bool ShouldSerializeDefaultAutoRenewalProfileId()
{
return this.shouldSerialize["default_auto_renewal_profile_id"];
}

/// <inheritdoc/>
public override bool Equals(object obj)
{
Expand Down Expand Up @@ -355,7 +399,8 @@ public override bool Equals(object obj)
((this.VatNumber == null && other.VatNumber == null) || (this.VatNumber?.Equals(other.VatNumber) == true)) &&
((this.Metafields == null && other.Metafields == null) || (this.Metafields?.Equals(other.Metafields) == true)) &&
((this.ParentId == null && other.ParentId == null) || (this.ParentId?.Equals(other.ParentId) == true)) &&
((this.SalesforceId == null && other.SalesforceId == null) || (this.SalesforceId?.Equals(other.SalesforceId) == true));
((this.SalesforceId == null && other.SalesforceId == null) || (this.SalesforceId?.Equals(other.SalesforceId) == true)) &&
((this.DefaultAutoRenewalProfileId == null && other.DefaultAutoRenewalProfileId == null) || (this.DefaultAutoRenewalProfileId?.Equals(other.DefaultAutoRenewalProfileId) == true));
}

/// <summary>
Expand Down Expand Up @@ -383,6 +428,7 @@ public override bool Equals(object obj)
toStringOutput.Add($"Metafields = {(this.Metafields == null ? "null" : this.Metafields.ToString())}");
toStringOutput.Add($"this.ParentId = {(this.ParentId == null ? "null" : this.ParentId.ToString())}");
toStringOutput.Add($"this.SalesforceId = {(this.SalesforceId == null ? "null" : this.SalesforceId)}");
toStringOutput.Add($"this.DefaultAutoRenewalProfileId = {(this.DefaultAutoRenewalProfileId == null ? "null" : this.DefaultAutoRenewalProfileId.ToString())}");

base.ToString(toStringOutput);
}
Expand Down
Loading

0 comments on commit 665c5d0

Please sign in to comment.