Skip to content

Commit 0cbaaed

Browse files
Update to use Umbraco Commerce 16.3.1 and implement new Enabled flags on Shipping/Payment Methods
1 parent 90f2ff0 commit 0cbaaed

File tree

7 files changed

+10
-4
lines changed

7 files changed

+10
-4
lines changed

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
<GlobalPackageReference Include="Umbraco.JsonSchema.Extensions" Version="0.3.0" PrivateAssets="all" />
1111
</ItemGroup>
1212
<ItemGroup>
13-
<PackageVersion Include="Umbraco.Commerce.Cms.Startup" Version="[16.1.0, 16.999.999)" />
14-
<PackageVersion Include="Umbraco.Commerce.Persistence.Sqlite" Version="[16.1.0, 16.999.999)" />
13+
<PackageVersion Include="Umbraco.Commerce.Cms.Startup" Version="[16.3.1, 16.999.999)" />
14+
<PackageVersion Include="Umbraco.Commerce.Persistence.Sqlite" Version="[16.3.1, 16.999.999)" />
1515
<PackageVersion Include="Umbraco.Deploy.Infrastructure" Version="[16.0.0, 16.999.999)" />
1616
</ItemGroup>
1717
</Project>

src/Umbraco.Commerce.Deploy/Artifacts/PaymentMethodArtifact.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public class PaymentMethodArtifact(
2323
public bool CanRefundPayments { get; set; }
2424

2525
public IEnumerable<AllowedCountryRegionArtifact>? AllowedCountryRegions { get; set; }
26+
public bool IsEnabled { get; set; }
2627
public int SortOrder { get; set; }
2728
}
2829
}

src/Umbraco.Commerce.Deploy/Artifacts/ShippingMethodArtifact.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class ShippingMethodArtifact(
2525
public SortedDictionary<string, string> ShippingProviderSettings { get; set; }
2626

2727
public IEnumerable<AllowedCountryRegionArtifact>? AllowedCountryRegions { get; set; }
28+
public bool IsEnabled { get; set; }
2829
public int SortOrder { get; set; }
2930
}
3031
}

src/Umbraco.Commerce.Deploy/Connectors/ServiceConnectors/UmbracoCommercePaymentMethodServiceConnector.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public override IAsyncEnumerable<PaymentMethodReadOnly> GetEntitiesAsync(Guid st
7575
CanCapturePayments = entity.CanCapturePayments,
7676
CanCancelPayments = entity.CanCancelPayments,
7777
CanRefundPayments = entity.CanRefundPayments,
78+
IsEnabled = entity.IsEnabled,
7879
SortOrder = entity.SortOrder
7980
};
8081

@@ -214,6 +215,7 @@ await entity.SetNameAsync(artifact.Name, artifact.Alias)
214215
.SetImageAsync(artifact.ImageId)
215216
.SetSettingsAsync(settings, SetBehavior.Merge)
216217
.ToggleFeaturesAsync(artifact.CanFetchPaymentStatuses, artifact.CanCapturePayments, artifact.CanCancelPayments, artifact.CanRefundPayments)
218+
.SetEnabledAsync(artifact.IsEnabled)
217219
.SetSortOrderAsync(artifact.SortOrder);
218220

219221
await _umbracoCommerceApi.SavePaymentMethodAsync(entity, ct);

src/Umbraco.Commerce.Deploy/Connectors/ServiceConnectors/UmbracoCommerceShippingMethodServiceConnector.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ public override IAsyncEnumerable<ShippingMethodReadOnly> GetEntitiesAsync(Guid s
7777
ShippingProviderSettings = new SortedDictionary<string, string>(entity.ShippingProviderSettings
7878
.Where(x => !StringExtensions.InvariantContains(_settingsAccessor.Settings.ShippingMethods.IgnoreSettings, x.Key)) // Ignore any settings that shouldn't be transfered
7979
.ToDictionary(x => x.Key, x => x.Value)), // Could contain UDIs?
80+
IsEnabled = entity.IsEnabled,
8081
SortOrder = entity.SortOrder
8182
};
8283

@@ -231,6 +232,7 @@ await entity.SetNameAsync(artifact.Name, artifact.Alias)
231232
.SetSkuAsync(artifact.Sku)
232233
.SetImageAsync(artifact.ImageId)
233234
.SetSettingsAsync(settings, SetBehavior.Merge)
235+
.SetEnabledAsync(artifact.IsEnabled)
234236
.SetSortOrderAsync(artifact.SortOrder);
235237

236238
await _umbracoCommerceApi.SaveShippingMethodAsync(entity, ct);

src/Umbraco.Commerce.Deploy/wwwroot/umbraco-package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "Umbraco.Commerce.Deploy",
33
"name": "Umbraco Commerce Deploy",
4-
"version": "16.0.0--rc1.preview.6.gdc53613",
4+
"version": "16.2.0",
55
"allowTelemetry": true,
66
"extensions": [
77
{

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
3-
"version": "16.1.1",
3+
"version": "16.2.0",
44
"assemblyVersion": {
55
"precision": "build"
66
},

0 commit comments

Comments
 (0)