Paypal Payment improvements and flow problems

I’m going to use the Paypal payment plugin and I extended it successfully to add the Paypal fees to the total paid by participants (configurable by admins). During the test phase I got a problem on the payment flow and I try to explain:

after the payment on Paypal, and returning to the merchant page (indico…) if paypal didn’t yet did the POST to finalize the transaction (file, class RHPaypalIPN, method _process) where at last there is the call to register_transaction, user browser is redirected to the payment page (same file, class RHPaypalSuccess, method _process) showing the flash message and below the payment not done yet which is confusing. Reloading the page after the POST from Paypal, obviously prints out a “green” page all ok, payment done.
I think that the right solution should be that the RHPaypalSuccess/_process() should check periodically (maybe until a timeout) if the transaction it’s effectively registered before sending the last redirect, so after the execution of the RHPaypalIPN/_process(), but I was unable (my fault surely) to inspect the transaction registration, always I got “None” when checking self.registration.transaction.
The hyper strange to me thing it’s that if Paypal POST it’s superfast and the transaction got registered before my browser execute the redirect, the value of self.registration.transaction contains the right data.
Where I’m wrong ?
I would like to share our improvements on this plugin with the community when the test phase end ok.

Dear indico plugins maintainer, the changes to the paypal plugin for enhancing wih the added paypal fees and the bugfix for the asynchronous response from paypal were finished and tested successfully. I solved my “coding problems” by cherrypicking from some other posts in this forum.
Which is the preferred way of sharing these code changes ?
Why the italian language it’s not in the indico-plugins distribution (or I’m wrong)?

GitHub pull request

Probably we simply haven’t fetched the updated translations since the Italian translation was complete enough to be included in Indico itself.

The pull request should be there. HTH