Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRITICAL - PaymentFormAsync partial broken for recurring (subscription) orders #614

Closed
marlonscloud opened this issue Jan 31, 2025 · 8 comments
Assignees
Labels
bug Something isn't working state/sprint-candidate

Comments

@marlonscloud
Copy link

marlonscloud commented Jan 31, 2025

Describe the bug
The "review order" page, as given by the demo store, with the latest version of Umbraco 13, is now broken.

Steps To Reproduce
Add something to your cart that has "isRecurring" set to true, clock through to the review order page

Expected behavior
Expect it to work

Additional context
The view calls using (await Html.BeginPaymentFormAsync(Model.Order))

And gets the exception

Umbraco.Commerce.Infrastructure.Resiliency.PollyExecutionStrategyBase.ExecuteAsync(Func<CancellationToken, Task> operation, Func<CancellationToken, Task<ExecutionResult>> verifySucceeded, CancellationToken cancellationToken)

I note that the ORDER NUMBER is null on the model passsed into that view

Umbraco Commerce version:
Latest 13


This item has been added to our backlog AB#48494

@marlonscloud marlonscloud added the bug Something isn't working label Jan 31, 2025
@marlonscloud marlonscloud changed the title CRITICAL - PaymentFormAsync partial broken CRITICAL - PaymentFormAsync partial broken for recurring (subscription) orders Jan 31, 2025
@mattbrailsford
Copy link
Contributor

Please show the entire stack trace

@marlonscloud
Copy link
Author

@mattbrailsford System.NullReferenceException: Object reference not set to an instance of an object.
at Umbraco.Commerce.Infrastructure.Resiliency.PollyExecutionStrategyBase.ExecuteAsync[TResult](Func2 operation, Func2 verifySucceeded, CancellationToken cancellationToken)
at Umbraco.Commerce.Core.UmbracoCommerceUnitOfWorkProvider.ExecuteAsync[T](IUnitOfWorkOptions options, Func3 action, CancellationToken cancellationToken) at Umbraco.Commerce.Extensions.HtmlHelperExtensions.RenderPaymentFormAsync(IHtmlHelper htmlHelper, OrderReadOnly order, IDictionary2 htmlAttributes, IOrderService orderService, IPaymentMethodService paymentMethodService, IPaymentProviderService paymentProviderService, PaymentProviderContextFactory paymentProviderContextFactory, IOrderNumberGenerator orderNumberGenerator, IUnitOfWorkProvider uowProvider, IMembershipHelper membershipHelper, CancellationToken cancellationToken)
at AspNetCore.Views_CheckoutReviewPage.ExecuteAsync() in C:\Users\Yoshimoto\Documents\Repos\umbraco-go\umbraco-core-12-vue\Views\CheckoutReviewPage.cshtml:line 17
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable1 statusCode) at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable1 statusCode)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ActionContext actionContext, IView view, ViewDataDictionary viewData, ITempDataDictionary tempData, String contentType, Nullable`1 statusCode)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewResultExecutor.ExecuteAsync(ActionContext context, ViewResult result)
at Microsoft.AspNetCore.Mvc.ViewResult.ExecuteResultAsync(ActionContext context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|28_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Umbraco.Cms.Web.Common.Middleware.BasicAuthenticationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Umbraco.Cms.Web.BackOffice.Middleware.BackOfficeExternalLoginProviderErrorMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 112
at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Umbraco.Cms.Web.Common.Middleware.PreviewAuthenticationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestLoggingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry)
at Umbraco.Commerce.Cms.Web.Mvc.UmbracoCommerceRequestBufferingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>c__DisplayClass2_0.<b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

@marlonscloud
Copy link
Author

@mattbrailsford I have followed ALL of the steps on here: https://docs.umbraco.com/umbraco-commerce-payment-providers/stripe/how-to-guides/processing-subscription-payments

And the review order, nor the payment forms render IF you set an item to isRecurring

Why didn't you include subscriptions as a proper integration? I've spent so many hours on this, that I honestly don't think the license is worth it at this point

@mattbrailsford
Copy link
Contributor

@marlonscloud subscriptions are a feature of payment providers that implement it, hence why it's within the Stripe docs.

@umbracotrd can you see if you can replicate this using UC v13 and the Stripe payment provider

@marlonscloud
Copy link
Author

Hi again @mattbrailsford basically, it happens whenever isRecurring is set to true, that's the bug. So following this guide https://docs.umbraco.com/umbraco-commerce-payment-providers/stripe/how-to-guides/processing-subscription-payments

Does not work, i.e. an exception is thrown as described above just by setting that prop to true in the backoffice

@mattbrailsford
Copy link
Contributor

Thanks @marlonscloud we'll get this setup and tested to make sure we can replicate it and get back to you 👍

@mattbrailsford
Copy link
Contributor

mattbrailsford commented Feb 3, 2025

@marlonscloud Can you confirm if you have configured a stripePriceId or a stripeRecurringInterval and stripeRecurringIntervalCount combination as one of those is required and I can only get the error you report if these are missing.

Also, can you provide a screenshot of your store settings Product Property Aliases field.

@mattbrailsford
Copy link
Contributor

Closing as can't replicate and no response on questions. Feel free to re-open if this is still an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working state/sprint-candidate
Projects
None yet
Development

No branches or pull requests

3 participants