alert(\"" . str_replace("\"", "\\\"", $inString) . "\"); \n"; } //----------------------------------------------------------------------------- function handleError( $status, $request, $reply ) //----------------------------------------------------------------------------- { echo "RunTransaction Status: $status\n"; switch ($status) { case CYBS_S_PHP_PARAM_ERROR: printf( "Please check the parameters passed to cybs_run_transaction for correctness.\n" ); break; case CYBS_S_PRE_SEND_ERROR: printf( "The following error occurred before the request could be sent:\n%s\n", $reply[CYBS_SK_ERROR_INFO] ); break; case CYBS_S_SEND_ERROR: printf( "The following error occurred while sending the request:\n%s\n", $reply[CYBS_SK_ERROR_INFO] ); break; case CYBS_S_RECEIVE_ERROR: printf( "The following error occurred while waiting for or retrieving the reply:\n%s\n", $reply[CYBS_SK_ERROR_INFO] ); handleCriticalError( $status, $request, $reply ); break; case CYBS_S_POST_RECEIVE_ERROR: printf( "The following error occurred after receiving and during processing of the reply:\n%s\n", $reply[CYBS_SK_ERROR_INFO] ); handleCriticalError( $status, $request, $reply ); break; case CYBS_S_CRITICAL_SERVER_FAULT: printf( "The server returned a CriticalServerError fault:\n%s\n", getFaultContent( $reply ) ); handleCriticalError( $status, $request, $reply ); break; case CYBS_S_SERVER_FAULT: printf( "The server returned a ServerError fault:\n%s\n", getFaultContent( $reply ) ); break; case CYBS_S_OTHER_FAULT: printf( "The server returned a fault:\n%s\n", getFaultContent( $reply ) ); break; Case CYBS_S_HTTP_ERROR: printf( "An HTTP error occurred:\n%s\nResponse Body:\n%s\n", $reply[CYBS_SK_ERROR_INFO], $reply[CYBS_SK_RAW_REPLY] ); break; } print '
'; } function displayReason( $sReasonCode ) { switch ($sReasonCode) { case '101': print 'The request is missing one or more required fields.'; break; case '102': print 'One or more fields in the request contains invalid data.'; break; case '150': print 'Error: General system failure.'; break; case '151': print 'Error: The request was received but there was a server timeout.'; break; case '152': print 'Error: The request was received, but a service did not finish running in time.'; break; case '201': print 'The issuing bank has questions about the request.'; break; case '202': print 'Expired card.'; break; case '203': print 'General decline of the card. No other information provided by the issuing bank.'; break; case '204': print 'Insufficient funds in the account.'; break; case '205': print 'Stolen or lost card.'; break; case '207': print 'Issuing bank unavailable. Possible action: Wait a few minutes and resend the request.'; break; case '208': print 'Inactive card or card not authorized for card-not-present transactions.'; break; case '210': print 'The card has reached the credit limit.'; break; case '211': print 'Invalid card verification number.'; break; case '231': print 'Invalid account number.'; break; case '232': print 'The card type is not accepted by the payment processor.'; break; case '233': print 'General decline by the processor.'; break; case '234': print 'There is a problem with the merchant configuration.'; break; case '236': print 'Processor failure.'; break; case '238': print 'The authorization has already been captured.'; break; case '240': print 'The card type sent is invalid or does not correlate with the credit card number.'; break; case '250': print 'Error: The request was received, but there was a timeout at the payment processor.'; break; default: return ( '' ); } print '
'; } ?>