Both the website owner and the course owner need PayPal business. The way you do it is with APIs. Unfortunately, this is no simple task. Basically the way it works, is you need to set up the API with tokens and authentication. Then you put a button for the user to click and pay and you handle the API work. The workflow would look something like:
- The user pays
- Create an order and capture it with PayPal API. Check the status and if it went through.
- Create a batch payout that will send money to 2 items in the "items" array, one to the website owner, one for the course owner Id seriously recommend going through the PayPal API. Give the PayPal api docs a read from the beginning, to try and familiarize yourself with the process and everything is explained there. Plus they already have a couple of guides, regarding refund, so give that a read as well. You also need to make additional checks and make some queue jobs and its basically a whole learning process. Make a PayPal Business Sandbox, download Postman, set up your app and good luck, because If you dont try you wont know how it works.