views:

89

answers:

3

I am helping a startup business to launch and I will be building or finding a shopping cart software for its website. There will only be one product for sale, but anytime someone buys a product, I have to use customer information like their zipcode and which distributor they bought from to calculate commissions that will go to the different distributors. All the incoming money will be sent to one sort of escrow account for a few weeks, and after that few weeks is over, I need to be able to "throw the switch" and cause each of the 20,000 distributors to get their rightful share of that escrow account, depending on the data stored that reflects their sales activity and commissions due. Is this something I can write a script to handle? Better yet, is this something an inexpensive or open source solution can handle, or something that can be setup in something like Paypal? Or is a better approach to somehow create a webpage where each distributor can login to and see their commissions due and initiate the account transfer on their own, but the web app restrict them from transferring more than what they're due?

Thanks

A: 

Based upon your writeup, a script sounds like a great idea if the intention is that these transfers should be fully-automated. Is there any benefit for a distributor to login to a webpage to initiate a transfer? Unless there is something else they would be doing on the site, you are probably better off just going with an automated solution, at least for the first version of this service.

Justin Ethier
+2  A: 

Commissions are a sensitive and complex problem. I wouldn't view it in this way, because I'd be worried about it being too simplistic.

I'd build it into the solution so the distributions can be persisted in a database. You'll want to have excellent auditing and tracking facilities, in case there are problems that cause a distributor to sue you.

You'll want to have the rounding rules well established and tested.

I'd set up a cron job or scheduled task that could read the database and perform the account deposits. I assume you're going to encrypt all this sensitive data.

I'd have a look at Eric Evans' "Domain Driven Design". He's got a nice chapter on dividing financial pies like this one.

duffymo
A: 

I ended up deciding to go with Direct Deposit with a local bank to set these mass transactions up. It will cost way less than going with Paypal's mass transactions in the longrun. (0.15$ fee per transaction is much better than 2% fee per transaction for the big transactions)

Dylan West