Skip to content

Commit 08e1cab

Browse files
Process uccStepType as array value
1 parent f16d2b1 commit 08e1cab

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/Umbraco.Commerce.Checkout/Events/SyncZeroValuePaymentProviderContinueUrl.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text.Json;
35
using System.Threading.Tasks;
46
using Umbraco.Cms.Core.Models;
57
using Umbraco.Cms.Core.Routing;
@@ -42,7 +44,18 @@ private static bool IsConfirmationPageType(IContent content)
4244
return false;
4345
}
4446

45-
return content.ContentType.Alias == UmbracoCommerceCheckoutConstants.ContentTypes.Aliases.CheckoutStepPage && content.GetValue<string>("uccStepType") == "Confirmation";
47+
if (content.ContentType.Alias != UmbracoCommerceCheckoutConstants.ContentTypes.Aliases.CheckoutStepPage)
48+
{
49+
return false;
50+
}
51+
52+
var stepValue = content.GetValue<string>("uccStepType");
53+
if (stepValue != null && stepValue.StartsWith('[') && stepValue.EndsWith(']'))
54+
{
55+
stepValue = JsonSerializer.Deserialize<string[]>(stepValue)?.FirstOrDefault();
56+
}
57+
58+
return stepValue == "Confirmation";
4659
}
4760

4861
private async Task DoSyncZeroValuePaymentProviderContinueUrlAsync(IContent content)

0 commit comments

Comments
 (0)