Author

Topic: Integrating Auto Recieiving for Purchases for Payment release (Read 699 times)

legendary
Activity: 1442
Merit: 1186
So you want to set up an escrow system? That's what it sounds like to me.

Are you building from scratch? How much customization are you able to do with your e-commerce platform?

If you can build from scratch set it up in bitcoind with JSON RPC, you can prune it so you don't have to store the full blockchain. The biggest inconvenience is waiting for it to sync, which isn't so bad these days, the one I set up on digitalocean last month took less than 24 hours.

I'd just create a simple user/member system that assigns each user a specific address when they sign up.

something like
Code:
//new user registers
$userid = uniqid();
$addy = $bitcoin->getnewaddress();
$newuser = "INSERT INTO users
               (`USERID`, `USERNAME`, `PASSWORD`, `DEPOSIT_ADDRESS` ...etc

Seller posts something for sale and specifies a receiving/withdrawal address, buyer clicks to buy, and they send bitcoins to the deposit address which is an address that YOU control specifically.

Upon receipt notify the seller to deliver the item. You can use walletnotify in your bitcoin.conf to monitor for new transactions.

The details of this transaction will be logged in your database so the user can go back later to verify they received the item.
Once they receive the item they return to the site, click the "I received it" button and it will pull the amount of the sale from your database where you can then fire a sendtoaddress() via JSON RPC to send the funds to an address that the seller specifies (not their deposit address, an address they own and control).  Then mark the transaction as complete in your database.

Code:
//user clicks received it button
$checkAddy = $bitcoin->validateaddress($withdrawalAddress);
$isValid = $checkAddy['isvalid'];
if(!$isValid){
$message = "Address is invalid";
} else {
//process withdrawal
$withdrawal = $bitcoin->sendtoaddress($withdrawalAddress, $transactionAmount);
$message = "Transaction: ".$withdrawal."
";
        }

That would be the basics of it at least. You would need to figure out how you will handle disputes and stuff like that. Or you could do it using a 3rd party API like blocktrail, or blockchain.info.
newbie
Activity: 14
Merit: 0
Do you mean like to a BIP32 HD wallet, or to a static wallet address of the seller?

There definitely is a way..
newbie
Activity: 4
Merit: 0
Hello

Anyone know how we could implement a system on our ecommerce platform that allows users to provide confirmation of a purchase being delivered and then the bitcoins are sent automatically from our Bitcoin wallet to the seller?

How we want it to work is the purchaser pays via bitcoin and the seller delivers the goods. Upon the purchaser receiving the good he then notifies our site and then the purchase amount is sent from our wallet to the seller automatically.

I am sure there is a way as we have seen other sites doing the same thing.

Also if the cost is not too much we wold be happy to pay someone to complete this if they have expereince in setting up something such as this. Also in our other post we also have setup our own Bitcoin Core server as we wish to not use any third party payment processors and use our own servers to complete transactions. This PHP script does what we need from payments https://gourl.io/bitcoin-payment-gateway-api.html  but we do not want to use their API and use our own Bitcoin core server..... If someone knows how to set this up we would love to chat and work out how much something like this would cost to setup.
Jump to: