Hello DEKUKDEV
I'm checking the problems in the v2.4
Ok, I'll take a look of the source of the problem
Ok, I couldn't reproduce but found the source of the problem, we'll fix it and release a patch version of LeptonX for these.
I've tried both local debug & and Production Release environments and it's working as expected. I need to reproduce to understand the problem.
Can you please share the minimum reproduction steps?
I have a same kind of problem. I have created a "one time payment", when i click "buy" on my page, it redirects me to "mypage.com/Payment/Stripe/PrePayment?paymentRequestId=requestnumbershere" and then it gives me "HTTP Error 500" but when i go to my stripe dashboard, i see the paymentrequest in logs, i can manualy open the link and go there and use my card and the payment is successful. After that i get redirected to my "shop" page.
In web logs i have :
[16:52:42 ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": {}, "validationErrors": null } [16:52:42 ERR] Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Volo.Payment.Stripe.Pages.Payment.Stripe.PrePaymentModel.OnPostAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.NonGenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) [16:52:42 INF] Executed page /Payment/Stripe/PrePayment in 4826.7507ms [16:52:42 INF] Executed endpoint '/Payment/Stripe/PrePayment' [16:52:42 ERR] An unhandled exception has occurred while executing the request. System.NullReferenceException: Object reference not set to an instance of an object. at Volo.Payment.Stripe.Pages.Payment.Stripe.PrePaymentModel.OnPostAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.NonGenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>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.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.Security.AbpSecurityHeadersMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context) [16:52:42 INF] Request finished HTTP/1.1 POST https://localhost:44383/Payment/Stripe/PrePayment?paymentRequestId=5bb159f7-62e9-422d-3f9c-3a0e5a62756d application/x-www-form-urlencoded 182 - 500 - text/html;+charset=utf-8 4838.2090ms
I will also add my ShopController.cs if its any help
[HttpPost] [ActionName("OnPost")] [ValidateAntiForgeryToken] public async Task<IActionResult> OnPostAsync() { var paymentRequest = await _paymentRequestAppService.CreateAsync(new PaymentRequestCreateDto() { Currency = "EUR", Products = new List<PaymentRequestProductCreateDto>() { new PaymentRequestProductCreateDto { Code = "prod_OnDAVUNq44gU1v", Name = "1000 store credits", Count = 1, UnitPrice = 10, TotalPrice = 10 } }, }); return LocalRedirectPreserveMethod("/Payment/GatewaySelection?paymentRequestId=" + paymentRequest.Id); }
Any help is welcome.
It seems there is an error on the PrePaymentModel
class, I'll write back after investigation
Hi,
Why is Paypal not listed as an option.
https://docs.abp.io/en/commercial/latest/modules/payment#subscriptions
Subscription logic supports only Stripe for now. So, this payment plans are for subscription logic. If you configured your Secret Keys in appsettings.json
you can make payments on your application by following Creating One-Time Payment documentation.
Why is it not letting me set a second Gateway Plan
It seems the error doesn't explain well, We'll update the error. But the reason is, you can add gateway plan per a gateway, you can't add 2 different plan from a gateway. Otherwise the subscription logic can't know which one is used while getting paid.
According to the docs, I set up a subscription by handing in a GUID to the PlanId property on PaymentRequestProductCreateDto. How exactly do I get this GUID code side, when the plans are not hard coded? (Your sample lists DemoAppData.Plan_2_Id, which seems to come from nowhere)
You should get a PaymentPlanId from the database and pass it as parameter, it'll automatically use the ExternalSubscriptionId from it. So the External Subscription Id should be a Price Id
or Product Id
from Stripe