I have a menu item for registration created in a menu.
When PayPlans sends a user to register, however, this menu item is not the one triggered.
The menu item is created by specifying com_user as the component and registration as the view, and given "registration" as an alias.
Looking at your code, you seem to build this URL directly and are not passing it through Joomla's router. This will preclude ever using the correct menu item (and Itemid) for registration.
Modifying your code to look like this fixes the problem (line 21 in /administrator/components/com_payplans/includes/registration/adapters/joomla.php):
$this->url = JRoute::_('index.php?option=com_users&view=registration&fromPayplans=1');
This causes the URL to be passed through the router and then generates the correctly-routed URL:
https://www.example.com/registration?fromPayplans=1
Can you fix this?
SECOND QUESTION: While I'm here, if I wrote my own registration adapter, where would I install it so as to not have to re-apply it every time I upgrade?