diff --git a/PHP/create_order.php b/PHP/create_order.php index c0af7f2a..f85f7ff7 100644 --- a/PHP/create_order.php +++ b/PHP/create_order.php @@ -1,4 +1,4 @@ -getMessage(); } -if ($resultObj->ErrorCode==0){ //success when ErrorCode = 0 +if (isset($resultObj->ErrorCode) && $resultObj->ErrorCode==0){ //success when ErrorCode = 0 $orderId = $resultObj->OrderCode; echo 'Your Order Code is: '. $orderId.''; echo '

'; echo 'To simulate a successfull payment, use the credit card 4111 1111 1111 1111, with a valid expiration date and 111 as CVV2.'; echo '
Make Payment'; -} - -else{ +} elseif (!isset($resultObj->ErrorCode)){ + $output = 'The following error occured: ' . $resultObj->Message; +} else{ echo 'The following error occured: ' . $resultObj->ErrorText; }