Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Himmat's avatar
Level 1

Paypal Services

Hello

I was develop one website in that course owner can post his course and other (guest) user can purchase that course.

Here I was implement paypal payment gateway when any user purchase that course. Here every course has some commission that will be get website owner and another amount get course owner Let's course price is 100$ and commission rate is 10$ then final price for course is 110$ so user will be pay 110$

Now here issue is How can i split amount in two paypal account like course commission goes to website owner and actual price will be credited on course owner.

Here also case like user can cancel his booking before 24 hrs of start course If we initial split payment in 2 different account like course owner and website owner in that case if user doing cancel course then difficult to refund full amount

Is there any way we can split amount proper way in 2 different way inside paypal?

Thanks in advance for suggestion !!

0 likes
1 reply
bvfi-dev's avatar

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:

  1. The user pays
  2. Create an order and capture it with PayPal API. Check the status and if it went through.
  3. 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.

Please or to participate in this conversation.