Payment gateway problem

Hello everyone, so is there a way to add logic to paypal ? We created a website and we need when a client buy something, 30% of the money should go into one account and the other 70% in another account. how can we achieve this ? do we need to create our own payment gateway ?