Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into issue/NEST-537
Browse files Browse the repository at this point in the history
  • Loading branch information
BenedekFarkas committed Feb 22, 2025
2 parents c2e33ae + 17473fc commit 3e5454d
Show file tree
Hide file tree
Showing 29 changed files with 46 additions and 138 deletions.
2 changes: 2 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[codespell]
ignore-words-list += , ND, ZAR
43 changes: 0 additions & 43 deletions .github/actions/spelling/allow/occ.txt

This file was deleted.

13 changes: 0 additions & 13 deletions .github/actions/spelling/allow/people.txt

This file was deleted.

12 changes: 0 additions & 12 deletions .github/actions/spelling/excludes.txt

This file was deleted.

2 changes: 0 additions & 2 deletions .github/actions/spelling/patterns.txt

This file was deleted.

15 changes: 4 additions & 11 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,12 @@ jobs:
# supported by GHA.
test-filter: "FullyQualifiedName!~SecurityScanningTests"

spelling:
name: Spelling
uses: Lombiq/GitHub-Actions/.github/workflows/spelling.yml@dev
with:
additional-dictionaries: |
cspell:csharp/csharp.txt
cspell:html/dict/html.txt
lombiq-lgha:dictionaries/Liquid.txt
lombiq-lgha:dictionaries/Lombiq.people.txt
lombiq-lgha:dictionaries/Security.txt
codespell:
name: Codespell
uses: Lombiq/GitHub-Actions/.github/workflows/codespell.yml@dev

post-pull-request-checks-automation:
needs: [build-and-test-linux, build-and-test-windows, spelling]
needs: [build-and-test-linux, build-and-test-windows, codespell]
if: github.event.pull_request != ''
uses: Lombiq/GitHub-Actions/.github/workflows/post-pull-request-checks-automation.yml@dev
secrets:
Expand Down
28 changes: 6 additions & 22 deletions OrchardCore.Commerce.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ VisualStudioVersion = 17.2.32630.192
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{D15D472D-A6EF-441F-8278-6350D89E90D2}"
ProjectSection(SolutionItems) = preProject
.codespellrc = .codespellrc
.gitattributes = .gitattributes
.gitignore = .gitignore
.github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
License.md = License.md
mkdocs.yml = mkdocs.yml
NuGet.config = NuGet.config
Readme.md = Readme.md
Reset-Local.ps1 = Reset-Local.ps1
Directory.Packages.props = Directory.Packages.props
NuGet.config = NuGet.config
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B2D057AA-E3F7-404D-A713-C3C59F9DE562}"
Expand Down Expand Up @@ -42,10 +43,10 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{A4CAB4D8-DD0C-4689-868E-DF45106E2DD1}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml
.github\workflows\publish-cloudsmith-tag.yml = .github\workflows\publish-cloudsmith-tag.yml
.github\workflows\publish-cloudsmith.yml = .github\workflows\publish-cloudsmith.yml
.github\workflows\publish-nuget.yml = .github\workflows\publish-nuget.yml
.github\workflows\validate-pull-request.yml = .github\workflows\validate-pull-request.yml
.github\workflows\publish-cloudsmith-tag.yml = .github\workflows\publish-cloudsmith-tag.yml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Commerce.ContentFields", "src\Modules\OrchardCore.Commerce.ContentFields\OrchardCore.Commerce.ContentFields.csproj", "{8027FB33-B110-48A2-9B71-89F1EA96EB67}"
Expand All @@ -65,9 +66,11 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "features", "features", "{9B2DB1CD-2B4A-4823-9762-CF4E90661404}"
ProjectSection(SolutionItems) = preProject
docs\features\boolean-product-attribute-field.md = docs\features\boolean-product-attribute-field.md
docs\features\exactly-payment.md = docs\features\exactly-payment.md
docs\features\inventory-part.md = docs\features\inventory-part.md
docs\features\inventory.md = docs\features\inventory.md
docs\features\numeric-product-attribute-field.md = docs\features\numeric-product-attribute-field.md
docs\features\payment-providers.md = docs\features\payment-providers.md
docs\features\price-part.md = docs\features\price-part.md
docs\features\price-variants-part.md = docs\features\price-variants-part.md
docs\features\product-part.md = docs\features\product-part.md
Expand All @@ -79,22 +82,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "features", "features", "{9B
docs\features\tiered-price-part.md = docs\features\tiered-price-part.md
docs\features\user-features.md = docs\features\user-features.md
docs\features\workflows.md = docs\features\workflows.md
docs\features\payment-providers.md = docs\features\payment-providers.md
docs\features\exactly-payment.md = docs\features\exactly-payment.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "actions", "actions", "{83C01924-6F58-4777-A9EC-07943F7A2E31}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "spelling", "spelling", "{E32B62B8-D737-4713-87C5-8220C9746643}"
ProjectSection(SolutionItems) = preProject
.github\actions\spelling\excludes.txt = .github\actions\spelling\excludes.txt
.github\actions\spelling\patterns.txt = .github\actions\spelling\patterns.txt
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "allow", "allow", "{7FB7940D-EEF4-4355-BCBF-C160080F257A}"
ProjectSection(SolutionItems) = preProject
.github\actions\spelling\allow\occ.txt = .github\actions\spelling\allow\occ.txt
.github\actions\spelling\allow\people.txt = .github\actions\spelling\allow\people.txt
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Commerce.Tests.UI.Shortcuts", "test\OrchardCore.Commerce.Tests.UI.Shortcuts\OrchardCore.Commerce.Tests.UI.Shortcuts.csproj", "{3DB5D0DD-1509-40B8-AD1A-47D5672BF484}"
Expand Down Expand Up @@ -209,9 +196,6 @@ Global
{87C422CA-C6F2-408F-987B-C8418995A331} = {E6C02BDF-EEB0-4ABD-ADEC-9932F60923AE}
{93871E12-0083-4323-BB7B-3CDA6E332D87} = {E6C02BDF-EEB0-4ABD-ADEC-9932F60923AE}
{9B2DB1CD-2B4A-4823-9762-CF4E90661404} = {BEBA1764-178A-4722-A193-4DEF26DCE8D1}
{83C01924-6F58-4777-A9EC-07943F7A2E31} = {4561F321-6E57-484B-950C-AC46798B1F40}
{E32B62B8-D737-4713-87C5-8220C9746643} = {83C01924-6F58-4777-A9EC-07943F7A2E31}
{7FB7940D-EEF4-4355-BCBF-C160080F257A} = {E32B62B8-D737-4713-87C5-8220C9746643}
{3DB5D0DD-1509-40B8-AD1A-47D5672BF484} = {772AFE42-DF1F-49B1-9F64-7C901E588C00}
{62DF9FF9-D2B3-4333-948D-2E405699B47B} = {BEBA1764-178A-4722-A193-4DEF26DCE8D1}
{C788AFFF-F440-4259-9102-5B4C1B91FAFA} = {62DF9FF9-D2B3-4333-948D-2E405699B47B}
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Orchard Core Commerce

