I think there are open source gateways already, no need to write a new one. It should just be setup during onboarding in the profile.