Nullable object must have a value in RenderPaymentFormAsync
Hello,
Getting an odd error on Umbraco Cloud where going through the checkout process I get an error on the payment form page. Locally though this works fine. I even connected to the cloud database locally and it works fine too.
Umbraco 11.0
Vendr 3.0.5
Here is the error message
System.InvalidOperationException: Nullable object must have a value.
at Vendr.Infrastructure.Resiliency.PollyExecutionStrategyBase.ExecuteAsync[TResult](Func`2 operation, Func`2 verifySucceeded, CancellationToken cancellationToken)
at Vendr.Core.VendrUnitOfWorkProvider.ExecuteAsync[T](IUnitOfWorkOptions options, Func`3 action, CancellationToken cancellationToken)
at Vendr.Extensions.HtmlHelperExtensions.RenderPaymentFormAsync(IHtmlHelper htmlHelper, OrderReadOnly order, IDictionary`2 htmlAttributes, IOrderService orderService, IPaymentMethodService paymentMethodService, IPaymentProviderService paymentProviderService, PaymentProviderContextFactory paymentProviderContextFactory, IOrderNumberGenerator orderNumberGenerator, IUnitOfWorkProvider uowProvider, IMembershipHelper membershipHelper, CancellationToken cancellationToken)
at AspNetCoreGeneratedDocument.Views_Shared_CheckoutPaymentForm.ExecuteAsync() in C:\home\site\repository\src\Umbraco\Views\Shared\CheckoutPaymentForm.cshtml:line 14
Best I could think would be to log some info out in your CheckoutPaymentForm.cshtml file and see what if any of the params passed to the RenderPaymentFormAsync method are null 🤔
I've added a log of the order to JSON to see if something is not set etc and compared between local order and cloud order they look how they should with only Guids like order id and datetimes being different. Though Tax and the decimals used are different for some reason
here is the json of the order from cloud if you can see anything i'm missing
After pull out the code from the helper into my own file and adding logging to like every line to figure out where in the process it was failing. Ended up finding an weird issue with a GetUri() method call in our payment provider GenerateFormAsync() method that doesn't work on cloud but work locally.
Nullable object must have a value in RenderPaymentFormAsync
Hello,
Getting an odd error on Umbraco Cloud where going through the checkout process I get an error on the payment form page. Locally though this works fine. I even connected to the cloud database locally and it works fine too.
Umbraco 11.0
Vendr 3.0.5
Here is the error message
Any ideas?
Thanks
Best I could think would be to log some info out in your
CheckoutPaymentForm.cshtml
file and see what if any of the params passed to theRenderPaymentFormAsync
method are null 🤔So i'm using the
BeginPaymentFormAsync
helper method like soI've added a log of the order to JSON to see if something is not set etc and compared between local order and cloud order they look how they should with only Guids like order id and datetimes being different. Though Tax and the decimals used are different for some reason
here is the json of the order from cloud if you can see anything i'm missing
Thanks
Looks ok to me. Do you have your root node with it's store picker set correctly?
Yep store is set and previous pages in the checkout flow for customer info, shipping and review etc steps work as intended.
I'm struggling to think what to suggest really, without knowing what it thinks is null it's pretty hard to debug 🤔
After pull out the code from the helper into my own file and adding logging to like every line to figure out where in the process it was failing. Ended up finding an weird issue with a
GetUri()
method call in our payment providerGenerateFormAsync()
method that doesn't work on cloud but work locally.Made some changes and its work now.
Thanks for the help though
Nice debugging. There is no way I could have narrowed that one down, so glad you were able to find a solution 👍
is working on a reply...