Activities of "ageiter"

Here is an excerpt from the log file, I have tried to make as many log messages as possible. But unfortunately I can't see where exactly the exceptions are happening, as this seems to come from your module.

Due to the character limitation in two parts...

Part 1:

2025-01-08 09:49:16.002 +00:00 [INF] PalmaPaymentRequestAppService.CreateAsync, ThreadId='38'
2025-01-08 09:49:16.103 +00:00 [INF] PalmaPaymentRequestAppService.UpdateWithExtraPropertiesAsync: PaymentRequest '9e476206-1f24-2f92-334b-3a17577e5568' updated with extra properties: TenantId='70938969-ef4a-ba91-a4ca-3a16f1add23d', TerminationId='01dfb6ef-fb21-6f9d-8b85-3a16f1af3030', ThreadId='21'
2025-01-08 09:49:16.614 +00:00 [INF] PalmaPaymentRequestAppService.StartAsync, ThreadId='21'
2025-01-08 09:49:17.940 +00:00 [INF] PalmaStripePaymentGateway.StartAsync: Start Stripe request.   PaymentRequest='9e476206-1f24-2f92-334b-3a17577e5568'
2025-01-08 09:49:42.494 +00:00 [INF] PalmaPaymentRequestAppService.HandleWebhookAsync, paymentGateway='stripe', eventType='customer.subscription.created', ThreadId='39'
2025-01-08 09:49:42.505 +00:00 [INF] PalmaStripePaymentGateway.HandleWebhookAsync: Receive Stripe event 'customer.subscription.created' with id 'evt_1QevtRHPiPVaq9xpEy1e75VL'
2025-01-08 09:49:42.511 +00:00 [INF] PalmaStripePaymentGateway.HandleCustomerSubscriptionCreatedAsync: Begin handle Stripe event 'customer.subscription.created' with id 'evt_1QevtRHPiPVaq9xpEy1e75VL'.   Important payload data: SubscriptionId='sub_1QevtLHPiPVaq9xpu4IS2vSf', PaymentRequestId='9e476206-1f24-2f92-334b-3a17577e5568', ThreadId='39'
2025-01-08 09:49:42.653 +00:00 [INF] PalmaPaymentRequestAppService.HandleWebhookAsync, paymentGateway='stripe', eventType='invoice.finalized', ThreadId='39'
2025-01-08 09:49:42.755 +00:00 [INF] PalmaStripePaymentGateway.HandleWebhookAsync: Receive Stripe event 'invoice.finalized' with id 'evt_1QevtRHPiPVaq9xpOSrJK4Kk'
2025-01-08 09:49:42.777 +00:00 [INF] PalmaPaymentRequestAppService.HandleWebhookAsync, paymentGateway='stripe', eventType='checkout.session.completed', ThreadId='38'
2025-01-08 09:49:42.787 +00:00 [INF] PalmaStripePaymentGateway.HandleCustomerSubscriptionCreatedAsync: End handle Stripe event 'customer.subscription.created'.   Payment request updated with ExternalSubscriptionId='sub_1QevtLHPiPVaq9xpu4IS2vSf', ThreadId='39'
2025-01-08 09:49:42.804 +00:00 [INF] PalmaStripePaymentGateway.HandleWebhookAsync: Receive Stripe event 'checkout.session.completed' with id 'evt_1QevtRHPiPVaq9xp7aJCb7vy'
2025-01-08 09:49:42.819 +00:00 [WRN] PalmaStripePaymentGateway.HandleCheckoutSessionCompletedAsync: Unhandled Stripe event 'checkout.session.completed' with id 'evt_1QevtRHPiPVaq9xp7aJCb7vy'
2025-01-08 09:49:42.814 +00:00 [INF] PalmaStripePaymentGateway.HandleInvoiceAsync: Begin handle Stripe event 'invoice.finalized' with id 'evt_1QevtRHPiPVaq9xpOSrJK4Kk'.   Important payload data: SubscriptionId='sub_1QevtLHPiPVaq9xpu4IS2vSf', PaymentRequestId='9e476206-1f24-2f92-334b-3a17577e5568', InvoiceId='in_1QevtL***', CustomerName='Buyer Paypal', CustomerEmail='buyer.paypal@***', AmountDue='12000', AmountPaid='0', AmountRemaining=='12000', InvoiceUrl='https://invoice.stripe.com/i/a***', ThreadId='39'
2025-01-08 09:49:42.883 +00:00 [INF] PalmaStripePaymentGateway.UpdatePaymentRequestWithExtraPropertiesAsync: Add extra properties to PaymentRequest '9e476206-1f24-2f92-334b-3a17577e5568': ExternalCustomerName='Buyer Paypal', ExternalCustomerEmailAddress='buyer.paypal@***', AmountDue='12000', AmountPaid='0', AmountRemaining='12000', InvoiceUrl='https://invoice.stripe.com/i/a***', ThreadId='39'
2025-01-08 09:49:42.894 +00:00 [INF] PalmaStripePaymentGateway.HandleInvoiceAsync: End handle Stripe event 'invoice.finalized'.   Payment request updated with invoice data, ThreadId='39'
2025-01-08 09:49:42.922 +00:00 [INF] PalmaPaymentRequestAppService.HandleWebhookAsync, paymentGateway='stripe', eventType='invoice.payment_succeeded', ThreadId='38'
2025-01-08 09:49:42.963 +00:00 [INF] PalmaStripePaymentGateway.HandleWebhookAsync: Receive Stripe event 'invoice.payment_succeeded' with id 'evt_1QevtSHPiPVaq9xpu6c9BDJ2'
2025-01-08 09:49:42.974 +00:00 [INF] PalmaStripePaymentGateway.HandleInvoiceAsync: Begin handle Stripe event 'invoice.payment_succeeded' with id 'evt_1QevtSHPiPVaq9xpu6c9BDJ2'.   Important payload data: SubscriptionId='sub_1QevtLHPiPVaq9xpu4IS2vSf', PaymentRequestId='9e476206-1f24-2f92-334b-3a17577e5568', InvoiceId='in_1QevtLHPiPVaq9xpj9VPg1w0', CustomerName='Buyer Paypal', CustomerEmail='buyer.paypal@***', AmountDue='12000', AmountPaid='12000', AmountRemaining=='0', InvoiceUrl='https://invoice.stripe.com/i/a***', ThreadId='38'
2025-01-08 09:49:43.023 +00:00 [INF] PalmaPaymentRequestAppService.HandleWebhookAsync, paymentGateway='stripe', eventType='customer.subscription.updated', ThreadId='39'
2025-01-08 09:49:43.027 +00:00 [INF] PalmaStripePaymentGateway.HandleWebhookAsync: Receive Stripe event 'customer.subscription.updated' with id 'evt_1QevtSHPiPVaq9xpIZFViU7N'
2025-01-08 09:49:43.219 +00:00 [INF] PalmaStripePaymentGateway.UpdatePaymentRequestWithExtraPropertiesAsync: Add extra properties to PaymentRequest '9e476206-1f24-2f92-334b-3a17577e5568': ExternalCustomerName='Buyer Paypal', ExternalCustomerEmailAddress='buyer.paypal@***', AmountDue='12000', AmountPaid='12000', AmountRemaining='0', InvoiceUrl='https://invoice.stripe.com/i/a***', ThreadId='39'
2025-01-08 09:49:43.221 +00:00 [INF] PalmaStripePaymentGateway.HandleInvoiceAsync: End handle Stripe event 'invoice.payment_succeeded'.   Payment request updated with invoice data, ThreadId='39'
  • ABP Framework version: v8.2.2
  • UI Type: Blazor Server
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no

