Jump to content

External Integration


dorzki

Recommended Posts

Hi there,

I'm developing a module to integrate WHMCS to my financial service.

 

I'm making an API call to create a new receipt and i get in a response a ticket_id.

I'm saving this ticket_id because a few seconds later, the financial service sends me an API call with the ticket_id and a url to download the receipt.

 

I've created a file which catches the API call, however i need access to Capsule, and i don't know which file i need to include in order to include the entire WHMCS library so i can use the functions.

 

Would love to get your help :))

Link to comment
Share on other sites

if that is the case, then you need to require this file:

 

<?php
require_once("{Path-To-WHMCS}/vendor/autoload.php");

 

then import Capsule class in the same file as below:

use WHMCS\Database\Capsule;

 

if you work inside WHMCS directory, I mean if your file require WHMCS's init.php file, or run by WHMCS, then you should use the previous line only

Link to comment
Share on other sites

use the following line only in both (hooks.php, and {module-name}.php) files:

use WHMCS\Database\Capsule;

 

if you work with different file where you call it using browser or ajax (not called by WHMCS it self) then you need to include this line too:

require_once("../../../init.php");

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.

  • 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