Jump to content
Sign in to follow this  

Recommended Posts

Posted (edited)

Hello. 

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; 

[{"id":58,"gateway":"MODULE","setting":"ppmerchantId","value":"7247821a8601xxxxxxf862bc00d51df36f8b7f4c7cbc503fdf06e54cc41d09798d3a74513ff8d6ac8c","order":0}]

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

@steven99

if I echo this, it returns something like that

Quote

7247821a8601be96a191a93b3d31989df862bc00d51df36f8b7f4c7cbc503fdf06e54cc41d09798d3a74513ff8d6ac8c

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. 

  ["pp_Password"]=>
  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. 

@steven99

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.

Guest
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 CLUBITS
      Hi Team,
      After the successful update of WHMCS 8.2.1, the Facebook and Twitter social login does not work properly.
      Showing this warning message only "Please complete sign in with your chosen service provider."
      This is our portal https://clubits.com/

    • By ModulesGarden
      1. Summer Sale – 25% OFF EVERYTHING!

      How to better celebrate the arrival of Summer if not with a thrilling shopping spree? Our Summer Sale is here to kit you out with the best WHMCS modules at the absolute best prices!

      From now through 30th June, ModulesGarden is knocking down the prices of every single WHMCS product to be spotted on the Marketplace. So go ahead, grab a jaw-dropping 25% promo code and use it however you like – with annual licenses, open source modules, even license upgrades!

      Tip: you can put away much more by bulk ordering and mixing the Summer Sale with other tremendous offers.

      Snap up the easiest summer savings of your life!



      2. Products Reseller For WHMCS v1.2.0

      How to make your resellers fully satisfied with your cooperation?

      If you run a reselling business, this is the kind of a question that you most likely googled at least once before. While the answers are plenty, it may be quite a tough nut to crack to sift through the maze of suggestions, and find those that may actually help you.

      Luckily, our vastly updated Products Reseller For WHMCS is here to offer you all the tools you wish you’d have to make sure the needs of your resellers are perfectly catered for. And these are the major new features built into the module throughout the works on the 1.2.0 version:
      Flawless support has been introduced for WHMCS V8.2 that extends to the modern "Twenty-One" template. Your products can be now marketed by resellers with the support of WHMCS "Configurable Options", each of which can be priced individually. End clients have been empowered to use the synchronized product custom fields with your services. The range of products available for reselling can be now further extended to include such in-demand offerings as EasyDCIM dedicated servers and OpenStack projects.
      Products Reseller For WHMCS 1.2.0 will help you forge enviable bonds with your resellers!



      3. The following updates have also been made available since last week:
      Amazon EC2 For WHMCS 1.3.2 DNS Manager For WHMCS 2.16.0 Plesk Extended For WHMCS 3.5.1

      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!
    • By DennisHermannsen
      If you have specified multiple billing cycles for your products, and a client want to up- or downgrade to another plan, they are going to be billed incorrectly if they also switch their billing period while doing so.
      Here's an example.
      I have a product that costs 900DKK per year. Client wants to upgrade to a product that costs 1900 per year. If they keep the billing cycle annually, everything is good. I expect they would pay 1000DKK on the first day of their billing period.

      However - if they client choses "monthly" billing cycle while doing the upgrade, nothing makes sense anymore. The client now has to pay MORE, even though they've already prepaid for a year.

      I've already mentioned this to WHMCS, but apparantly this is by design and I should create a feature request (which I did - not live though, yet: https://requests.whmcs.com/idea/change-how-upgradedowngrade-amount-works-when-changing-billing-cycle)
      Saying something is "by design" doesn't mean that it's correct. It just means it is meant to be that way - but it's obviously very incorrect.
      When a client goes from yearly -> monthly, they need to pay more - if they go the other way around, they need to pay less.
      Wouldn't the issue be solved if WHMCS stopped taking the new billing cycle into account and just used the current billing cycle?
       
    • 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 :
      https://hogionline.com/whmcs_bridge/viewinvoice.php?id=2&systpl=six
      But when I log in the client area,  the invoice is located there.
      Any idea on how i can fix the issue!?
      Regards,
    • 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)  
       
       
       
       
       
  • 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