tommyinnn Posted October 19, 2009 Share Posted October 19, 2009 I've been working on a Plimus gateway mod, and wondered if any1 has a sample callback file they could post (any gateway) , or provide a screenshot of their coding, callback URL, or any help with this.... I don't need your complete code, just enough to help me figure out what i'm doing wrong. I have a active post at http://forum.whmcs.com/showthread.php?t=2180&highlight=plimus but it's not really going anywhere...thanks for any help any1 can give, I've been working on this for ever and a day & am so close to getting it to work! 0 Quote Link to comment Share on other sites More sharing options...
tommyinnn Posted October 24, 2009 Author Share Posted October 24, 2009 bump!!!! Still need some help with this --- anybody!!! 0 Quote Link to comment Share on other sites More sharing options...
niels Posted December 17, 2009 Share Posted December 17, 2009 I have this working for me now, though only for single payments. I did not yet look into recurring ones. Had to change the callback file a little - still not perfect but at least it works now: # 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"]; if( $amount <= 4.99) $fee = 0.75; if(($amount >= 5.00) && ($amount <= 8.99)) $fee = round(($amount*0.150),2); if(($amount >= 9.00) && ($amount <= 49.99)) $fee = round(($amount*0.100),2); if(($amount >= 50.00) && ($amount <= 59.99)) $fee = round(($amount*0.090),2); if(($amount >= 60.00) && ($amount <= 79.99)) $fee = round(($amount*0.080),2); if(($amount >= 80.00) && ($amount <= 99.99)) $fee = round(($amount*0.070),2); if(($amount >= 100.00) && ($amount <= 139.99)) $fee = round(($amount*0.060),2); if(($amount >= 140.00) && ($amount <= 279.99)) $fee = round(($amount*0.050),2); if($amount >= 280.00) $fee = round(($amount*0.045),2); $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.