Here are sample apps that demonstrate how to integrate your app with the QuickBooks Payments API and OAuth 2.0.
They contain sample code and requests. Review them to get an overall sense of the authentication process.
Even though you plan to only utilize the QuickBooks Payments API, you may also want to check out integration examples for the QuickBooks Online Accounting API: