Aeterno
Member-
Posts
9 -
Joined
-
Last visited
About Aeterno
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Aeterno's Achievements
Junior Member (1/3)
0
Reputation
-
For WHMCS V7.10 it would be under header.tpl for search domain. {if $registerdomainenabled || $transferdomainenabled} <h2>{$LANG.homebegin}</h2> <form method="post" action="domainchecker.php" id="frmDomainHomepage"> <input type="hidden" name="transfer" /> <div class="row"> <div class="col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1"> <div class="input-group input-group-lg"> <input type="text" class="form-control" name="domain" placeholder="{$LANG.exampledomain}" autocapitalize="none" data-toggle="tooltip" data-placement="left" data-trigger="manual" title="{lang key='orderForm.required'}" /> <span class="input-group-btn"> {if $registerdomainenabled} <input type="submit" class="btn search{$captcha->getButtonClass($captchaForm)}" value="{$LANG.search}" /> {/if} {if $transferdomainenabled} <input type="submit" id="btnTransfer" class="btn transfer{$captcha->getButtonClass($captchaForm)}" value="{$LANG.domainstransfer}" /> {/if} </span> </div> </div> </div> {include file="$template/includes/captcha.tpl"} </form> {else} <h2>{$LANG.doToday}</h2> {/if} </div> </section> <div class="home-shortcuts"> <div class="container"> <div class="row"> <div class="col-md-4 hidden-sm hidden-xs text-center"> <p class="lead"> {$LANG.howcanwehelp} </p> </div> <div class="col-sm-12 col-md-8"> <ul> {if $registerdomainenabled || $transferdomainenabled} <li> <a id="btnBuyADomain" href="domainchecker.php"> <i class="fas fa-globe"></i> <p> {$LANG.buyadomain} <span>»</span> </p> </a> </li> {/if} <li> <a id="btnOrderHosting" href="cart.php"> <i class="far fa-hdd"></i> <p> {$LANG.orderhosting} <span>»</span> </p> </a> </li> <li> <a id="btnMakePayment" href="clientarea.php"> <i class="fas fa-credit-card"></i> <p> {$LANG.makepayment} <span>»</span> </p> </a> </li> <li> <a id="btnGetSupport" href="submitticket.php"> <i class="far fa-envelope"></i> <p> {$LANG.getsupport} <span>»</span> </p> </a> </li> </ul> </div> </div> </div> </div> {/if}
-
Any help from forum member for this issue ?
-
Error: Gateway Module "Gateway_notify" Not Activated
Aeterno replied to Aeterno's topic in Developer Corner
Never mind I found how to solve this issue -
Indeed I also faced same issue like yours. So the $returnUrl
-
As my experience please check your $returnUrl
-
HELP I coded a gateway module but now I need to make a callback file as I don't really feel like manually accepting my clients orders and would really love some help Below is my callback file: <?php /** * WHMCS Sample Payment Callback File * * This sample file demonstrates how a payment gateway callback should be * handled within WHMCS. * * It demonstrates verifying that the payment gateway module is active, * validating an Invoice ID, checking for the existence of a Transaction ID, * Logging the Transaction for debugging and Adding Payment to an Invoice. * * For more information, please refer to the online documentation. * * @see https://developers.whmcs.com/payment-gateways/callbacks/ * * @copyright Copyright (c) WHMCS Limited 2017 * @license http://www.whmcs.com/license/ WHMCS Eula */ // Require libraries needed for gateway module functions. require_once __DIR__ . '/../../../init.php'; require_once __DIR__ . '/../../../includes/gatewayfunctions.php'; require_once __DIR__ . '/../../../includes/invoicefunctions.php'; // Detect module name from filename. $gatewayModuleName = basename(__FILE__, '.php'); // Fetch gateway configuration parameters. $gatewayParams = getGatewayVariables($gatewayModuleName); // Die if module is not active. if (!$gatewayParams['type']) { die("Module Not Activated"); } // Retrieve data returned in payment gateway callback // Varies per payment gateway $invoiceId = $_REQUEST['invoiceid']; $TRANSIDMERCHANT = $_POST['TRANSIDMERCHANT']; $STATUSTYPE = $_POST["STATUSTYPE"]; $APPROVALCODE = $_POST["APPROVALCODE"]; $transactionId = $_POST["TRANSIDMERCHANT"]; $paymentAmount = $_POST["AMOUNT"]; $PAYMENTCODE = $_POST["PAYMENTCODE"]; $SESSIONID = $_POST["SESSIONID"]; $BANK = $_POST["BANK"]; $MCN = $_POST["MCN"]; $MTIME = date("YmdHms"); $PAYMENTDATETIME = $_POST['PAYMENTDATETIME']; $VERIFYID = $_POST["VERIFYID"]; $VERIFYSCORE = $_POST["VERIFYSCORE"]; $VERIFYSTATUS = $_POST["VERIFYSTATUS"]; $CURRENCY = '360'; $PURCHASECURRENCY = '360'; $BRAND = $_POST["BRAND"]; $CHNAME = $_POST["CHNAME"]; $THREEDSECURESTATUS = $_POST["THREEDSECURESTATUS"]; $EDUSTATUS = 'NA'; $WORDS = $_POST['WORDS']; $TRANSIDMERCHANT = $_POST['TRANSIDMERCHANT']; $RESULTMSG = $_POST['RESULTMSG']; $transactionStatus = $success ? 'Success' : 'Failure'; /** * Validate callback authenticity. * * Most payment gateways provide a method of verifying that a callback * originated from them. In the case of our example here, this is achieved by * way of a shared secret which is used to build and compare a hash. */ $SHARED_KEY = $gatewayParams['SHARED_KEY']; $MALLID = $gatewayParams['MALLID']; if ($hash != md5($SHARED_KEY . $MALLID . $paymentAmount . $secretKey)) { $transactionStatus = 'Hash Verification Failure'; $success = false; } /** * Validate Callback Invoice ID. * * Checks invoice ID is a valid invoice number. Note it will count an * invoice in any status as valid. * * Performs a die upon encountering an invalid Invoice ID. * * Returns a normalised invoice ID. * * @param int $invoiceId Invoice ID * @param string $gatewayName Gateway Name */ //$invoiceId = $_POST[''] $invoiceId = checkCbInvoiceID($invoiceid, $gatewayParams['name']); /** * Check Callback Transaction ID. * * Performs a check for any existing transactions with the same given * transaction number. * * Performs a die upon encountering a duplicate. * * @param string $transactionId Unique Transaction ID */ checkCbTransID($transactionId); /** * Log Transaction. * * Add an entry to the Gateway Log for debugging purposes. * * The debug data can be a string or an array. In the case of an * array it will be * * @param string $gatewayName Display label * @param string|array $debugData Data to log * @param string $transactionStatus Status */ logTransaction($gatewayParams['name'], $_POST, $transactionStatus); if ($success) { /** * Add Invoice Payment. * * Applies a payment transaction entry to the given invoice ID. * * @param int $invoiceId Invoice ID * @param string $transactionId Transaction ID * @param float $paymentAmount Amount paid (defaults to full balance) * @param float $paymentFee Payment fee (optional) * @param string $gatewayModule Gateway module name */ addInvoicePayment( $invoiceId, $transactionId, $paymentAmount, $paymentFee, $gatewayModuleName ); } Now here is the data my gateway sends to my server on the billing log: PAYMENTDATETIME => 20170821115510 PURCHASECURRENCY => 360 LIABILITY => MERCHANT PAYMENTCHANNEL => 15 AMOUNT => 5000000.00 MCN => 411111******1111 WORDS => faa7f1ab7a7c26e7b8fb5181a682c04f9d61c280 RESULTMSG => SUCCESS TRANSIDMERCHANT => d36c2cb81590da675450721952c6a9aee0b759d8 BANK => Bank Mandiri STATUSTYPE => P APPROVALCODE => 499010 EDUSTATUS => NA THREEDSECURESTATUS => FALSE VERIFYSCORE => -1 CURRENCY => 360 RESPONSECODE => 0000 CHNAME => Mountain Vibe BRAND => VISA VERIFYSTATUS => NA SESSIONID => 0af7d79e7aa47a8a0ee67961e3d4ccb8
-
Hello everyone, I got an error for the gateway module callback from Payment Gateway below: border: solid 1px #999; padding: 5px; background-color: #d9edf7; } </style> </head> <body> <div class="error-container"> <h1>Oops!</h1> <h2>Something went wrong and we couldn't process your request.</h2> <p>Please go back to the previous page and try again.</p> <p>Error: Gateway Module "Gateway_notify" Not Activated</p></div> </body> </html> And this the callback <?php /** * DOKU Hosted Payment Callback File * * This sample file demonstrates how a payment gateway callback should be * handled within WHMCS. * * It demonstrates verifying that the payment gateway module is active, * validating an Invoice ID, checking for the existence of a Transaction ID, * Logging the Transaction for debugging and Adding Payment to an Invoice. * * For more information, please refer to the online documentation. * * @see https://developers.whmcs.com/payment-gateways/callbacks/ * * @copyright Copyright (c) WHMCS Limited 2017 * @license http://www.whmcs.com/license/ WHMCS Eula */ // Require libraries needed for gateway module functions. require_once __DIR__ . '/../../../init.php'; require_once __DIR__ . '/../../../includes/gatewayfunctions.php'; require_once __DIR__ . '/../../../includes/invoicefunctions.php'; $$moduleName = $gatewayModuleName; // Detect module name from filename. $gatewayModuleName = basename(__FILE__, '.php'); // Fetch gateway configuration parameters. $gatewayParams = getGatewayVariables($gatewayModuleName); // Die if module is not active. if (!$gatewayParams['type']) { die("Module Not Activated"); } $order_id = checkCbInvoiceID($order_id, $gatewayParams['name']); //$success = false; if ($RESPONSECODE == '0000' && DOKUhosted::validateTransaction($TRANSIDMERCHANT, $BASKET, $WORDS)) { $success = true; } else { $success = false; } if ($success) { /** * Add Invoice Payment. * * Applies a payment transaction entry to the given invoice ID. * * @param int $invoiceId Invoice ID * @param string $transactionId Transaction ID * @param float $paymentAmount Amount paid (defaults to full balance) * @param float $paymentFee Payment fee (optional) * @param string $gatewayModule Gateway module name */ // Retrieve data returned in payment gateway callback // Varies per payment gateway //$success = $_POST["x_status"]; //$TRANSIDMERCHANT = sha1(microtime()); $TRANSIDMERCHANT = $_POST['TRANSIDMERCHANT']; $STATUSTYPE = $_POST["STATUSTYPE"]; $APPROVALCODE = $_POST["APPROVALCODE"]; $transactionId = $_POST["TRANSIDMERCHANT"]; $paymentAmount = $_POST["AMOUNT"]; // $PAYMENTCHANNEL $_POST["PAYMENTCHANNEL"]; $PAYMENTCODE = $_POST["PAYMENTCODE"]; $SESSIONID = $_POST["SESSIONID"]; $BANK = $_POST["BANK"]; $MCN = $_POST["MCN"]; $MTIME = date("YmdHms"); $PAYMENTDATETIME = $_POST['PAYMENTDATETIME']; $VERIFYID = $_POST["VERIFYID"]; $VERIFYSCORE = $_POST["VERIFYSCORE"]; $VERIFYSTATUS = $_POST["VERIFYSTATUS"]; $CURRENCY = '360'; $PURCHASECURRENCY = '360'; $BRAND = $_POST["BRAND"]; $CHNAME = $_POST["CHNAME"]; $THREEDSECURESTATUS = $_POST["THREEDSECURESTATUS"]; $EDUSTATUS = 'NA'; $WORDS = $_POST['WORDS']; $TRANSIDMERCHANT = $_POST['TRANSIDMERCHANT']; //$transactionStatus = $success ? 'Success' : 'Failure'; // $transactionStatus = $success ? echo "Success"; $transactionStatus = $success; $success = 'Sucess'; } /** * Validate callback authenticity. * * Most payment gateways provide a method of verifying that a callback * originated from them. In the case of our example here, this is achieved by * way of a shared secret which is used to build and compare a hash. */ $SHARED_KEY = $gatewayParams['SHARED_KEY']; $MALLID = $gatewayParams['MALLID']; $amount = $gatewayParams['AMOUNT']; if ($hash != md5($paymentAmount.$MALLID.$SHARED_KEY.$TRANSIDMERCHANT.$VERIFYSTATUS)) { //($hash != md5($invoiceId . $transactionId . $paymentAmount . $SHARED_KEY)) { $transactionStatus = $failed; $failed = 'Hash Verification Failure'; echo $failed; //$success = false; } /** * Validate Callback Invoice ID. * * Checks invoice ID is a valid invoice number. Note it will count an * invoice in any status as valid. * * Performs a die upon encountering an invalid Invoice ID. * * Returns a normalised invoice ID. * * @param int $invoiceId Invoice ID * @param string $gatewayName Gateway Name */ //$invoiceId = checkCbInvoiceID($invoiceId, $gatewayParams['name']); $invoiceId = checkCbInvoiceID($invoiceId, $gatewayParams['name']); /** * Check Callback Transaction ID. * * Performs a check for any existing transactions with the same given * transaction number. * * Performs a die upon encountering a duplicate. * * @param string $transactionId Unique Transaction ID */ checkCbTransID($transactionId); /** * Log Transaction. * * Add an entry to the Gateway Log for debugging purposes. * * The debug data can be a string or an array. In the case of an * array it will be * * @param string $gatewayName Display label * @param string|array $debugData Data to log * @param string $transactionStatus Status */ //logTransaction($gatewayParams['name'], $gatewayParams['WORDS'], .$transactionStatus); logTransaction($gatewayParams['name'], $_POST, $transactionStatus); if ($success) { /** * Add Invoice Payment. * * Applies a payment transaction entry to the given invoice ID. * * @param int $invoiceId Invoice ID * @param string $transactionId Transaction ID * @param float $paymentAmount Amount paid (defaults to full balance) * @param float $paymentFee Payment fee (optional) * @param string $gatewayModule Gateway module name */ addInvoicePayment( $invoiceId, $transactionId, $paymentAmount, $paymentFee, $gatewayModuleName ); echo "Payment success notification accepted"; } else{ //Adopted from paypal to log all the failed transaction $orgipn = ""; foreach ($_POST as $key => $value) { $orgipn.= ("" . $key . " => " . $value . "\r\n"); } logTransaction($gatewayModuleName, $orgipn, "Duitku Handshake Invalid"); header("HTTP/1.0 406 Not Acceptable"); exit(); } ?> It still show me the error also it wasn't saved to Gateway Log the error occurred. Could someone help me for this issue ? Thank you
-
How to generate Paypal subscription for domains
Aeterno replied to Shuichi Miyahara's topic in Developer Corner
Hi, Are you already fill the API on the admin page located on the payment gateway ? -
Hi, I'm develop the payment gateway modules used third party concept located on developer page https://developers.whmcs.com/payment-gateways/third-party-gateway/ I would like to know how to appeared the invoice description but when I put : $description It appeared input type="hidden" name="BASKET" value="Company+Name+-+Invoice+%232+5000000.00"> Perhaps someone could help me for this