webtalk Posted October 4, 2010 Share Posted October 4, 2010 Hello, I was using plimus integration perfect till now, I bought a customized solution from a developer. the option of whmcs automatic account creation after the succesful payment has stopped now, as whmcs still shows the payment status as unpaid. I can see the payment gateway logs as succesful but still whmcs show the transaction as unpaid and hence accounts cannot be created automatically. can some one help me in this issue. The code I am using is two file placed Plimus.php in http://yourdomain/Your_WHMCS/modules/gateways/ # Set the Gateway Variables $GATEWAYMODULE = array( "Plimusname" => "Plimus", "Plimusvisiblename" => "Plimus (For Credit Cards,Paypal,Wire Transfer etc)", "Plimustype" => "Invoices", # Invoices or CC ); function Plimus_activate() { global $GATEWAYMODULE; definegatewayfield ('Plimus', 'text', 'contractid', '', 'Contract ID', '20', ' Contract ID of the Product'); } function Plimus_link($params) { $gatewayusername = $params['username']; $gatewaytestmode = $params['testmode']; $invoiceid = $params['invoiceid']; $description = $params["description"]; $amount = $params['amount']; $duedate = $params['duedate']; $firstname = $params['clientdetails']['firstname']; $lastname = $params['clientdetails']['lastname']; $email = $params['clientdetails']['email']; $address1 = $params['clientdetails']['address1']; $address2 = $params['clientdetails']['address2']; $city = $params['clientdetails']['city']; $state = $params['clientdetails']['state']; $postcode = $params['clientdetails']['postcode']; $country = $params['clientdetails']['country']; $phone = $params['clientdetails']['phone']; $companyname = $params['companyname']; $systemurl = $params['systemurl']; $currency = $params['currency']; $code = '<form action="https://www.plimus.com/jsp/buynow.jsp" method="GET"> <input type=hidden name=referrer value='.$invoiceid.'> <input type=hidden name=contractId value='.$params['contractid'].'> <input type=hidden name=quantity value=1> <input type=hidden name=overridePrice value='.$amount.'> <input type=hidden name=currency value=USD> <input type="submit" value="Pay Now" /> </form>'; return $code; } ?> Plimus1.php to http://yourdomain/Your_WHMCS/modules/gateways/callback Plimus1.php in http://yourdomain/Your_WHMCS/modules/gateways/callback if ($_POST['testMode']=="Y") { } else { include '../../../dbconnect.php'; $silent = 'true'; include '../../../includes/functions.php'; include '../../../includes/gatewayfunctions.php'; include '../../../includes/invoicefunctions.php'; $debugreport = ''; foreach ($_POST as $k => $v) { $debugreport .= ('' . $k . ' => ' . $v . ' '); } if ($_POST['transactionType']=="DECLINE" || $_POST['transactionType']=="CANCEL") {} else { addinvoicepayment ($_POST['referrer'], $_POST['referenceNumber'], $_POST['contractPrice'], '', 'Plimus'); logtransaction ('Plimus', $debugreport, 'Successful'); header ('HTTP/1.1 200 OK'); header ('Status: 200 OK'); } } ?> This code works perfectly in whmcs to recieve payments through plimus. The recent problem I got is unable to create auto account as payment status remains unpaid in whmcs despite of the fact payment gateway logs shows as succesful. I have contacted plimus, but they are too lazy to respond. any help would be greatly appreciated. 0 Quote Link to comment Share on other sites More sharing options...
lupael Posted February 9, 2012 Share Posted February 9, 2012 Hello, You can try by replacing your Callback codes <?php # Required File Includes include("../../../dbconnect.php"); include("../../../includes/functions.php"); include("../../../includes/gatewayfunctions.php"); include("../../../includes/invoicefunctions.php"); $gatewaymodule = "plimus"; # Enter your gateway module name here replacing template $GATEWAY = getGatewayVariables($gatewaymodule); if (!$GATEWAY["type"]) die("Module Not Activated"); # Checks gateway module is active before accepting callback # Get Returned Variables $status = $_POST["transactionType"]; $invoiceid = $_POST["invoiceid"]; $transid = $_POST["referenceNumber"]; $amount = $_POST["amount"]; $clientfees = $_POST["clientfees"]; if ($clientfees == "No") { if ($amount <= 4.99) { $fee = 0.75; } elseif ($amount <= 8.99) { $fee = $amount * 0.15; } elseif ($amount <= 49.99) { $fee = $amount * 0.10; } elseif ($amount <= 59.99) { $fee = $amount * 0.09; } elseif ($amount <= 79.99) { $fee = $amount * 0.08; } elseif ($amount <= 99.99) { $fee = $amount * 0.07; } elseif ($amount <= 139.99) { $fee = $amount * 0.06; } elseif ($amount <= 279.99) { $fee = $amount * 0.05; } elseif ($amount >= 280) { $fee = $amount * 0.045; } $fee = round($fee , 2) ; } else { if ($amount <= 4.99) { $amount = $amount - 0.75 ; } elseif ($amount <= 8.99) { $amount = $amount * 0.85 ; } elseif ($amount <= 49.99) { $amount = $amount * 0.90 ; } elseif ($amount <= 59.99) { $amount = $amount * 0.91 ; } elseif ($amount <= 79.99) { $amount = $amount * 0.92 ; } elseif ($amount <= 99.99) { $amount = $amount * 0.93 ; } elseif ($amount <= 139.99) { $amount = $amount * 0.94 ; } elseif ($amount <= 279.99) { $amount = $amount * 0.95 ; } elseif ($amount >= 280) { $amount = $amount * 0.955 ; } $amount = round($amount , 2); $fee = 0 ; } $invoiceid = checkCbInvoiceID($invoiceid,$GATEWAY["name"]); # Checks invoice ID is a valid invoice number or ends processing checkCbTransID($transid); # Checks transaction number isn't already in the database and ends processing if it does if ($status=="CHARGE") { # Successful addInvoicePayment($invoiceid,$transid,$amount,$fee,$gatewaymodule); logTransaction($GATEWAY["name"],$_POST,"Successful"); } else { # Unsuccessful logTransaction($GATEWAY["name"],$_POST,"Unsuccessful"); } ?> 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.