Payment system integration

Hey bubblers, how can a payment system be integrated that works like Fiverr platform with stripe and bubble API where a commission is charged based on user role( 10 percent on seller and 20 percent on buyer) how can this be done effectively

You can not charge a commission to the buyer in the same way you can to a seller, since the buyer pays and the seller is who receives the money, less that commission.

If you want to take the price the seller sets, and charge 20% more to the buyer, than simply multiple the seller set rate by 1.2 and charge that to the buyer, but when you do that, the 10% you want to charge to the seller is going to be higher than it should be by about 20%.

If seller says $100 and you charge $120 and then set the app fee rate at 10%, it will take 10% of the $120, so your seller gets charged $12 instead of the $10 they should be.

One way to avoid that is to do the necessary math when you set the amount charged as app fee since when you perform the API call to initiate the transaction you need to set the app fee as a numerical value, not a percentage.