Пример #1
0
?>
  </p>
				<form method="post" action="">
				<button type="button" class="btn btn-default btn-sm"
				data-toggle="modal" data-target="#myModal" id="shippingButton">Select Shipping
				Method</button>
			</div>
		</div>
		<hr
		style="width: 100%; color: black; height: 1px; background-color: black;" />
		<div class="row">
			<div class="col-sm-4"></div>
			<div class="col-sm-4"></div>
			<div class="col-sm-4">
				<p id="ordersTotal">Total: $<?php 
echo orderTotal($uid);
?>
  </p>
			</div>
		</div>

		<div class="row">
			<div class="col-sm-4"></div>
			<div class="col-sm-4"></div>
			<div class="col-sm-4">
				<button type="submit" class="btn btn-default btn-lg"
				id="paymentButton" name="paymentButton">Go For Payment</button>
			</div>
		</div>
</form>
Пример #2
0
            <label class="sr-only" for="state">State</label> <input type="text"
            class="form-control" id="state" placeholder="State">
          </div>
          <div class="form-group">
            <label class="sr-only" for="zip">Zip</label> <input type="text"
            class="form-control" id="zip" placeholder="Zip/PostalCode">
          </div>
        </div>
      </div>
      <div class="row" id="placeTheOrder">
        <button type="submit" class="btn btn-default btn-md" name="orderButton">PLACE
          THE ORDER</button>


          <?php 
$data = array('merchant_email' => '*****@*****.**', 'product_name' => 'Order Price', 'amount' => orderTotal($uid), 'currency_code' => 'USD', 'thanks_page' => "http://" . $_SERVER['HTTP_HOST'] . 'paypal/thank.php', 'notify_url' => "http://" . $_SERVER['HTTP_HOST'] . 'paypal/ipn.php', 'cancel_url' => "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'paypal_mode' => true);
?>
            <br>
            <form id='paypal-info' method='post' action='#'>
              <input type='submit' name='pay_now' id='pay_now' value='Pay with PayPal' />
            </form>

            <?php 
if (isset($_POST['pay_now'])) {
    echo infotutsPaypal($data);
}
function infotutsPaypal($data)
{
    define('SSL_URL', 'https://www.paypal.com/cgi-bin/webscr');
    define('SSL_SAND_URL', 'https://www.sandbox.paypal.com/cgi-bin/webscr');
    $action = '';