One thing I noticed about your PayPal REST implementation is you can simplify the setup for XenForo sites. Specifically, you can use an API call to create/update the necessary webhook events being listened for (and also capturing the Webhook ID).
This is really all you need to do (this is my payment profile for PayPal REST, so ignore some of the stuff about Platform App blah blah):
[ATTACH=full]300961[/ATTACH]
In my implementation, the "magic" happens within verifyConfig()
in the payment profile.
[code=php]$webhook = $payPalRepo->createWebhookIfNeeded('', [], $tokenInfo['access_token']);
$options['webhook_id'] = $webhook['id'];[/code]
The createWebhookIfNeeded()
method reads what events are there, and updates/creates as needed.
Anyway, just a thought if you wanted to make it easier for XenForo license holders (and also probably less support tickets for people needing support).