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
It might be related to TokenProvider in the project.
In the template, it register itself with default name but I found a problem with that logic.
[ExposeServices(typeof(IAccessTokenStore))]
attribute on it and implements ITransientDependency
interface. As the final result it should be something like this:[Volo.Abp.DependencyInjection.Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IAccessTokenStore))]
public class MauiBlazorAccessTokenStore : IAccessTokenStore, ITransientDependency
{
// ...
[ExposeServices(typeof(IAbpAccessTokenProvider))]
attribute on itI attempted to follow the instructions. The error I have is as noted below.
C:\abp reverse tcp:44384 tcp:44384
ABP CLI 7.3.3 Unhandled exception. System.ArgumentException: Option names should start with '-' or '--'. at Volo.Abp.Cli.Args.CommandLineArgumentParser.ParseOptionName(String argument) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Args\CommandLineArgumentParser.cs:line 107 at Volo.Abp.Cli.Args.CommandLineArgumentParser.Parse(String[] args) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Args\CommandLineArgumentParser.cs:line 53 at Volo.Abp.Cli.CliService.RunAsync(String[] args) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\CliService.cs:line 56 at Volo.Abp.Cli.Program.Main(String[] args) in D:\ci\Jenkins\workspace\abp-volo-release\abp\framework\src\Volo.Abp.Cli\Volo\Abp\Cli\Program.cs:line 43 at Volo.Abp.Cli.Program.<Main>(String[] args)
No, it shouldn't be abp it should be adb (android debug bridge) and it's separated tool that is provided by android. You can easily find it in the visual studio in the following menu: Tools > Android > Android Adb Command Prompt
Hi @ageiter
For the BreadCrumbs; When you add LeptonX, it automatically disables breadcrumbs on PageHeader and renders its own breadcrumbs at the top of the page
So, the only way to remove breadcrumbs for leptonx is replacing the Breadcrumbs component so far.
It is Breadcrumbs.razor from the
Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components.ApplicationLayout.Common
namespace You can read how to replace a component on blazor from here
For the MobileMenuSelector:
It seems it's working on the latest release. I just created a new project and add the following configuration from your sample:
Configure<LeptonXThemeBlazorOptions>(options =>
{
options.Layout = LeptonXBlazorLayouts.TopMenu;
options.MobileMenuSelector = items => items.Where(x => x.MenuItem.Name == Support5890Menus.Home);
});
And it rendered only Home page (Same constant from the MenuContributor.)
If there is another specific-case, please share the steps with us
By the way, if you use ngrok or something equivalent, you have to make sure you just changed all the environment variables (appsttings.json) from localhost
to your ngrok url
and make data seeding before launching the AuthServer (if not tiered, HttpApi.Host)
It seems, your project can't access to localhost/127.0.0.1:44321
URL.
If you use Android emulator, make sure you have just executed adb reverse tcp:44321 tcp:44321
command on adb terminal.
Make sure you follow this documentation for each UI: https://docs.abp.io/en/commercial/latest/getting-started-maui#android
Hi, We've just fixed it and it'll be included in the next release