From ffbbe9fa899fac98c5afc93f6509d847de22f658 Mon Sep 17 00:00:00 2001 From: autobot Date: Tue, 14 May 2024 17:01:28 +0000 Subject: [PATCH] Generated PR for Release: 37.0.0 --- Square.sln | 20 +++--- Square/Models/CatalogItem.cs | 62 +++++++++++++++-- .../DestinationDetailsCardRefundDetails.cs | 68 ++++++++++++++++--- Square/Models/Payment.cs | 31 ++++++++- Square/Square.csproj | 6 +- Square/SquareClient.cs | 8 +-- doc/client.md | 6 +- doc/models/catalog-item.md | 3 +- ...destination-details-card-refund-details.md | 4 +- doc/models/destination-details.md | 3 +- doc/models/get-payment-refund-response.md | 3 +- doc/models/list-payment-refunds-response.md | 3 +- doc/models/payment-refund.md | 3 +- doc/models/payment.md | 1 + doc/models/refund-payment-response.md | 3 +- 15 files changed, 182 insertions(+), 42 deletions(-) diff --git a/Square.sln b/Square.sln index 2250f47b..1d216379 100644 --- a/Square.sln +++ b/Square.sln @@ -2,9 +2,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26430.14 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square", "Square/Square.csproj", "{6e3f5606-ac3a-4f31-b282-c963803ed607}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square", "Square/Square.csproj", "{6c4b5924-fd38-48fe-8c8b-d369556ee19a}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Tests", "Square.Tests/Square.Tests.csproj", "{3b6c7029-db3d-4724-a411-e817ac6e70e3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Square.Tests", "Square.Tests/Square.Tests.csproj", "{62caf792-09fd-43b0-abc2-f1c0ebd2e033}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -12,14 +12,14 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6e3f5606-ac3a-4f31-b282-c963803ed607}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6e3f5606-ac3a-4f31-b282-c963803ed607}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6e3f5606-ac3a-4f31-b282-c963803ed607}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6e3f5606-ac3a-4f31-b282-c963803ed607}.Release|Any CPU.Build.0 = Release|Any CPU - {3b6c7029-db3d-4724-a411-e817ac6e70e3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3b6c7029-db3d-4724-a411-e817ac6e70e3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3b6c7029-db3d-4724-a411-e817ac6e70e3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3b6c7029-db3d-4724-a411-e817ac6e70e3}.Release|Any CPU.Build.0 = Release|Any CPU + {6c4b5924-fd38-48fe-8c8b-d369556ee19a}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6c4b5924-fd38-48fe-8c8b-d369556ee19a}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6c4b5924-fd38-48fe-8c8b-d369556ee19a}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6c4b5924-fd38-48fe-8c8b-d369556ee19a}.Release|Any CPU.Build.0 = Release|Any CPU + {62caf792-09fd-43b0-abc2-f1c0ebd2e033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {62caf792-09fd-43b0-abc2-f1c0ebd2e033}.Debug|Any CPU.Build.0 = Debug|Any CPU + {62caf792-09fd-43b0-abc2-f1c0ebd2e033}.Release|Any CPU.ActiveCfg = Release|Any CPU + {62caf792-09fd-43b0-abc2-f1c0ebd2e033}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Square/Models/CatalogItem.cs b/Square/Models/CatalogItem.cs index 703d0838..20bc7059 100644 --- a/Square/Models/CatalogItem.cs +++ b/Square/Models/CatalogItem.cs @@ -26,6 +26,7 @@ public class CatalogItem /// description. /// abbreviation. /// label_color. + /// is_taxable. /// available_online. /// available_for_pickup. /// available_electronically. @@ -51,6 +52,7 @@ public CatalogItem( string description = null, string abbreviation = null, string labelColor = null, + bool? isTaxable = null, bool? availableOnline = null, bool? availableForPickup = null, bool? availableElectronically = null, @@ -78,6 +80,7 @@ public CatalogItem( { "description", false }, { "abbreviation", false }, { "label_color", false }, + { "is_taxable", false }, { "available_online", false }, { "available_for_pickup", false }, { "available_electronically", false }, @@ -119,6 +122,12 @@ public CatalogItem( this.LabelColor = labelColor; } + if (isTaxable != null) + { + shouldSerialize["is_taxable"] = true; + this.IsTaxable = isTaxable; + } + if (availableOnline != null) { shouldSerialize["available_online"] = true; @@ -220,6 +229,7 @@ internal CatalogItem(Dictionary shouldSerialize, string description = null, string abbreviation = null, string labelColor = null, + bool? isTaxable = null, bool? availableOnline = null, bool? availableForPickup = null, bool? availableElectronically = null, @@ -246,6 +256,7 @@ internal CatalogItem(Dictionary shouldSerialize, Description = description; Abbreviation = abbreviation; LabelColor = labelColor; + IsTaxable = isTaxable; AvailableOnline = availableOnline; AvailableForPickup = availableForPickup; AvailableElectronically = availableElectronically; @@ -298,6 +309,12 @@ internal CatalogItem(Dictionary shouldSerialize, [JsonProperty("label_color")] public string LabelColor { get; } + /// + /// Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`. + /// + [JsonProperty("is_taxable")] + public bool? IsTaxable { get; } + /// /// If `true`, the item can be added to shipping orders from the merchant's online store. /// @@ -503,6 +520,15 @@ public bool ShouldSerializeLabelColor() return this.shouldSerialize["label_color"]; } + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeIsTaxable() + { + return this.shouldSerialize["is_taxable"]; + } + /// /// Checks if the field should be serialized or not. /// @@ -654,6 +680,7 @@ public override bool Equals(object obj) ((this.Description == null && other.Description == null) || (this.Description?.Equals(other.Description) == true)) && ((this.Abbreviation == null && other.Abbreviation == null) || (this.Abbreviation?.Equals(other.Abbreviation) == true)) && ((this.LabelColor == null && other.LabelColor == null) || (this.LabelColor?.Equals(other.LabelColor) == true)) && + ((this.IsTaxable == null && other.IsTaxable == null) || (this.IsTaxable?.Equals(other.IsTaxable) == true)) && ((this.AvailableOnline == null && other.AvailableOnline == null) || (this.AvailableOnline?.Equals(other.AvailableOnline) == true)) && ((this.AvailableForPickup == null && other.AvailableForPickup == null) || (this.AvailableForPickup?.Equals(other.AvailableForPickup) == true)) && ((this.AvailableElectronically == null && other.AvailableElectronically == null) || (this.AvailableElectronically?.Equals(other.AvailableElectronically) == true)) && @@ -679,14 +706,14 @@ public override bool Equals(object obj) /// public override int GetHashCode() { - int hashCode = -32689781; - hashCode = HashCode.Combine(this.Name, this.Description, this.Abbreviation, this.LabelColor, this.AvailableOnline, this.AvailableForPickup, this.AvailableElectronically); + int hashCode = -671057138; + hashCode = HashCode.Combine(this.Name, this.Description, this.Abbreviation, this.LabelColor, this.IsTaxable, this.AvailableOnline, this.AvailableForPickup); - hashCode = HashCode.Combine(hashCode, this.CategoryId, this.TaxIds, this.ModifierListInfo, this.Variations, this.ProductType, this.SkipModifierScreen, this.ItemOptions); + hashCode = HashCode.Combine(hashCode, this.AvailableElectronically, this.CategoryId, this.TaxIds, this.ModifierListInfo, this.Variations, this.ProductType, this.SkipModifierScreen); - hashCode = HashCode.Combine(hashCode, this.ImageIds, this.SortName, this.Categories, this.DescriptionHtml, this.DescriptionPlaintext, this.Channels, this.IsArchived); + hashCode = HashCode.Combine(hashCode, this.ItemOptions, this.ImageIds, this.SortName, this.Categories, this.DescriptionHtml, this.DescriptionPlaintext, this.Channels); - hashCode = HashCode.Combine(hashCode, this.EcomSeoData, this.FoodAndBeverageDetails, this.ReportingCategory); + hashCode = HashCode.Combine(hashCode, this.IsArchived, this.EcomSeoData, this.FoodAndBeverageDetails, this.ReportingCategory); return hashCode; } @@ -700,6 +727,7 @@ protected void ToString(List toStringOutput) toStringOutput.Add($"this.Description = {(this.Description == null ? "null" : this.Description)}"); toStringOutput.Add($"this.Abbreviation = {(this.Abbreviation == null ? "null" : this.Abbreviation)}"); toStringOutput.Add($"this.LabelColor = {(this.LabelColor == null ? "null" : this.LabelColor)}"); + toStringOutput.Add($"this.IsTaxable = {(this.IsTaxable == null ? "null" : this.IsTaxable.ToString())}"); toStringOutput.Add($"this.AvailableOnline = {(this.AvailableOnline == null ? "null" : this.AvailableOnline.ToString())}"); toStringOutput.Add($"this.AvailableForPickup = {(this.AvailableForPickup == null ? "null" : this.AvailableForPickup.ToString())}"); toStringOutput.Add($"this.AvailableElectronically = {(this.AvailableElectronically == null ? "null" : this.AvailableElectronically.ToString())}"); @@ -733,6 +761,7 @@ public Builder ToBuilder() .Description(this.Description) .Abbreviation(this.Abbreviation) .LabelColor(this.LabelColor) + .IsTaxable(this.IsTaxable) .AvailableOnline(this.AvailableOnline) .AvailableForPickup(this.AvailableForPickup) .AvailableElectronically(this.AvailableElectronically) @@ -767,6 +796,7 @@ public class Builder { "description", false }, { "abbreviation", false }, { "label_color", false }, + { "is_taxable", false }, { "available_online", false }, { "available_for_pickup", false }, { "available_electronically", false }, @@ -788,6 +818,7 @@ public class Builder private string description; private string abbreviation; private string labelColor; + private bool? isTaxable; private bool? availableOnline; private bool? availableForPickup; private bool? availableElectronically; @@ -857,6 +888,18 @@ public Builder LabelColor(string labelColor) return this; } + /// + /// IsTaxable. + /// + /// isTaxable. + /// Builder. + public Builder IsTaxable(bool? isTaxable) + { + shouldSerialize["is_taxable"] = true; + this.isTaxable = isTaxable; + return this; + } + /// /// AvailableOnline. /// @@ -1124,6 +1167,14 @@ public void UnsetLabelColor() this.shouldSerialize["label_color"] = false; } + /// + /// Marks the field to not be serailized. + /// + public void UnsetIsTaxable() + { + this.shouldSerialize["is_taxable"] = false; + } + /// /// Marks the field to not be serailized. /// @@ -1256,6 +1307,7 @@ public CatalogItem Build() this.description, this.abbreviation, this.labelColor, + this.isTaxable, this.availableOnline, this.availableForPickup, this.availableElectronically, diff --git a/Square/Models/DestinationDetailsCardRefundDetails.cs b/Square/Models/DestinationDetailsCardRefundDetails.cs index c1006244..0511495e 100644 --- a/Square/Models/DestinationDetailsCardRefundDetails.cs +++ b/Square/Models/DestinationDetailsCardRefundDetails.cs @@ -24,13 +24,16 @@ public class DestinationDetailsCardRefundDetails /// /// card. /// entry_method. + /// auth_result_code. public DestinationDetailsCardRefundDetails( Models.Card card = null, - string entryMethod = null) + string entryMethod = null, + string authResultCode = null) { shouldSerialize = new Dictionary { - { "entry_method", false } + { "entry_method", false }, + { "auth_result_code", false } }; this.Card = card; @@ -40,14 +43,22 @@ public DestinationDetailsCardRefundDetails( this.EntryMethod = entryMethod; } + if (authResultCode != null) + { + shouldSerialize["auth_result_code"] = true; + this.AuthResultCode = authResultCode; + } + } internal DestinationDetailsCardRefundDetails(Dictionary shouldSerialize, Models.Card card = null, - string entryMethod = null) + string entryMethod = null, + string authResultCode = null) { this.shouldSerialize = shouldSerialize; Card = card; EntryMethod = entryMethod; + AuthResultCode = authResultCode; } /// @@ -64,6 +75,12 @@ internal DestinationDetailsCardRefundDetails(Dictionary shouldSeri [JsonProperty("entry_method")] public string EntryMethod { get; } + /// + /// The authorization code provided by the issuer when a refund is approved. + /// + [JsonProperty("auth_result_code")] + public string AuthResultCode { get; } + /// public override string ToString() { @@ -83,6 +100,15 @@ public bool ShouldSerializeEntryMethod() return this.shouldSerialize["entry_method"]; } + /// + /// Checks if the field should be serialized or not. + /// + /// A boolean weather the field should be serialized or not. + public bool ShouldSerializeAuthResultCode() + { + return this.shouldSerialize["auth_result_code"]; + } + /// public override bool Equals(object obj) { @@ -96,14 +122,15 @@ public override bool Equals(object obj) return true; } return obj is DestinationDetailsCardRefundDetails other && ((this.Card == null && other.Card == null) || (this.Card?.Equals(other.Card) == true)) && - ((this.EntryMethod == null && other.EntryMethod == null) || (this.EntryMethod?.Equals(other.EntryMethod) == true)); + ((this.EntryMethod == null && other.EntryMethod == null) || (this.EntryMethod?.Equals(other.EntryMethod) == true)) && + ((this.AuthResultCode == null && other.AuthResultCode == null) || (this.AuthResultCode?.Equals(other.AuthResultCode) == true)); } /// public override int GetHashCode() { - int hashCode = -862425387; - hashCode = HashCode.Combine(this.Card, this.EntryMethod); + int hashCode = 603022044; + hashCode = HashCode.Combine(this.Card, this.EntryMethod, this.AuthResultCode); return hashCode; } @@ -115,6 +142,7 @@ protected void ToString(List toStringOutput) { toStringOutput.Add($"this.Card = {(this.Card == null ? "null" : this.Card.ToString())}"); toStringOutput.Add($"this.EntryMethod = {(this.EntryMethod == null ? "null" : this.EntryMethod)}"); + toStringOutput.Add($"this.AuthResultCode = {(this.AuthResultCode == null ? "null" : this.AuthResultCode)}"); } /// @@ -125,7 +153,8 @@ public Builder ToBuilder() { var builder = new Builder() .Card(this.Card) - .EntryMethod(this.EntryMethod); + .EntryMethod(this.EntryMethod) + .AuthResultCode(this.AuthResultCode); return builder; } @@ -137,10 +166,12 @@ public class Builder private Dictionary shouldSerialize = new Dictionary { { "entry_method", false }, + { "auth_result_code", false }, }; private Models.Card card; private string entryMethod; + private string authResultCode; /// /// Card. @@ -165,6 +196,18 @@ public Builder EntryMethod(string entryMethod) return this; } + /// + /// AuthResultCode. + /// + /// authResultCode. + /// Builder. + public Builder AuthResultCode(string authResultCode) + { + shouldSerialize["auth_result_code"] = true; + this.authResultCode = authResultCode; + return this; + } + /// /// Marks the field to not be serailized. /// @@ -173,6 +216,14 @@ public void UnsetEntryMethod() this.shouldSerialize["entry_method"] = false; } + /// + /// Marks the field to not be serailized. + /// + public void UnsetAuthResultCode() + { + this.shouldSerialize["auth_result_code"] = false; + } + /// /// Builds class object. @@ -182,7 +233,8 @@ public DestinationDetailsCardRefundDetails Build() { return new DestinationDetailsCardRefundDetails(shouldSerialize, this.card, - this.entryMethod); + this.entryMethod, + this.authResultCode); } } } diff --git a/Square/Models/Payment.cs b/Square/Models/Payment.cs index d758217c..05a5ea24 100644 --- a/Square/Models/Payment.cs +++ b/Square/Models/Payment.cs @@ -62,6 +62,7 @@ public class Payment /// receipt_url. /// device_details. /// application_details. + /// is_offline_payment. /// version_token. public Payment( string id = null, @@ -104,6 +105,7 @@ public Payment( string receiptUrl = null, Models.DeviceDetails deviceDetails = null, Models.ApplicationDetails applicationDetails = null, + bool? isOfflinePayment = null, string versionToken = null) { shouldSerialize = new Dictionary @@ -157,6 +159,7 @@ public Payment( this.ReceiptUrl = receiptUrl; this.DeviceDetails = deviceDetails; this.ApplicationDetails = applicationDetails; + this.IsOfflinePayment = isOfflinePayment; if (versionToken != null) { shouldSerialize["version_token"] = true; @@ -205,6 +208,7 @@ internal Payment(Dictionary shouldSerialize, string receiptUrl = null, Models.DeviceDetails deviceDetails = null, Models.ApplicationDetails applicationDetails = null, + bool? isOfflinePayment = null, string versionToken = null) { this.shouldSerialize = shouldSerialize; @@ -248,6 +252,7 @@ internal Payment(Dictionary shouldSerialize, ReceiptUrl = receiptUrl; DeviceDetails = deviceDetails; ApplicationDetails = applicationDetails; + IsOfflinePayment = isOfflinePayment; VersionToken = versionToken; } @@ -572,6 +577,12 @@ internal Payment(Dictionary shouldSerialize, [JsonProperty("application_details", NullValueHandling = NullValueHandling.Ignore)] public Models.ApplicationDetails ApplicationDetails { get; } + /// + /// Whether or not this payment was taken offline. + /// + [JsonProperty("is_offline_payment", NullValueHandling = NullValueHandling.Ignore)] + public bool? IsOfflinePayment { get; } + /// /// Used for optimistic concurrency. This opaque token identifies a specific version of the /// `Payment` object. @@ -659,13 +670,14 @@ public override bool Equals(object obj) ((this.ReceiptUrl == null && other.ReceiptUrl == null) || (this.ReceiptUrl?.Equals(other.ReceiptUrl) == true)) && ((this.DeviceDetails == null && other.DeviceDetails == null) || (this.DeviceDetails?.Equals(other.DeviceDetails) == true)) && ((this.ApplicationDetails == null && other.ApplicationDetails == null) || (this.ApplicationDetails?.Equals(other.ApplicationDetails) == true)) && + ((this.IsOfflinePayment == null && other.IsOfflinePayment == null) || (this.IsOfflinePayment?.Equals(other.IsOfflinePayment) == true)) && ((this.VersionToken == null && other.VersionToken == null) || (this.VersionToken?.Equals(other.VersionToken) == true)); } /// public override int GetHashCode() { - int hashCode = 1155904926; + int hashCode = -1515154210; hashCode = HashCode.Combine(this.Id, this.CreatedAt, this.UpdatedAt, this.AmountMoney, this.TipMoney, this.TotalMoney, this.AppFeeMoney); hashCode = HashCode.Combine(hashCode, this.ApprovedMoney, this.ProcessingFee, this.RefundedMoney, this.Status, this.DelayDuration, this.DelayAction, this.DelayedUntil); @@ -676,7 +688,7 @@ public override int GetHashCode() hashCode = HashCode.Combine(hashCode, this.RefundIds, this.RiskEvaluation, this.BuyerEmailAddress, this.BillingAddress, this.ShippingAddress, this.Note, this.StatementDescriptionIdentifier); - hashCode = HashCode.Combine(hashCode, this.Capabilities, this.ReceiptNumber, this.ReceiptUrl, this.DeviceDetails, this.ApplicationDetails, this.VersionToken); + hashCode = HashCode.Combine(hashCode, this.Capabilities, this.ReceiptNumber, this.ReceiptUrl, this.DeviceDetails, this.ApplicationDetails, this.IsOfflinePayment, this.VersionToken); return hashCode; } @@ -726,6 +738,7 @@ protected void ToString(List toStringOutput) toStringOutput.Add($"this.ReceiptUrl = {(this.ReceiptUrl == null ? "null" : this.ReceiptUrl)}"); toStringOutput.Add($"this.DeviceDetails = {(this.DeviceDetails == null ? "null" : this.DeviceDetails.ToString())}"); toStringOutput.Add($"this.ApplicationDetails = {(this.ApplicationDetails == null ? "null" : this.ApplicationDetails.ToString())}"); + toStringOutput.Add($"this.IsOfflinePayment = {(this.IsOfflinePayment == null ? "null" : this.IsOfflinePayment.ToString())}"); toStringOutput.Add($"this.VersionToken = {(this.VersionToken == null ? "null" : this.VersionToken)}"); } @@ -776,6 +789,7 @@ public Builder ToBuilder() .ReceiptUrl(this.ReceiptUrl) .DeviceDetails(this.DeviceDetails) .ApplicationDetails(this.ApplicationDetails) + .IsOfflinePayment(this.IsOfflinePayment) .VersionToken(this.VersionToken); return builder; } @@ -831,6 +845,7 @@ public class Builder private string receiptUrl; private Models.DeviceDetails deviceDetails; private Models.ApplicationDetails applicationDetails; + private bool? isOfflinePayment; private string versionToken; /// @@ -1274,6 +1289,17 @@ public Builder ApplicationDetails(Models.ApplicationDetails applicationDetails) return this; } + /// + /// IsOfflinePayment. + /// + /// isOfflinePayment. + /// Builder. + public Builder IsOfflinePayment(bool? isOfflinePayment) + { + this.isOfflinePayment = isOfflinePayment; + return this; + } + /// /// VersionToken. /// @@ -1350,6 +1376,7 @@ public Payment Build() this.receiptUrl, this.deviceDetails, this.applicationDetails, + this.isOfflinePayment, this.versionToken); } } diff --git a/Square/Square.csproj b/Square/Square.csproj index 7444a1ef..7989e2bf 100644 --- a/Square/Square.csproj +++ b/Square/Square.csproj @@ -4,13 +4,13 @@ netstandard2.0 Square - 36.0.0.0 + 37.0.0.0 Square Developer Platform Square Developer Platform Square Copyright © 2019 - 36.0.0.0 - 36.0.0.0 + 37.0.0.0 + 37.0.0.0 .NET client library for the Square API 7.3 true diff --git a/Square/SquareClient.cs b/Square/SquareClient.cs index ff9c6bd7..51b4b2e1 100644 --- a/Square/SquareClient.cs +++ b/Square/SquareClient.cs @@ -43,7 +43,7 @@ public sealed class SquareClient : ISquareClient }; private readonly GlobalConfiguration globalConfiguration; - private const string userAgent = "Square-DotNet-SDK/36.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}"; + private const string userAgent = "Square-DotNet-SDK/37.0.0 ({api-version}) {engine}/{engine-version} ({os-info}) {detail}"; private readonly HttpCallBack httpCallBack; private readonly IDictionary> additionalHeaders; private readonly Lazy mobileAuthorization; @@ -420,7 +420,7 @@ private SquareClient( /// /// Gets the current version of the SDK. /// - public string SdkVersion => "36.0.0"; + public string SdkVersion => "37.0.0"; /// /// Gets the configuration of the Http Client associated with this client. @@ -578,7 +578,7 @@ private void SetupAdditionalHeaders(AdditionalHeaderParams additionalHeaderParam /// public class Builder { - private string squareVersion = "2024-04-17"; + private string squareVersion = "2024-05-15"; private string userAgentDetail = null; private Environment environment = Square.Environment.Production; private string customUrl = "https://connect.squareup.com"; @@ -677,6 +677,7 @@ public Builder HttpClientConfig(Action action) return this; } + /// /// Sets the AdditionalHeaders for the Builder. /// @@ -741,7 +742,6 @@ internal Builder HttpCallBack(HttpCallBack httpCallBack) /// SquareClient. public SquareClient Build() { - if (bearerAuthModel.AccessToken == null) { bearerAuthModel = null; diff --git a/doc/client.md b/doc/client.md index 8694442a..f5e978c6 100644 --- a/doc/client.md +++ b/doc/client.md @@ -5,7 +5,7 @@ The following parameters are configurable for the API Client: | Parameter | Type | Description | | --- | --- | --- | -| `SquareVersion` | `string` | Square Connect API versions
*Default*: `"2024-04-17"` | +| `SquareVersion` | `string` | Square Connect API versions
*Default*: `"2024-05-15"` | | `CustomUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
*Default*: `"https://connect.squareup.com"` | | `Environment` | `string` | The API environment.
**Default: `production`** | | `Timeout` | `TimeSpan` | Http client timeout.
*Default*: `TimeSpan.FromSeconds(60)` | @@ -21,7 +21,7 @@ Square.SquareClient client = new Square.SquareClient.Builder() "AccessToken" ) .Build()) - .SquareVersion("2024-04-17") + .SquareVersion("2024-05-15") .Environment(Square.Environment.Production) .CustomUrl("https://connect.squareup.com") .Build(); @@ -49,7 +49,7 @@ namespace Testing "AccessToken" ) .Build()) - .SquareVersion("2024-04-17") + .SquareVersion("2024-05-15") .Build(); ILocationsApi locationsApi = client.LocationsApi; diff --git a/doc/models/catalog-item.md b/doc/models/catalog-item.md index 236dd127..f91d4cdb 100644 --- a/doc/models/catalog-item.md +++ b/doc/models/catalog-item.md @@ -15,6 +15,7 @@ A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` typ | `Description` | `string` | Optional | The item's description. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.

Deprecated at 2022-07-20, this field is planned to retire in 6 months. You should migrate to use `description_html` to set the description
of the [CatalogItem](entity:CatalogItem) instance. The `description` and `description_html` field values are kept in sync. If you try to
set the both fields, the `description_html` text value overwrites the `description` value. Updates in one field are also reflected in the other,
except for when you use an early version before Square API 2022-07-20 and `description_html` is set to blank, setting the `description` value to null
does not nullify `description_html`.
**Constraints**: *Maximum Length*: `4096` | | `Abbreviation` | `string` | Optional | The text of the item's display label in the Square Point of Sale app. Only up to the first five characters of the string are used.
This attribute is searchable, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `24` | | `LabelColor` | `string` | Optional | The color of the item's display label in the Square Point of Sale app. This must be a valid hex color code. | +| `IsTaxable` | `bool?` | Optional | Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`. | | `AvailableOnline` | `bool?` | Optional | If `true`, the item can be added to shipping orders from the merchant's online store. | | `AvailableForPickup` | `bool?` | Optional | If `true`, the item can be added to pickup orders from the merchant's online store. | | `AvailableElectronically` | `bool?` | Optional | If `true`, the item can be added to electronically fulfilled orders from the merchant's online store. | @@ -44,7 +45,7 @@ A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` typ "description": "description6", "abbreviation": "abbreviation8", "label_color": "label_color8", - "available_online": false + "is_taxable": false } ``` diff --git a/doc/models/destination-details-card-refund-details.md b/doc/models/destination-details-card-refund-details.md index 576d61d2..aecfd030 100644 --- a/doc/models/destination-details-card-refund-details.md +++ b/doc/models/destination-details-card-refund-details.md @@ -11,6 +11,7 @@ | --- | --- | --- | --- | | `Card` | [`Card`](../../doc/models/card.md) | Optional | Represents the payment details of a card to be used for payments. These
details are determined by the payment token generated by Web Payments SDK. | | `EntryMethod` | `string` | Optional | The method used to enter the card's details for the refund. The method can be
`KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.
**Constraints**: *Maximum Length*: `50` | +| `AuthResultCode` | `string` | Optional | The authorization code provided by the issuer when a refund is approved.
**Constraints**: *Maximum Length*: `10` | ## Example (as JSON) @@ -23,7 +24,8 @@ "exp_month": 228, "exp_year": 68 }, - "entry_method": "entry_method4" + "entry_method": "entry_method4", + "auth_result_code": "auth_result_code6" } ``` diff --git a/doc/models/destination-details.md b/doc/models/destination-details.md index a04dfefc..60a0ffa6 100644 --- a/doc/models/destination-details.md +++ b/doc/models/destination-details.md @@ -25,7 +25,8 @@ Details about a refund's destination. "exp_month": 228, "exp_year": 68 }, - "entry_method": "entry_method8" + "entry_method": "entry_method8", + "auth_result_code": "auth_result_code0" } } ``` diff --git a/doc/models/get-payment-refund-response.md b/doc/models/get-payment-refund-response.md index b48bd7b0..409da0cf 100644 --- a/doc/models/get-payment-refund-response.md +++ b/doc/models/get-payment-refund-response.md @@ -55,7 +55,8 @@ present or it might be present in a FAILED state. "exp_month": 228, "exp_year": 68 }, - "entry_method": "entry_method8" + "entry_method": "entry_method8", + "auth_result_code": "auth_result_code0" } } }, diff --git a/doc/models/list-payment-refunds-response.md b/doc/models/list-payment-refunds-response.md index 8559f8bd..b2ef69a0 100644 --- a/doc/models/list-payment-refunds-response.md +++ b/doc/models/list-payment-refunds-response.md @@ -57,7 +57,8 @@ Either `errors` or `refunds` is present in a given response (never both). "exp_month": 228, "exp_year": 68 }, - "entry_method": "entry_method8" + "entry_method": "entry_method8", + "auth_result_code": "auth_result_code0" } } } diff --git a/doc/models/payment-refund.md b/doc/models/payment-refund.md index 48534354..97a8f948 100644 --- a/doc/models/payment-refund.md +++ b/doc/models/payment-refund.md @@ -46,7 +46,8 @@ the original payment and the amount of money refunded. "exp_month": 228, "exp_year": 68 }, - "entry_method": "entry_method8" + "entry_method": "entry_method8", + "auth_result_code": "auth_result_code0" } }, "amount_money": { diff --git a/doc/models/payment.md b/doc/models/payment.md index c5667415..400f0805 100644 --- a/doc/models/payment.md +++ b/doc/models/payment.md @@ -51,6 +51,7 @@ Represents a payment processed by the Square API. | `ReceiptUrl` | `string` | Optional | The URL for the payment's receipt.
The field is only populated for COMPLETED payments.
**Constraints**: *Maximum Length*: `255` | | `DeviceDetails` | [`DeviceDetails`](../../doc/models/device-details.md) | Optional | Details about the device that took the payment. | | `ApplicationDetails` | [`ApplicationDetails`](../../doc/models/application-details.md) | Optional | Details about the application that took the payment. | +| `IsOfflinePayment` | `bool?` | Optional | Whether or not this payment was taken offline. | | `VersionToken` | `string` | Optional | Used for optimistic concurrency. This opaque token identifies a specific version of the
`Payment` object. | ## Example (as JSON) diff --git a/doc/models/refund-payment-response.md b/doc/models/refund-payment-response.md index 656da5af..897faab2 100644 --- a/doc/models/refund-payment-response.md +++ b/doc/models/refund-payment-response.md @@ -50,7 +50,8 @@ present, or it might be present with a status of `FAILED`. "exp_month": 228, "exp_year": 68 }, - "entry_method": "entry_method8" + "entry_method": "entry_method8", + "auth_result_code": "auth_result_code0" } } },