Ntan Posted December 7, 2017 Share Posted December 7, 2017 Hi, we are developing a plugin for register domains. We have implement the basic functions for the plugin but we have a problem regarding contacts that we need to solve it. When we create a contact the plugin also create a contact to our database, but we dont know how to save this relation, meaning that contact_id 1 of whmcs is the contact_id 123 to our database. So we need to create a custom database table that will hold this relation and have our module maintain it during the various functions. So we need some info on how to create this table and manage it through our module. Any help, suggestion or study material appreciated Link to comment Share on other sites More sharing options...
WHMCS Marcus Posted December 7, 2017 Share Posted December 7, 2017 Hello @Ntan, In this case, you would likely want to do all of this by interacting directly with the database. We have some information on how to do this with Capsule in our Developer's Documentation, found here: https://developers.whmcs.com/advanced/db-interaction/ You can definitely use this to create and manage your custom tables! 1 Link to comment Share on other sites More sharing options...
Ntan Posted December 8, 2017 Author Share Posted December 8, 2017 Thanks i set up the table and i can get the data i want and it seems to working, i have not finished the module but the relation is working. When i was testing the module the function registrarmodule_RegisterDomain was returning error because could not find the relationship but whmcs show the screen of Complete Order and send me email about the registration, but the registration did not actually happened because of the error. I did return an error array array(1) { ["error"]=> string(56) ". Contact _EPP_21522_95879 does not exist [Code: 1010]." } and whmcs ignore it and continue to complete the order. I dont think that this is a normal behaviour Am i doing something wrong? Link to comment Share on other sites More sharing options...
Recommended Posts