Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: BitCPrincess on January 17, 2015, 02:54:06 AM



Title: Payment Options - Send to multiple addresses
Post by: BitCPrincess on January 17, 2015, 02:54:06 AM
Hello,

Our business is in the process of accepting Bitcoin, We would however like to have the Bitcoin sent to multiple addresses once the customer sends their funds.

For example...

customers sends 1.2 BTC to newly created address (N ADDRESS)

Once sent

0.7 goes to (X ADDRESS)
0.5 goes to (Y ADDRESS)

Is there a way to do this or any payment processor we can go with?

I know this is most likely a simple solution but we have no real experience using Bitcoin technology only what we have read and what one of our "Technical" guys personal experience is with it.

Thanks for any help.

BitCPrincess


Title: Re: Payment Options - Send to multiple addresses
Post by: Muhammed Zakir on January 17, 2015, 07:25:20 AM
I haven't used but I think Coinsplit.io is good for splitting the BTC or you can create a BTC-forwarding script, something like this:

Quote from: bitcoin.stackexchange.com/questions/12280/how-automatically-to-forward-bitcoins-from-one-address-to-another
You may use /etc/crontab on your Ubuntu:

Code:
* * * * * root /bin/bash /usr/local/bin/bitcoin_resender

And script shall looks like:

Code:
$ cat /usr/local/bin/bitcoin_resender
#!/bin/bash
if [ $(echo "$(bitcoind getbalance) > 0" | bc) -eq 1 ];then
      bitcoind sendtoaddress YOUR_NEW_ADDRESS $(bitcoind getbalance) "Comment for resender"
fi

It will check every minutes your bitcoind balance and resend each bitcoins to YOUR_NEW_ADDRESS.

Your probably need to check the fee.

You can also use Bitcoind for this too.

References:

1) Automated payment system (https://bitcointalk.org/index.php?topic=445261.0)
2) Original Bitcoin client/API calls list (https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list)
3) API reference (JSON-RPC) (https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29)

   ~~MZ~~