How Would You Integrate a Third-Party Payment API Securely?

Payment integrations are one of the most sensitive parts of a backend application.