Sorry for being a bit wet behind the ears when it comes to PHP and Stripe, but i guess we all have to start somewhere.
I have set a payment page up with stripe all working fine when the card details are correct and it is authorised. This issue i have got is when the card is declined or there are issues with the details. All that i get is a blank white screen and i don't know how to handle to the errors.
so i guess would someone be so kind as to help.
Thanks and code below;
Main Index.php page
<!-- STRIPE -->
<div class="payment">
<div class="title">
<div class="copy">
<h2>Deposit Payment</h2>
<p>Please fill out the following form.</p>
</div>
</div>
<?php require_once('inc/config.php'); ?>
<form action="inc/charge.php" method="post">
<input type="text" name="business" placeholder="Advertiser Name">
<input type="text" name="email" placeholder="Advertiser Email">
<input type="text" name="hotel" placeholder="Hotel Name">
<div class="two-blocks">
<select class="small" id="currency">
<option value="gbp">Great British Pounds</option>
</select>
<input type="text" class="small" id="price" name="price" placeholder="£500.00">
</div>
<script src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="<?php echo $stripe['publishable_key']; ?>"
data-currency="GBP"
data-label="Submit"
data-name="Guest Services Worldwide"
data-image="http://www.itsjoeturner.com/pay/wallet.png"
data-description="Advertising Deposit Payment"
data-allow-remember-me="false">
</script>
</form>
</div>
<!-- // STRIPE -->
charge.php
<?php
require_once('config.php');
$token = $_POST['stripeToken'];
$business = $_POST['business'];
$email = $_POST['email'];
$hotel = $_POST['hotel'];
$currency = $_POST['currency'];
$price = $_POST['price'];
$price .= "00";
$customer = Stripe_Customer::create(array(
'email' => $email,
'card' => $token,
'description' => "Business Name: ".$business.""
));
$charge = Stripe_Charge::create(array(
'customer' => $customer->id,
'amount' => $price,
'currency' => 'gbp',
));
header( 'Location: http://gswportal.co.uk/payments/thanks.html' ) ;
?>