Lack of interest "post_complete_transaction" event

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

NikitOS

Well-known member
Licensed customer
Since 2.1.6, there is a postCompleteTransaction method in XF\Purchasable\AbstractPurchasable. However, there may be a need to watch all completed transactions for all Purchasables, for example for sending fiscal receipts to the tax service (not from a payment provider). Extending a class for each Purchasable is inconvenient, since it is impossible to handle for every possible case, so an event like post_complete_transaction would be nice.
 
Upvote 5
This suggestion has been closed. Votes are no longer accepted.
Extending a class for each Purchasable is inconvenient, since it is impossible to handle for every possible case, so an event like post_complete_transaction would be nice.
Certainly inconvenient, but probably not impossible:

You could for example extend XF\Entity\Purchasable::getHandler(), check the purchasable_type_id and if it's unknown auto-generate code for the required class extension and immediately activate this via \XF::extension()->addClassExtension() before calling the parent method.

You could for example extend XF\Entity\Purchasable::getHandler() and check if the returned object implements your interface.
If it does not auto-generate code for the required class extension (probably using a trait), immediately activate this class extension via \XF::extension()->addClassExtension(), create a new object and return it.
 
Last edited:
Back
Top Bottom