fralazar Posted July 15, 2015 Share Posted July 15, 2015 Anyone facing this error?: PHP Fatal error: Class 'WHMCS\\Invoice' not found in /xxx/includes/gatewayfunctions.php on line 0 gatewayfunctions.php is supposed to be included in the callback as stated here http://docs.whmcs.com/Gateway_Module_Developer_Docs Regards. 0 Quote Link to comment Share on other sites More sharing options...
hajim2000 Posted July 18, 2015 Share Posted July 18, 2015 Hi Fralazar, This error indicates that your module needs updating for compatibility with v6.0. The dbconnect.php file referenced in the error message was depreciated back in v5.2 and finally removed in v6.0. The module will need updating to use init.php instead. Please contact the vendor of the module for an update to their code. 0 Quote Link to comment Share on other sites More sharing options...
fralazar Posted July 27, 2015 Author Share Posted July 27, 2015 Hajim thanks for your answer. Contacted support and they told me the same and sent me the updated callback used in the SDK. <?php use WHMCS\Module\Gateway; use WHMCS\Terminus; /** @type WHMCS\Application $whmcs */ # Required File Includes include "../../../init.php"; include ROOTDIR . DIRECTORY_SEPARATOR . 'includes/functions.php'; include ROOTDIR . DIRECTORY_SEPARATOR . 'includes/gatewayfunctions.php'; include ROOTDIR . DIRECTORY_SEPARATOR . 'includes/invoicefunctions.php'; $gatewayModule = 'gateway'; # Enter your gateway module name here replacing template /** * Ensure that the module is active before attempting to run any code */ $gateway = new Gateway(); if (!$gateway->isActiveGateway($gatewayModule) || !$gateway->load($gatewayModule)) { Terminus::getInstance()->doDie('Module not Active'); } $GATEWAY = $gateway->getParams(); $status = $whmcs->get_req_var('x_response_code'); $invoiceId = $whmcs->get_req_var('x_invoice_num'); $transactionId = $whmcs->get_req_var('x_trans_id'); $amount = $whmcs->get_req_var('x_amount'); $fee = $whmcs->get_req_var('x_fee'); /** * Check the invoice id is valid or die */ $invoiceId = checkCbInvoiceID($invoiceId, $GATEWAY["name"]); /** * Check transaction Id is unique or die */ checkCbTransID($transactionId); if ($status=="1") { /** * Successful payment. * Apply Payment to Invoice: invoiceId, transactionId, amount paid, fees, moduleName */ addInvoicePayment( $invoiceId, $transactionId, $amount, $fee, $gatewayModule ); /** * Save log entry to the Gateway Log. Name, data (as array) and status */ logTransaction( $GATEWAY["name"], $_POST, "Successful" ); } else { /** * Unsuccessful payment. * Save log entry to the Gateway Log. Name, data (as array) and status */ logTransaction( $GATEWAY["name"], $_POST, "Unsuccessful" ); } Working fine now. Regards. 0 Quote Link to comment Share on other sites More sharing options...
Heaven Posted August 7, 2015 Share Posted August 7, 2015 Thank you fralazar!!! Do you have also the new templante model used in the SDK? - - - Updated - - - Thank you fralazar!!! Do you have also the new templante model used in the SDK? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.