We use the PaymentModule for payment processing via Stripe. Because we want to store various additional information (e.g. about the invoice) in the payment request, we have derived from the StripePaymentGateway and overwritten the CompleteAsync & HandleWebhookAsync methods, for example.

Now we always have concurrency exceptions because the PaymentModule in the PaymentRequestAppService probably also updates the PaymentRequest at the same time.

We have secured our methods with a semaphore so that the processing of our webhook events is synchronized and they cannot access the PaymentRequest at the same time. I have the code from your StripePaymentRequestGateway and we have overwritten all the corresponding methods there, so no relevant code is executed there.

But what happens in your PaymentRequestAppService is still a black box for us.

  1. could you provide me with the code? Preferably from the whole PaymentModule, if that is not possible, then at least from the PaymentRequestAppService.

  2. how should the problem be solved from your point of view? If you send events to the distributed event bus in the app service, then I won't be able to synchronize this with my own event processing, will I?

Thanks, Adrian

You can publish an event in PalmaTenantDatabaseMigrationHandler

Ah yes, that's it. Thank you!

Ok, I've seen the problem. It's because my TenantEventHandler was called first and then PalmaTenantDatabaseMigrationHandler, which creates the admin user.

Probably you can't specify a order?

I would simply prefer to have my logic in a separate EventHandler, as there are also further steps (sending mail etc.) which have nothing to do with database migration...

    public async Task HandleEventAsync(TenantCreatedEto eventData)
    {
        await MigrateAndSeedForTenantAsync(
            eventData.Id,
            eventData.Properties.GetOrDefault("AdminEmail") ?? PalmaConsts.AdminEmailDefaultValue,
            eventData.Properties.GetOrDefault("AdminPassword") ?? PalmaConsts.AdminPasswordDefaultValue
        );

        using (_currentTenant.Change(eventData.Id))
        {
            // Set admin user as confirmed
            var adminUser = await _userManager.FindByEmailAsync(PalmaConsts.AdminEmailDefaultValue);
            if (adminUser != null)
            {
                adminUser.SetEmailConfirmed(true);
                await _userManager.UpdateAsync(adminUser);
            }
        }
    }

