Skip to content

Commit

Permalink
Merge pull request #4 from umbraco/hotfix/13_you-must-initialize-tran…
Browse files Browse the repository at this point in the history
…saction-exception

Redirect buyer to error url instead of continue url when Mollie payment status is failed
  • Loading branch information
umbracotrd authored Oct 24, 2024
2 parents 0160772 + 66caa6e commit c65cc34
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 52 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -479,3 +479,5 @@ $RECYCLE.BIN/
##
## Umbraco Commerce specific
##
/src/Umbraco.Commerce.PaymentProviders.Mollie/packages.lock.json
/Umbraco.Commerce.PaymentProviders.Mollie.Tests/packages.lock.json
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
<PackageVersion Include="Mollie.Api" Version="[3.4.1, 4)" />
<PackageVersion Include="Umbraco.Commerce.Core" Version="[13.0.0, 14)" />
<PackageVersion Include="Microsoft.AspNet.WebApi.Client" Version="[6, 7)" />
<PackageVersion Include="Microsoft.AspNetCore.WebUtilities" Version="[8, 9)" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
<NoWarn>CA1707</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="NUnit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\src\Umbraco.Commerce.PaymentProviders.Mollie\Umbraco.Commerce.PaymentProviders.Mollie.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Microsoft.AspNetCore.WebUtilities;
using NUnit.Framework;

namespace Umbraco.Commerce.PaymentProviders.Mollie.Tests
{
public class UriQueryHelperTests
{
[TestCase("https://umbraco.com", "https://umbraco.com?addedparam=true", "adding a query parameter to an absolute url with no query parameters case failed")]
[TestCase("https://umbraco.com?param1=a&param2=b", "https://umbraco.com?param1=a&param2=b&addedparam=true", "adding a query parameter to an absolute url with query parameters case failed")]
[TestCase("/relative-url", "/relative-url?addedparam=true", "adding a query parameter to a relative url with no query parameters case failed")]
[TestCase("/relative-url?param1=a&param2=b", "/relative-url?param1=a&param2=b&addedparam=true", "adding a query parameter to a relative url case failed")]
public void AddQueryParameter_Should_Run_Successfully(string input, string expect, string errorMessage)
{
string actualOutput = QueryHelpers.AddQueryString(input, "addedparam", "true");

Assert.That(actualOutput, Is.EqualTo(expect), errorMessage);
}
}
}
17 changes: 11 additions & 6 deletions Umbraco.Commerce.PaymentProviders.Mollie.sln
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29503.13

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.11.35327.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Commerce.PaymentProviders.Mollie", "src\Umbraco.Commerce.PaymentProviders.Mollie\Umbraco.Commerce.PaymentProviders.Mollie.csproj", "{1AC2CE83-B474-4776-BE0C-227FED386D5F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Umbraco.Commerce.PaymentProviders.Mollie", "src\Umbraco.Commerce.PaymentProviders.Mollie\Umbraco.Commerce.PaymentProviders.Mollie.csproj", "{1AC2CE83-B474-4776-BE0C-227FED386D5F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Commerce.PaymentProviders.Mollie.Tests", "Umbraco.Commerce.PaymentProviders.Mollie.Tests\Umbraco.Commerce.PaymentProviders.Mollie.Tests.csproj", "{76672DA4-A3E3-4DED-A8BE-2D626C85C5C5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F9094F2A-B15B-425A-8600-819134240391}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9094F2A-B15B-425A-8600-819134240391}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AC2CE83-B474-4776-BE0C-227FED386D5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1AC2CE83-B474-4776-BE0C-227FED386D5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1AC2CE83-B474-4776-BE0C-227FED386D5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1AC2CE83-B474-4776-BE0C-227FED386D5F}.Release|Any CPU.Build.0 = Release|Any CPU
{76672DA4-A3E3-4DED-A8BE-2D626C85C5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76672DA4-A3E3-4DED-A8BE-2D626C85C5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76672DA4-A3E3-4DED-A8BE-2D626C85C5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76672DA4-A3E3-4DED-A8BE-2D626C85C5C5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading

0 comments on commit c65cc34

Please sign in to comment.