'') $replyType = 'RAW REPLY: '; else $replyType = "No Reply available."; } $messageToSend = sprintf( "STATUS: %d\nERROR INFO: %s\nREQUEST: \n%s\n%s\n$s\n", nStatus, $reply[CYBS_SK_ERROR_INFO], getArrayContent( $request ), $replyType, $replyText ); // send $messageToSend to the appropriate personnel at your company // using any suitable method, e.g. e-mail, multicast log, etc. // // This sample code simply sends it to standard output. printf( "\nThis is a critical error. Send the following information to the appropriate personnel at your company: \n%s\n", $messageToSend ); } //----------------------------------------------------------------------------- function getFaultContent( $reply ) //----------------------------------------------------------------------------- { $requestID = $reply[CYBS_SK_FAULT_REQUEST_ID]; if ( $requestID == "") $requestID = "(unavailable)"; return( sprintf( "Fault code: %s\nFault string: %s\nRequestID: %s\nFault document: %s", $reply[CYBS_SK_FAULT_CODE], $reply[CYBS_SK_FAULT_STRING], $requestID, $reply[CYBS_SK_FAULT_DOCUMENT] ) ); } //----------------------------------------------------------------------------- function getArrayContent( $arr ) //----------------------------------------------------------------------------- { $content = ''; while (list( $key, $val ) = each( $arr )) { $content = $content . $key . ' => ' . $val . "\n"; } return( $content ); } //----------------------------------------------------------------------------- function getReplyContent( $reply ) { //----------------------------------------------------------------------------- $reasonCode = $reply['reasonCode']; switch ( $reasonCode ) { // Success case '100': return( sprintf( "Request ID: %s\nAuthorizedAmount: %s\nAuthorization Code: %s", $reply['requestID'], $reply['ccAuthReply_amount'], $reply['ccAuthReply_authorizationCode'] ) ); break; ####################################################################### // The request is missing one or more required fields. case '101': $i = 0; $res = ''; // getting missed fileds from response while ( !empty( $reply['missingField_'.$i] ) ) { $res .= $reply['missingField_'.$i] ."\n"; $i++; } return( "Some required fields are missed:\n". $res ); break; ####################################################################### // One or more fields in the request contains invalid data. case '102': $i = 0; $res = ''; // getting missed fileds from response while ( !empty( $reply['invalidField_'.$i] ) ) { $res .= $reply['invalidField_'.$i] ."\n"; $i++; } return( "Following fields contain invalid data:\n". $res ); break; ####################################################################### // Invalid Credit Card Number case '231': return( "The credit card number is declined! Please try different credit card." ); break; ####################################################################### // Expired credit card case '202': return( "This credit card has expired! Please try different credit card." ); break; ####################################################################### // Insufficient funds case '204': return( sprintf( "Insufficient funds in account. Please use a different card or select another form of payment." ) ); break; ####################################################################### // Add other reason codes here that you need to handle // specifically // For all other reason codes, return an empty string, // in which case, you should display a generic message // appropriate to the decision value you received. default: return ( $reasonCode ); break; } } ?> Precious Metals Quote, Gold Prospecting, Mining Stocks, and Investments - InsideMetals.com
  Home About Why Subscribe Subscribe Tutorials What's new FAQ Contact    
 

Suggested Books

Mining Explained published by The Northern Miner 1993. - A popular laymen's guide to mining. Get purchase information at www.northernminer.com.

 

Canadian and American Mines Handbook published annually by The Northern Miner. - Listing of over than 2400 mining companies with company financials, operations, plans, reserves, assets, and more. Get purchase information at www.northernminer.com.

 

Mine Investment Analysis published by the Society of Mining Engineers 1984 - The book teaches mine valuation concepts and procedures. Get purchase information at www.smenet.com.

 

Mining Economics and Strategy published by the Society of Mining Engineers 1998 - The book describes cost-effective mining operations and discusses tools and methods of making economic decisions. Get purchase information at www.smenet.com.

 

Join Our Free Newsletter
Email:
 
 
forgot password?
Username:
Password:
 



NYSE Gold Producers
AMEX Gold Producers
NSDQ Gold Producers
Copyright Insidemetals 2005 Privacy Policy Disclaimer  
Subscribe Now How to Use About Gold Stocks About the Reports