daily pastebin goal
79%
SHARE
TWEET

tinyStore Item Page

a guest Mar 14th, 2015 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $url = "https://btc-e.com/api/2/btc_usd/ticker";
  4. $json = json_decode(file_get_contents($url), true);
  5. $price = $json["ticker"]["last"];
  6. $usdPrice = 30; // SET THE PRICE OF THE ITEM HERE
  7. $calc = $usdPrice / $price;
  8. $itemPrice = round($calc, 4);
  9. require("yourEmail.php");
  10. $emailTitle = "New Purchase";
  11. $productName = "Wizard Spoon"; // ENTER IN PRODUCT NAME
  12.  
  13. if(isset($_POST['submit'])){
  14.         $email = $_POST['email'];
  15.         $name = $_POST['name'];
  16.         $street = $_POST['street'];
  17.         $city = $_POST['city'];
  18.         $state = $_POST['state'];
  19.         $zip = $_POST['zip'];
  20.  
  21.         //CREATE UNIQUE BITCOIN ADDRESS FOR PAYMENT
  22.         require("blockChn.php");
  23.         $new_address = "https://blockchain.info/merchant/$id/new_address?password=$pw";
  24.  
  25.         $json_new_addr = json_decode(file_get_contents($new_address), true);
  26.         $display_address = $json_new_addr["address"];
  27.  
  28.         $body = <<<EOD
  29.         <h1>New Purchase</h1>
  30.         Item Purchased: $productName <br>
  31.         Email: $email <br>
  32.         Name: $name <br>
  33.         Street: $street <br>
  34.         City: $city <br>
  35.         State: $state <br>
  36.         Zip: $zip <br>
  37.         Payment Address: $display_address <br>
  38.         Payment Amount: $itemPrice <br>
  39. EOD;
  40.  
  41.         $headers = "From: sales@btcthreads.com" ."\r\n";
  42.         $headers .= "Content-type: text/html\r\n";
  43.         $success = mail("$yourEmail", "$emailTitle", "$body", "$headers");
  44.         $message = '<div id="pmsg">Thank you for your order! There is only one more step!<br>Please send ' . $itemPrice . ' to ' . $display_address . '<br>We have emailed you this information if you have to pay later.</div>';
  45.          
  46.         $custEmail = <<<EOD
  47.         <h3>Please send payment to finalize your purchase</h3>
  48.         Payment Address: $display_address <br>
  49.         Payment Amount: $itemPrice <br>
  50.         Item Purchased: $productName <br>
  51.         Email: $email <br>
  52.         Name: $name <br>
  53.         Street: $street <br>
  54.         City: $city <br>
  55.         State: $state <br>
  56.         Zip: $zip <br>        
  57. EOD;
  58.         $customerCopy = mail($email, "Wooden Spoons Purchase", $custEmail, $headers);
  59. }
  60.  
  61. ?>
  62.  
  63. <html>
  64. <head>
  65. <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Pacifico">
  66. <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Ubuntu">
  67. <style>
  68. html {
  69.         font-family: "Ubuntu";
  70. }
  71.  
  72. #header {
  73.         background-color: #4E84D5;
  74.         height: 95px;
  75.         width: 100%;
  76.         font-family: "Ubuntu";
  77.         color: #ffffff;
  78. }
  79.  
  80. #storeName {
  81.         margin-left: 100px;
  82.         font-family: "Pacifico";
  83.         color: #ffffff;
  84.         font-size: 38px;
  85. }
  86.  
  87. #buy {
  88.         background-color: #7A85AD;
  89.         height: 55px;
  90.         width: 250px;
  91.         border-radius: 4px;
  92.         text-shadow: 1px 1px #666666;
  93.         border: 2px solid #47D1FF;
  94.         font-family: Calibri;
  95.         color: #ffffff;
  96.         font-size: 26px;
  97. }
  98.  
  99. #finpay {
  100.         background-color: #7A85AD;
  101.         height: 55px;
  102.         width: 250px;
  103.         border-radius: 4px;
  104.         text-shadow: 1px 1px #666666;
  105.         border: 2px solid #EE3B3B;
  106.         font-family: Calibri;
  107.         color: #ffffff;
  108.         font-size: 26px;
  109. }
  110.  
  111. #pmsg {
  112.         background-color: #7A85AD;
  113.         height: 100px;
  114.         width: 650px;
  115.         border-radius: 4px;
  116.         text-shadow: 1px 1px #666666;
  117.         border: 2px solid #EE3B3B;
  118.         font-family: Calibri;
  119.         color: #ffffff;
  120.         font-size: 20px;
  121. }
  122.  
  123. #itpr {
  124.         text-shadow: 1px 1px #666666;
  125.         font-family: Calibri;
  126.         font-size: 24px;
  127. }
  128.  
  129. p {
  130.         border: 2px solid #cccccc;
  131.         width: 650px;
  132. }
  133.  
  134. .fw{
  135.         height: 55px;
  136.         width: 650px;
  137.         font-size: 26px;
  138.         font-family: Calibri;
  139.         border-radius: 4px;
  140.         border: 2px solid #cccccc;
  141. }
  142. .cty{
  143.         height: 55px;
  144.         width: 300px;
  145.         font-size: 26px;
  146.         font-family: Calibri;
  147.         border-radius: 4px;
  148.         border: 2px solid #cccccc;
  149. }
  150. .ste{
  151.         height: 56px;
  152.         width: 90px;
  153.         font-size: 26px;
  154.         font-family: Calibri;
  155.         border-radius: 4px;
  156.         border: 2px solid #cccccc;
  157. }
  158. .zip{
  159.         height: 55px;
  160.         width: 250px;
  161.         font-size: 26px;
  162.         font-family: Calibri;
  163.         border-radius: 4px;
  164.         border: 2px solid #cccccc;
  165. }
  166. </style>
  167. <script>
  168. function resettoggle() {
  169. var e = document.getElementById('buyForm');
  170. e.style.display = 'none';
  171. }
  172.  
  173. function toggle_visibility(id) {
  174. var e = document.getElementById('buyForm');
  175. if(e.style.display == 'none')
  176. e.style.display = 'block';
  177. else
  178. e.style.display = 'none';
  179. }
  180. </script>
  181. </head>
  182. <body onLoad="resettoggle()">
  183. <table id="header">
  184. <tr>
  185.         <td><span id="storeName">Tiny Bitcoin Store</span></td>
  186. </tr>
  187. </table>
  188. <h2><?php echo $productName; ?></h2>
  189. <table>
  190. <tr>
  191. <td>
  192. <img src="images/wizard.jpg">
  193. </td>
  194. <td><span id="itpr">Price: $<?php echo $usdPrice; ?><br> &#3647;<?php echo $itemPrice; ?></span>
  195. </td>
  196. </table>
  197. <?php echo $message; ?>
  198. <button id="buy" onclick="toggle_visibility('buyForm');">ORDER</button><br>
  199. <div id="buyForm">
  200. <form method="post">
  201. <input type="email" name="email" class="fw" placeholder="your@email.com"><br>
  202. <input type="text" name="name" class="fw" placeholder="Full Name"><br>
  203. <input type="text" name="street" class="fw" placeholder="Address"><br>
  204. <input type="text" name="city" class="cty" placeholder="City">
  205. <select name="state" class="ste">
  206. <option value="AK">AK</option>
  207.   <option value="AL">AL</option>
  208.   <option value="AR">AR</option>
  209.   <option value="AZ">AZ</option>
  210.   <option value="CA">CA</option>
  211.   <option value="CO">CO</option>
  212.   <option value="CT">CT</option>
  213.   <option value="DC">DC</option>
  214.   <option value="DE">DE</option>
  215.   <option value="FL">FL</option>
  216.   <option value="GA">GA</option>
  217.   <option value="HI">HI</option>
  218.   <option value="IA">IA</option>
  219.   <option value="ID">ID</option>
  220.   <option value="IL">IL</option>
  221.   <option value="IN">IN</option>
  222.   <option value="KS">KS</option>
  223.   <option value="KY">KY</option>
  224.   <option value="LA">LA</option>
  225.   <option value="MA">MA</option>
  226.   <option value="MD">MD</option>
  227.   <option value="ME">ME</option>
  228.   <option value="MI">MI</option>
  229.   <option value="MN">MN</option>
  230.   <option value="MO">MO</option>
  231.   <option value="MS">MS</option>
  232.   <option value="MT">MT</option>
  233.   <option value="NC">NC</option>
  234.   <option value="ND">ND</option>
  235.   <option value="NE">NE</option>
  236.   <option value="NH">NH</option>
  237.   <option value="NJ">NJ</option>
  238.   <option value="NM">NM</option>
  239.   <option value="NV">NV</option>
  240.   <option value="NY">NY</option>
  241.   <option value="OH">OH</option>
  242.   <option value="OK">OK</option>
  243.   <option value="OR">OR</option>
  244.   <option value="PA">PA</option>
  245.   <option value="RI">RI</option>
  246.   <option value="SC">SC</option>
  247.   <option value="SD">SD</option>
  248.   <option value="TN">TN</option>
  249.   <option value="TX">TX</option>
  250.   <option value="UT">UT</option>
  251.   <option value="VA">VA</option>
  252.   <option value="VT">VT</option>
  253.   <option value="WA">WA</option>
  254.   <option value="WI">WI</option>
  255.   <option value="WV">WV</option>
  256.   <option value="WY">WY</option>
  257. </select>
  258. <input type="text" name="zip" class="zip" placeholder="Zip"><br>
  259. <input type="submit" name="submit" id="finpay" value="FINISH &amp; PAY">
  260. </form>
  261. </div>
  262. <p>Description of the item goes here. The Enchanted Spoon was carved by hand and coated with
  263. special shaman herbs. It looks and smells great! You can use it to eat soup or just display it on a shelf.
  264. Pay with bitcoin today!</p>
  265. <br>
  266. </body>
  267. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top