Another problem: After creating the tenant (TenantAppService.CreateAsync), I would like to change something about the user. But it seems that the user is not yet in the database. It is not (yet) found...

Is the transaction only completed after all EventHandlers have been handled? Or is this a timing problem?

public class TenantEventHandler : IDistributedEventHandler<TenantCreatedEto>, ITransientDependency
{
    private readonly IdentityUserManager _userManager;
    private readonly ICurrentTenant _currentTenant;

    public TenantEventHandler(IdentityUserManager userManager, ICurrentTenant currentTenant)
    {
        _userManager = userManager;
        _currentTenant = currentTenant;
    }

    public async Task HandleEventAsync(TenantCreatedEto eventData)
    {
        using (_currentTenant.Change(eventData.Id))
        {
            // Set admin user as confirmed
            var adminUser = await _userManager.FindByEmailAsync(PalmaConsts.AdminEmailDefaultValue);
            if (adminUser != null)
            {
                adminUser.SetEmailConfirmed(true);
                await _userManager.UpdateAsync(adminUser);
            }
        }
    }

[AllowAnonymous] works, thank you for the hint.

I am using version 8.2.2... maybe it's already fixed in 8.3?

maybe you can try

It's not that important to me, I just wanted to make a contribution to improving ABP.

My next problem: The tenant should be created automatically when a customer registers. Now, of course, I have a problem with the permissions, as certain rights are required to create a tenant and an anonymous user cannot have these.

I have already extended the TenantAppService and the CreateAsync method, but the permissions are taken from the base class.

How can I achieve my goal?

You don't need to extend TenantAppService, you can use data seeder.: https://abp.io/docs/latest/framework/infrastructure/data-seeding

Thank you, that worked.

Not yet definitely. We have to wait for a few decisions from the customer and I would therefore like to leave the question open so that we can ask again later if necessary.

This is easy to reproduce: Revoke a user's rights to the sessions. But he still has the rights for user management. Then click in actions menu to the item "Sessions". Popup opens, but the data cannot be loaded due to missing authorizations. Because the error is not caught, the popup cannot be closed and the page must be reloaded.

i could not reproduce the problem

Ok... These are the permissions on the role:

I am using version 8.2.2... maybe it's already fixed in 8.3?

Showing 91 to 100 of 335 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.