[![Discord](https://img.shields.io/discord/551136772243980291?color=%237289DA&label=Discord&logo=discord&logoColor=white&style=flat)](https://discord.gg/rYHxgqU5) [![Read the Docs](https://img.shields.io/readthedocs/orchardcorecommerce?label=Documentation)](https://commerce.orchardcore.net/) [![Latest version of 'OrchardCore.Commerce' on NuGet](https://img.shields.io/nuget/v/OrchardCore.Commerce?style=flat&label=NuGet)](https://www.nuget.org/packages/OrchardCore.Commerce/) [![Latest version of 'OrchardCore.Commerce' on Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/orchardcore/commerce/nuget/OrchardCore.Commerce/latest/xsp=True/?render=true&show_latest=true&style=flat&labelColor=grey&label=Cloudsmith)](https://cloudsmith.io/~orchardcore/repos/commerce/packages/detail/nuget/OrchardCore.Commerce/latest/xsp=True/)
[![Discord](https://img.shields.io/discord/551136772243980291?color=%237289DA&label=Discord&logo=discord&logoColor=white&style=flat)](https://discord.gg/rYHxgqU5) [![Read the Docs](https://img.shields.io/readthedocs/orchardcorecommerce?label=Documentation)](https://commerce.orchardcore.net/) [![Latest version of 'OrchardCore.Commerce' on NuGet](https://img.shields.io/nuget/v/OrchardCore.Commerce?style=flat&label=NuGet)](https://www.nuget.org/packages/OrchardCore.Commerce/) [![Latest version of 'OrchardCore.Commerce' on Cloudsmith](https://api-prd.cloudsmith.io/v1/badges/version/orchardcore/commerce/nuget/OrchardCore.Commerce/latest/xsp=True/?render=true&show_latest=true&style=flat&labelColor=gray&label=Cloudsmith)](https://cloudsmith.io/~orchardcore/repos/commerce/packages/detail/nuget/OrchardCore.Commerce/latest/xsp=True/)

The commerce module for [Orchard Core](https://github.com/OrchardCMS/OrchardCore).

Expand Down
2 changes: 1 addition & 1 deletion docs/features/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Executes after the shopping cart content is loaded from the store and before it'

- Input: `ShoppingCart` object.
- Outputs:
- ShoppingCart: `ShoppingCart` object. An altered version of the input. If no changes are necessary, the output can be skipped. Here it's the most important to only use `input('JSON')` as mentioned above, because `ShoppingCart` has custom JSON converters inside that will ony correctly serialize in .NET code.
- ShoppingCart: `ShoppingCart` object. An altered version of the input. If no changes are necessary, the output can be skipped. Here it's the most important to only use `input('JSON')` as mentioned above, because `ShoppingCart` has custom JSON converters inside that will only correctly serialize in .NET code.

## Other Workflow Events

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public override void Write(Utf8JsonWriter writer, ShoppingCartItem value, JsonSe
foreach (var attribute in value.Attributes)
{
writer.WritePropertyName(attribute.AttributeName);
// Re-using the raw attribute serialization logic
// Reusing the raw attribute serialization logic
JsonSerializer.Serialize(writer, new RawProductAttributeValue(attribute.UntypedValue), options);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace OrchardCore.Commerce.AddressDataType.Constants;
namespace OrchardCore.Commerce.AddressDataType.Constants;

/// <summary>
/// Some name parts common across many cultures. None of these are guaranteed to be in every name, their order and
/// applicability can be dependant on culture or local laws.
/// applicability can depend on culture or local laws.
/// </summary>
/// <remarks>
/// <para>Prefer using "given name" instead of "first name" or "forename", and prefer "family name" instead of "last
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public sealed class AmountConverter : JsonConverter<Amount>
public const string ValueName = "value";
public const string CurrencyName = "currency";
public const string Name = "name";
public const string NativeName = "nativename"; // #spell-check-ignore-line
public const string EnglishName = "englishname"; // #spell-check-ignore-line
public const string NativeName = "nativename";
public const string EnglishName = "englishname";
public const string Symbol = "symbol";
public const string Iso = "iso";
public const string DecimalDigits = "dec";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Localization;
using OrchardCore.Commerce.MoneyDataType.Abstractions;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -37,14 +37,13 @@ public static IDictionary<string, LocalizedString> GetResultCodes(IStringLocaliz
["reversals_restricted_for_transaction"] = T["reversals not allowed for the original payment"],
["reversible_amount_exceeded"] = T["amount to reverse exceeds the amount of the original payment"],
["not_allowed_for_failed_transaction"] = T["the operation is not allowed for the failed transaction"],
["sub_recurrings_restricted_for_transaction"] = // #spell-check-ignore-line
T["subsequent recurring payments are not allowed for the initial payment"],
["sub_recurrings_restricted_for_transaction"] = T["subsequent recurring payments are not allowed for the initial payment"],
["already_captured"] = T["payment was already captured"],
["capture_amount_exceeded"] = T["capture amount exceeds the amount of the original authorize"],
["authentication_failed"] = T["customer failed 3DS or any other authentication"],
["authentication_expired"] = T["customer didn't complete 3DS or any other authentication in expected time"],
["invalid_card_data"] = T["invalid card details were provided"],
["cancelled_by_customer"] = T["customer cancelled the transaction"],
["cancelled_by_customer"] = T["customer canceled the transaction"],
["blocked_by_issuer"] = T["the transaction was blocked by the issuer"],
["declined_by_issuer"] = T["the transaction was declined by the issuer"],
["insufficient_funds"] = T["customer's account doesn't have enough funds for the payment"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Lombiq.HelpfulLibraries.OrchardCore.Users;
using Lombiq.HelpfulLibraries.OrchardCore.Users;
using Microsoft.Extensions.Logging;
using OrchardCore.Commerce.Models;
using OrchardCore.Commerce.Payment.Stripe.Abstractions;
Expand Down Expand Up @@ -45,7 +45,7 @@ public async Task ReceivedStripeEventAsync(Event stripeEvent)
if (user == null)
{
_logger.LogError(
"User not found for email {Email}, while invoice was payed. Invoice data: {InvoiceData}",
"User not found for email {Email}, while invoice was paid. Invoice data: {InvoiceData}",
invoice.CustomerEmail,
JsonSerializer.Serialize(invoice));
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Stripe;
using Stripe;
using System.Threading;
using System.Threading.Tasks;

namespace OrchardCore.Commerce.Payment.Stripe.Services;

public class DummyCustomerService : CustomerService
{
public const string TestCustomerId = "cus_TESTID00000000"; // #spell-check-ignore-line
public const string TestCustomerId = "cus_TESTID00000000";

public override Customer Create(CustomerCreateOptions options, RequestOptions requestOptions = null) => new();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Stripe;
using Stripe;
using Stripe.Checkout;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -7,7 +7,7 @@ namespace OrchardCore.Commerce.Payment.Stripe.Services;

public class DummySessionService : SessionService
{
public const string TestSessionId = "cs_test_testsessionid000000000000000000000000000000000000000000000"; // #spell-check-ignore-line
public const string TestSessionId = "cs_test_testsessionid000000000000000000000000000000000000000000000";
public const string TestSessionUrl = "https://localhost";

public override Session Create(SessionCreateOptions options, RequestOptions requestOptions = null) => new();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrchardCore.Commerce.Payment.Stripe.Abstractions;
using OrchardCore.Commerce.Payment.Stripe.Abstractions;
using Stripe;

namespace OrchardCore.Commerce.Payment.Stripe.Services;
Expand All @@ -14,5 +14,5 @@ public Event PrepareStripeEvent(
string stripeSignatureHeader,
string secret,
bool throwOnApiVersionMismatch) =>
new() { Id = "evt_exampleEventId0000000000", Type = Type, Data = new EventData { Object = EventDataObject } }; // #spell-check-ignore-line
new() { Id = "evt_exampleEventId0000000000", Type = Type, Data = new EventData { Object = EventDataObject } };
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Stripe;
using Stripe;
using System.Threading;
using System.Threading.Tasks;

namespace OrchardCore.Commerce.Payment.Stripe.Services;

public class DummySubscriptionService : SubscriptionService
{
public const string TestSubscriptionId = "sub_exampleid000000000000000"; // #spell-check-ignore-line
public const string TestSubscriptionId = "sub_exampleid000000000000000";
public static Subscription Subscription { get; set; } = new() { Id = TestSubscriptionId };

public override Subscription Create(SubscriptionCreateOptions options, RequestOptions requestOptions = null) => new();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public interface IPaymentService
public Task<Amount> GetTotalAsync(string? shoppingCartId);

/// <summary>
/// When the order is payed this logic should be run to set <paramref name="order"/> properties that represents its state.
/// When the order is paid this logic should be run to set <paramref name="order"/> properties that represents its state.
/// </summary>
Task FinalModificationOfOrderAsync(ContentItem order, string? shoppingCartId, string? paymentProviderName);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ public static class ContentItemIds
{
public const string TestProduct = "testproduct000";
public const string TestPriceVariantProduct = "testpricevariantproduct000";
public const string TestFreeProduct = "testfreeproduct000"; // #spell-check-ignore-line
public const string TestFreeProduct = "testfreeproduct000";
public const string TestOrder = "testpendingorder0000000000";
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public Task AddressPartsFeatureShouldOverrideRegularCheckout(Browser browser) =>
await context.ClickCheckoutAsync();

var noteBy = By.Name("OrderPart.ShippingAddress.Address.AdditionalFields.NoteForCourier");
var noteText = "Don't take the old passage to Ravenholm. We don't go there anymore."; // #spell-check-ignore-line
var noteText = "Don't take the old passage to Ravenholm. We don't go there anymore.";
await context.ClickAndFillInWithRetriesAsync(noteBy, noteText);
await context.ClickAndFillInWithRetriesAsync(AddressName("GivenName"), "Gordon");
await context.ClickAndFillInWithRetriesAsync(AddressName("FamilyName"), "Freeman");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace OrchardCore.Commerce.Tests.UI.Tests.LocalizedProductTests;

public class LocalizedProductBehaviorTests : UITestBase
{
private const string LocalizedTitle = "Honosított Termék"; // #spell-check-ignore-line
private const string LocalizedTitle = "Honosított Termék";

private static readonly By _localizationsButtonPath = By.XPath(
"//li[contains(@class, 'list-group-item') and .//a[contains(., 'Test Localized Product')]]//div[@title = 'Localizations']//button");
Expand Down Expand Up @@ -64,5 +64,5 @@ await context.SelectFromBootstrapDropdownReliablyAsync(
browser);

private static Task GoToLocalizedProductAsync(UITestContext context) =>
context.GoToAdminRelativeUrlAsync("/Contents/ContentItems?q=Test%20Localized%20Product type%3ALocalizedProduct"); // #spell-check-ignore-line
context.GoToAdminRelativeUrlAsync("/Contents/ContentItems?q=Test%20Localized%20Product type%3ALocalizedProduct");
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ void SetUnitPriceCurrency(int index, string isoCode) => context.ExecuteScript($@
await ClickAddItemAsync(context);

await context.ClickAndFillInWithRetriesAsync(ByQuantity(0), "5");
await context.ClickAndFillInWithRetriesAsync(ByProductSku(0), "nonexistentproduct"); // #spell-check-ignore-line
await context.ClickAndFillInWithRetriesAsync(ByProductSku(0), "nonexistentproduct");
await context.ClickAndFillInWithRetriesAsync(ByUnitPriceValue(0), "10");
await context.ClickPublishAsync();

// Non-existent SKU should result in validation errors being shown and no Product being added.
context.ErrorMessageExists("SKU \"NONEXISTENTPRODUCT\" does not belong to an existing Product."); // #spell-check-ignore-line
context.ErrorMessageExists("SKU \"NONEXISTENTPRODUCT\" does not belong to an existing Product.");

context.Missing(ByQuantity(0));
await ClickAddItemAsync(context);
Expand Down
Loading

0 comments on commit 3e5454d

Please sign in to comment.