XF 2.0 includes a flexible payment framework which supports Stripe, PayPal, Two Checkout, and Braintree out of the box, plus very easy for developers to add additional providers going forward.
XF 2.0 includes a flexible payment framework which supports Stripe, PayPal, Two Checkout, and Braintree out of the box, plus very easy for developers to add additional providers going forward.
XF 2.0 includes a flexible payment framework which supports Stripe, PayPal, Two Checkout, and Braintree out of the box, plus very easy for developers to add additional providers going forward.
It's a reasonably complex process. You would need to refer to the base implementations. Look at XF\Payment\AbstractProvider and the specific implementations along with the xf_payment_provider table.
It's a fine framework. I've added support for a couple of gateways using it. Takes a bit getting used to, mainly because it's not documented.
It's a bit like hooking into 2FA methods, if I'm to make a comparison. Not too complex, just fairly irritating without documentation. I had to do a bunch of playing around to understand what each of the functions did specifically. Would've been far less painful with documentation. Other than that, they're not too bad to use.
The system is split up into several distinct parts.
There's the payment provider system which is what provides the ability to pay for items using any of the built in providers, e.g. PayPal, Stripe and the provider system is extensible so other developers can add other providers (see this resource for an example).
Then there's the purchasable item system which is the system that the user upgrades stuff is built upon.
The two systems are entirely separate, so theoretically you don't really need to know how the payment provider system works to create new purchasable items.
In lieu of the documentation, which we will work on at some point in the future, I recommend looking into how the user upgrade system works for guidance on how to create new purchasable items.
If you have any questions after this post, please post in the XenForo development discussions forum as this thread isn't the appropriate place for that kind of support.