Repository navigation
Recurring payments: My account tab and order links (slice 4 of 5) - #1078
Merged
Merged
Conversation
added 5 commits
November 21, 2026 12:42
…ecurring payments tab
Comment on lines
+31
to
+35
| catch (Exception ex) | ||
| { | ||
| logService.LogError(ex, "UpgradeProcess - RecurringPaymentCustomerIndex (2.5)"); | ||
| return false; | ||
| } |
added 2 commits
November 21, 2026 13:55
…nt checks - A customer cancelling a Cancelled or Completed recurring payment is refused instead of told it was cancelled - A registered customer without an e-mail cancels under their id rather than failing - The initial order links the Recurring payments tab only in the store the order was placed in - The navigation asks whether a recurring payment exists in one query - The customer index covers the tab's newest-first sort
…ments tab setting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type: feature
Issue
Slices 1–3 (#1075, #1076, #1077) record a recurring payment, react to what the gateway reports and can cancel it, but a customer has no way to see or cancel one. On the order details page nothing links a cycle order to the order the customer placed.
This is slice 4 of 5 of recurring payments (payments roadmap P5): the storefront. The Admin and Store screens are slice 5.
Solution
My account → Recurring payments
New
RecurringPaymentController(List,Cancel), shaped likeOrderApprovalController. Both actions require a registered customer, andCancelis a POST with antiforgery (fromBasePublicController).Listis built byGetRecurringPaymentsHandler. Each row shows:TotalCyclesis 0);Paging works like the approvals list (10 per page, at most 50). Orders and products are read in one batch per page. A missing or deleted initial order still gets a row, with no link and no products.
Cancelloads the recurring payment and refuses it unless it belongs to the current customer and the current store. A missing id, someone else's payment and another store's payment all get the same message. Otherwise it sends the existingCancelRecurringPaymentCommandwith the customer's e-mail asCancelledBy.A gateway refusal is logged as a warning, and the customer sees a fixed message. The provider's text never reaches the customer. Nor does
LastError: aPastDuerow shows a fixed hint.The tab is controlled by a new
CustomerSettings.HideRecurringPaymentsTab(Admin and Store → Settings → Customer). It is shown only to a customer who has at least one recurring payment in the current store, so shops that sell nothing in cycles get no empty tab. That check is one query withpageSize: 1on a new index; a switched-off tab runs no query.A customer sees only their own recurring payments.
RecurringPaymenthas noOwnerId, so a company owner does not see a sub-account's.Order details
Cycle text
RecurringCycleText.ResourceKey(Grand.Business.Core) picksRecurringPayment.Cycle.Monthor...Monthsand so on. Every period's enum resource is plural, which is what made "Every 1 Months".Persisted data
CustomerId_StoreIdindex onRecurringPayment: in the installer, and inMigrationRecurringPaymentCustomerIndex(2.5).DefaultLanguage.xmlanden_250.xml. They includeEnums.Grand.Domain.Orders.RecurringPaymentStatus.*, which slice 5 will reuse.Breaking changes
IRecurringPaymentServicegainsGetCustomerRecurringPayments. This only affects custom implementations of the service.GetNavigationHandlerandGetOrderDetailsHandlertake one more constructor argument.Testing
Automated:
dotnet build GrandNode.slnx→ 0 errors.Grand.Web.Tests649/649,Grand.Business.Checkout.Tests1082/1082.The new tests cover:
E2E on a throwaway installation (Mongo, sample data, Playwright). No shipped provider charges in cycles yet, so a temporary controller (not part of this PR) inserted initial orders, their recurring payments and a cycle order:
/account/recurringpaymentsdirectly shows "You have no recurring payments."/account/info.