Hi Guys, Can someone please help me. I have following PHP code that works fine. The only issue I am facing is, if there is a payment thats not sucessfull I just get a blank screen, and do not receive error on the screen. However the error is dispalyed in execption, I just can catch it.
CODE:
<?PHP
require './lib/Stripe.php';
$ccnum=$_GET['ccNum'];
$ccmon=$_GET['ccExpMo'];
$ccyr=$_GET['ccExpYr'];
$amount=$_GET['amt'];
$jobid=$_GET['JobId'];
$multiply=100;
$amountcents=$amount*$multiply;
$cvc=172;
$description='something';
if(isset($_POST)) {
Stripe::setApiKey("stripe_key_here");
$payment = Stripe_Charge::create(array(
'amount' => $amountcents,
'currency' => 'gbp',
'card' => array(
'number'=> $ccnum,
'exp_month' => $ccmon,
'exp_year'=> $ccyr,
'name'=> 'some name',
'cvc'=> $cvc),
'description' => $description)); }
print_r($payment);
?>
Following is the error (or any other error) which I cant seem to catch as an execption.
error:
message: "Your card has insufficient funds."
type: "card_error"
code: "card_declined"
charge: ch_12asdasweAAFdgooXDUd2tvKJgW
Thanks a lot again for any advise. Regards,