Jump to content

tblpaymentgateways into Hook


Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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

Link to comment
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.

×
×
  • 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