So I'd like to integrate paypal into my rails app using active merchant. In this app, users are signing up for courses that other users are teaching and users need to be able to pay each other in order to take the course.
My problem is that I need to take a percentage of each transaction that occurs.
So should I have all of the transactions paid to my merchant account and then pay each user individually? That seems crazy unless there's a way to automate it. Is there maybe a way that I can transfer user payments between each other but take a percentage out as the intermediary? If so how could I do that?
Really stuck here so any help would be appreciated.