How do I set-up this workflow? Membership form with Payment > Discourse Invite

We have some dev talent. Is there example code or documentation, though, that perhaps another discourse forum uses, that we can borrow from?