Bitcoin Forum

Economy => Marketplace => Topic started by: logansryche on August 21, 2011, 05:56:23 PM



Title: [solved]Simple Form?
Post by: logansryche on August 21, 2011, 05:56:23 PM
Hello folks,

I'm looking to create a form. This form will have 3 input boxes. The first one is for the send from box. The second one is the send to box and the third generates a converted number from the previous page. The point is to send btc to a given address from a given address based on the value in the box, like a simple payment page(ie: the value in the box is 1.2btc and when the user enters their address in the first box, it will auto send 1.2btc from that address to another address while sending the contents of the order to my email and display a thank you/confirmation page). This form also needs to convert a USD total into a BTC total for the 3rd input box from the previous page(which has a checkout form on it). I've tried doing this many times and have given up. If someone out there knows how to do this, I'm all ears.

-Matt


Title: Re: Simple Form?
Post by: logansryche on August 22, 2011, 12:44:30 PM
does no one know how to do this?


Title: Re: Simple Form?
Post by: alkhdaniel on August 22, 2011, 01:14:59 PM
Converting from USD to BTC based on mtgox last price:
Code:
<?php
$opts 
= array(
  
'http'=> array(
    
'method'=>   "GET",
    
'user_agent'=>    "MozillaXYZ/1.0"));
$context stream_context_create($opts);
$json file_get_contents('https://mtgox.com/code/data/ticker.php'false$context);
$json json_decode($json);
//$usd2btc = $valueofbox3 / $json->{'ticker'}->{'last'};
?>


Not really sure what you meant with the rest, please give another example :x


Title: Re: Simple Form?
Post by: arsenische on August 22, 2011, 01:16:22 PM
I am sorry, I didn't get it: why do you need a "send from" box?


Title: Re: Simple Form?
Post by: logansryche on August 22, 2011, 01:46:45 PM
I am sorry, I didn't get it: why do you need a "send from" box?
This is going into my payment page for BitCard. The send from box is where the customer enters their bitcoin address. The send to box would obviously be my bitcoin address. When the customer hits submit, it will automaticaly send the BTC value in the other box from the send from box to the send to box.

Not really sure what you meant with the rest, please give another example :x

Ok. Customer buys some items and clicks the checkout button. It leads them to the page I'm describing. This form has to be able to convert USD(from the previous page) to BTC, send me notification by email of the order while displaying a thank you page. This form also has to have 3 imput boxes. The first one the customer puts their address in, the second one has my adderss in it, and the third one is a value display from the previous page(where the conversion script comes in). Once the customer fills in their address and hits submit, the form has to send that value that's listed in box #3 to my bitcoin address to complete the transaction.


Title: Re: Simple Form?
Post by: arsenische on August 22, 2011, 05:01:01 PM
Once the customer fills in their address and hits submit, the form has to send that value that's listed in box #3 to my bitcoin address to complete the transaction.

The form doesn't have access to customer's wallet and can't send bitcoins from his/her address. It is the customer who can send the money to your address. So, you need just to generate a unique bitcoin address and to ask the customer to send bitcoins there.

You might find it useful to read https://en.bitcoin.it/wiki/Merchant_Howto, https://en.bitcoin.it/wiki/PHP_developer_intro and the linked pages.


Title: Re: Simple Form?
Post by: logansryche on August 22, 2011, 06:25:02 PM
Ok.. I think I sorta get it. Via that wiki I found Bitcoin Payflow, yet still have no idea how to implement this.
I know nothing about php, old school html is all I know.


Title: Re: Simple Form?
Post by: arsenische on August 22, 2011, 07:52:57 PM
Ok.. I think I sorta get it. Via that wiki I found Bitcoin Payflow, yet still have no idea how to implement this.
I know nothing about php, old school html is all I know.

Probably you need a server to run bitcoind and maybe somebody to set it up and implement the desired functionality for you.


Title: Re: Simple Form?
Post by: logansryche on August 22, 2011, 09:07:43 PM
Well there should be a way to set it up to be used with mt gox or bit-bank as i know for a fact bitcoind won't run on my server and think it's a waste of resources to find a server just to run it on. But yes, if someone did come along and make a form for me, I would apprecite it.


Title: Re: Simple Form?
Post by: alkhdaniel on August 22, 2011, 09:38:37 PM
Well there should be a way to set it up to be used with mt gox or bit-bank as i know for a fact bitcoind won't run on my server and think it's a waste of resources to find a server just to run it on. But yes, if someone did come along and make a form for me, I would apprecite it.
Try bit-pay.
https://bit-pay.com/


Title: Re: Simple Form?
Post by: logansryche on August 23, 2011, 02:17:34 AM
Here's hoping that works.. have to wait 24hrs to be accepted
Worth the wait i supose.

-Matt


EDIT: Yup, working with Bit Pay to work with my cart to get BitCard back up and running again. Thanks for the info alkhdaniel. ^.^