Jump to content
Sign in to follow this  

Recommended Posts

Posted (edited)


Hook file contain this code,. to retrieve the values from the database, With latest version of WHMCS 8 am unable to access the variable through the following code; 

 $invoiceData['merchant_id'] = Capsule::table('tblpaymentgateways')->where('gateway', 'MODULE')->where('setting' , 'ppmerchantId')->get();

if echo $invoiceData['merchant_id'] returns; 


How to retrieve the value in PHP code? 

Version : Most Latest WHMCS. PHP 7.4


Edited by Waqas Saeed

Share this post

Link to post
Share on other sites
Posted (edited)
4 hours ago, Waqas Saeed said:

How to retrieve the value in PHP code?

Not sure I understand the question.  You have the value in that object you mention and you just need to access it like other objects -- via  "->property_name".  So in this case, you would use $invoiceData['merchant_id']->value  or am i missing something? 

Another option is using:

$Value = Capsule::table('tblpaymentgateways')->where('gateway','gateway-name')->where('setting','setting_name')->first()->value;
Edited by steven99

Share this post

Link to post
Share on other sites


if I echo this, it returns something like that



I need the value here, the actual from the database. 

Share this post

Link to post
Share on other sites

Correct, that is the value from the database.  Though it does look sorta long for a merchant id and more like token or perhaps it is encrypted by the module when it is saved -- though still seems long for just a merchant id that is encrypted. 

Share this post

Link to post
Share on other sites

So, What is the code to get the params of module 'jazzcash' into hook file, if that is the scenario;  

Not like that. 

  string(96) "a2df9e0803d65f234d6192946800295b977d5a377d0d197631899f91d18a5108dcd335f1194597f1bee82f5db5bce7bb"
["pp_Password"]=> string(96) "Password123342"

If you could help me with the sample code? @steven99 Please

Share this post

Link to post
Share on other sites

To get all values, probably easier to use the getGatewayVariables function.  Search for that on the community as it wont allow me to post any code for it. 

Share this post

Link to post
Share on other sites

OH! thanks a lot, it worked, now i can feel, the pending voucher transaction has been marked paid from the hook that works by AfterCronJob. SOAP module. 


Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Similar Content

    • By Innocent SANGWE
      Dear WHMCS community,
      I am getting a 404 page every time an order is placed successfully on my website : hogionline.com
      I tried to change the website twice, reinstalled whmcs many times but i'm still getting the error.
      It seems like the system is trying to generate the invoice then fails.
      The link i am getting is :
      But when I log in the client area,  the invoice is located there.
      Any idea on how i can fix the issue!?
    • By Waqas Saeed
      I'm a Domain name and Hosting Reseller; I've integrated the WHMCS that takes order and run module commands on successful transaction; We're happy with the business but it feels now that we should expend the business by offering different services to the vendors, or act as a vendor store;
      1) What the modules in the market that offers WHMCS to act as a vendor store? 
      To take opportunity of developed modules; What modules are widely used? e.g. if you find good module to offer registration of the events through WHMCS ( Get webinars ID)  
    • By towens

      I have a WHMCS install in which we're using the API to embed an order form in another application. With WHMCS 8x, we're using the CreateSsoToken API function to authenticate the user. This same code is working an another WHMCS install, both of which are on 8.1.3. Users/Clients are being created properly in both installs, but only in the other install are those users being redirected to the cart; in this one, I'm getting this error:
      {"error":"access_denied","error_description":"Single Sign-On has been disabled for this account."}
      I did find this community post about the error, but we're not using cPanel application links, I double checked the value in the tblclients.uuid table, and ensured the client had SSO enabled.

      Here is the function we're using to build the SSO token request. This section, and the callwhmcsapi() function it references, are the same between this install (that's throwing the above error) and the other install that's working fine. I've also double checked that this is the proper path for the product.
      function whmcssso($client){ $params['client_id'] = $client['client_id']; $params['destination'] = 'sso:custom_redirect'; $params['sso_redirect_path'] = 'cart.php?a=add&pid=1'; $result = callwhmcsapi("CreateSsoToken",$params); return $result['redirect_url']; }
      Any help would be appreciated, thank you.

    • By JesusSuarz
      I have a variable that is printed with {debug} in the tpl template.
      however I want to get the result in php of this variable.
      I need to get $customfields from a hook.
      how could you access $customfields that is printed inside a product
      @brian! could you help me?
    • By ModulesGarden
      1. Products Reseller For WHMCS 1.1.0

      The module we have put through quite a shake-up recently is our crowd-pleasing Products Reseller For WHMCS specialized in effortless reselling of products and services of absoluetly any kind, and in absolutely any platform. Result? A couple of powerful new features within just a single 1.1.0 update!

      For starters, the tool has embraced a well-deserved label confirming its unblemished support for the WHMCS 8.1 environment.

      Another compelling argument why Products Reseller For WHMCS may mark a turning point in your career? The module’s freshly established integration with GoGetSSL For WHMCS and GoDaddy SSL For WHMCS which opens up a whole new way of using its extensive toolkit to resell SSL certificates.

      Let your offer gain worldwide recognition with Products Reseller For WHMCS 1.1.0!

      2. Live Dashboard in new MetricsCube!

      Tried all possible ways to keep your WHMCS data in apple-pie order and under regular check, but nothing really worked quite as you expected? It is a perfect moment then to discover the impressively updated MetricsCube!

      In its most advanced edition, MetricsCube doesn’t just compile in-depth reports and statistics. It gathers all the most important data your business produces right here and now, and organizes them into eye-pleasing widgets with charts and statistics straight on the spanking new Live Dashboard!

      To keep our free MetricsCube Connector For WHMCS up to speed with the latest developments, the module received a solid 2.2.3 update that ensures its perfect harmony not only with the all-new Live Dashboard, but with the major WHMCS V8.1 release as well.

      Pilot your company to dynamic growth with MetricsCube!

      3.Stay plugged-in on other modules promoted to a new version recently:
      DirectAdmin Extended For WHMCS - v3.4.4 WordPress Manager For WHMCS - v1.5.4

      Need Custom Software Development For Your Business?
      Get Your Free Quote Now! Specially for you we will adapt an application and its design to your own needs, create a new module or even a completely new system built from scratch!
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...

Important Information

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