Jump to content


Senior Member
  • Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About sokalsondha

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. dear community member.. hope all doing very well. i am trying to make a module for my VoIP project . one of my friend helping me out in this module. but i dont know what he done something is he can't figure out how to fix. basically its for VoIP project. so we will sell voip service with local city number. so when the ordering time we will select the city and then based on the city name the available numbers will be display.. so for the list of city the api link is https://mydomainname.com/api/city_list.php?&token=123456 this api link display all the city name from remote database so thats i want it to show in one custom field and for the second custom field based on the city name i have another api link which is https://mydomainname.com/api/did_free.php?city=Dublin&token=123456 which shows result this way its only shows the number is dublin city from the remote database. my friend make the module for me. but the way i want its show very right in the customer order form . i mean if customer directly buy from the client area its shows perfect according to city name so when i select the city then i see available numbers based on the city which the way i wanted to see from the client area. so from the client area its works properly no problem. problem with from the admin area when i wanted to setup a product to client from admin in the admin panel i see like this which means its doesn't matter which city i select. but i see all numbers from my remote database. like 35391 is Galway numbers 35314 is Dublin Numbers and 35321 is Cork numbers. they are all showing together. which is very frustrating . here is my hook file code. can some please please tell me where he did wrong? HOOK FILE CODE ======================================== <?php use PDO; use Exception; use PDOException; use WHMCS\Database\Capsule; $host = 'https://mydomainname.com/api/'; $token = '123456'; $ch = curl_init(); $fields = array( 'token' => $token ); curl_setopt($ch, CURLOPT_URL, $host.'city_list.php?'.http_build_query($fields)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $city = curl_exec($ch); curl_close($ch); $packageNames = json_decode($city, true); $citylist = array(); $numberslist = array(); foreach ($packageNames['result'] as $packageName) { $citylist[$packageName['city']] = ucfirst($packageName['city']); $ch = curl_init(); $fields = array( 'city' => $packageName['city'], 'token' => $token ); curl_setopt($ch, CURLOPT_URL, $host.'did_free.php?'.http_build_query($fields)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $numbers = curl_exec($ch); $numbers = json_decode($numbers); $numberslist = array_merge($numbers->result,$numberslist); curl_close($ch); } $citylist = implode($citylist,','); $numberslist = implode($numberslist,','); //echo json_encode(array('cities'=>explode(",",$citylist),'numbers'=>explode(",",$numberslist))); $pdo = Capsule::connection()->getPdo(); try { $result = $pdo->query( "update tblcustomfields set fieldoptions = '".$citylist."' where fieldname = 'City'" ); } catch (\Exception $e) { echo "Uh oh! {$e->getMessage()}"; return $e->getMessage(); } try { $result = $pdo->query( "update tblcustomfields set fieldoptions = '".$numberslist."' where fieldname = 'Available Phone Numbers'" ); } catch (\Exception $e) { echo "Uh oh! {$e->getMessage()}"; return $e->getMessage(); } add_hook('OverrideModuleUsernameGeneration', 1, function($vars) { return $vars['customfields']['Available Phone Numbers']; }); ============================================================= please someone help me to correct the code. please
  2. hello my friends. how are you? i am having one major issue with my custom made payment gateway using sumup api. payment works fine. its marking the invoice paid too which works smoothly. but only the problem is after make successfull payment its not redirect to invoice page.. here is my callback file <?php session_start(); /* Gateway Module Name: Nexxus Payment Group Callback Description: Nexxus payment gateway module for WHMCS Version: 1.0 Author: Asif Iqbal Author URI: https://www.webwizo.com */ // 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 $status = $_GET["status"]; $invoiceId = $_GET["invoice_id"]; $transactionId = $_GET["transactionId"]; $paymentAmount = $_GET["amount"]; $paymentFee = $_POST["x_fee"]; $transactionStatus = ucwords($status); /** * 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. */ $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. */ 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'], $_GET, $transactionStatus); if ($status == 'SUCCESSFULL') { /** * 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 ); }else{ addInvoicePayment( $invoiceId, $transactionId, $paymentAmount, $paymentFee, $gatewayModuleName ); header('Location:'.$_SESSION['return_url']); } can someone guide me with this? how to return to invoice page with success message thanks
  3. Dear everyone.. greetings from me. i just need some suggestion from the experts. currently i am in ireland and using my whmcs for irish market. so my currency is euro. and my website all the products shows as in euros. i am planning to start a brand for host in bangladesh where i am originally from but i have the different price set for bangladesh website.. just to let u know i made another website for bangladesh market. and in the website prices are set in BDT not in euro i am looking for some solution when a visitor visit bangladesh website and select the product it will be shows the product sets for bangladesh and price will shown BDT not in euros but when client from ireland will visit the website they will see euros.. i want to set euros as default. also like visitor from UK will see product sets for UK and price will shown in GBP. do i need hook make for this? or what thing i need to customise? or need some module? can someone help me with some suggestion? thanks in advance
  4. sokalsondha

    need help for a module for payment

    thanks every one.. i got solved the issue by made a module.. thanks again
  5. dear my friends.. thanks again for reading my post.. i dont know its very hard to find some whmcs developer.. i actually stuck here for a payment module. may be someone like to help me again.. What I need from you is... I want a manual payment gateway from you.. the plan is like after create the invoice when client will be click the button pay now it take them to a page where the page will be say thank you very much for your order. We will contact with you regarding the payment. And the module will send me a email that this client tried to pay me. But the invoice will remain unpaid. So after I will get the email I will edit the invoice and select the proper gateway for that invoice and I will contact with the client to pay the invoice by PayPal or stripe or whatever proper gateway. i know i can add some fake gateway from whmcs and i can see the unpaid invoice in my admin area.. but not everyone click on the pay now button. all i want who tried to pay me that person email address. so this is the only way i can find out who want to pay me.. so i can get notified in email and i will contact with the person.. i have made some layout of the gateway setting can someone really really help me with this.. i will be so pleased... thank you very much in advance
  6. sokalsondha

    2 whmcs in same domain

    hello community i need a big favour from you. i have whmcs installed in http://mydomain.com but 3 days before i create a sub directory http://mydomain.com/billing/ its working fine. but my existing client still have the old invoice template which is generated all the time. so what happened is they have email invoice with the invoice link http://mydomain.com/viewinvoice.php?id=xxxx but now when they click it its showing viewinvoice.php not find in the server error 404 page.. i want to keep my whmcs in the subdirectory folder called billing. but is there anyway i can use any hook or something so all my clients who have already invoice generated and got the invoice email if they click on the invoice link it will redirect to the new link like http://mydomain.com/billing/viewinvoice.php?id=xxxx please someone help please
  7. dear community how are you all? i have move my whmcs to a sub directory but i forgot to update the cron job link in the cpanel . as a result 2 days the invoice didnt generate.. can you please tell me is there any way i can do so the invoice can be generate for that 2 days... i dont want to loose the clients :( please help me thanksa million in advance
  8. sokalsondha

    want to remove menu item from the homepage

    thankssssssssssssssssss boss... i use the hook.. and works straight.. you just made my day 🙂 god bless you all the time 🙂
  9. sokalsondha

    want to remove menu item from the homepage

    superrrr. its works really nice.. but sir i stil see the View Cart button in homepage ... i want to remove that too.. can you please help me with that . which file i need to edit basically we dont want any one register by themself.. admin register client with product.. thanks again for wonderful help
  10. hello community hope we all doing well. i just need bit help if you can help me with that. i think i need a hock to remove some menu item from the homepage i need to remove the Store Menu item and the Announcement. can someone guide me with the hook so i can remove them 🙂 thanks in advance everyone 🙂
  11. sokalsondha

    Set next invoice date

    Hello community... I came back again. Can someone help me with my system. What happened is.. We sell yearly service. Let's say client bought service 01/04/2018 And his next due date is 31/03/2019. Now system generate invoice on 15/03/209 But he didn't paid. He decide to pay on may.. I knw the service will be suspended. But it's not a problem. Now if he pay on may .. I see his next due date will be 31/03/2020 not 01/05/2020 So he is loosing a month when he didn't used the service in April. Can we have a hook to update the next invoice date the customer paid+365 days? Please help me
  12. Hello Brian. Yes finally you get it correct. even i put tick or untick in the settings--> security Disable CC Storage. its not affecting anything with last 4 digit information because i am using stripe gateway. so its stripe token. and yes i want to get rid of that too.. is it possible with hook?
  13. thanks a million again brian. As you can see on the DOC because of its tokenised gateway its saving last 4 digit in my WHMCS. i think something with stripe thats forcing WHMCS to store the data. because after the payment i can see in my stripe that stripe save that payment as a new cusotmer of them. so they are pulling customer email address from WHMCS. so basically all i want any how not storing the card at all. so far i understand i need hook. is it possible you can help me with hook? so i can put this hook and after my client pay by stripe the card number will not be saved at all thnaks
  14. dear brian. this code worked. i can see the radio button ticked even i have save card details but unfortunately even the 1st radio button ticket my system still not showing the new card box to enter new CC. is there any chance any hook can i use so everytime customer pay with card its not even saving the last 4 digit of the card. as template file editing not helping me at all. waiting to hear from you soon brian 🙂
  15. thanks brian for support me again.. brian all i want hide this two radio button. and make the 1st radio button by default at any stage. even our system saved the last 4 digit of the card. but the radio button will be 1st one enabled. so clients can put CC details everytime. at least they will trust this the card is not saved anywhere. if i make a hook can you help me with the code of hook? or may be its more better is it possible to make a hook so the card details never saved in our whmcs server? then i know how to hide the radio buttons.. please help me brian.. either with hook to not store the cards at all or edit the tpl file make the 1st radio button default all the time 🙂

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated