Custom Snapin for 3rd Party Cloud Service Integration

everdaniel

New Member
Hi everyone!

I'm working on a developing a custom Snapin to integrate Clientexec with a 3rd Party Cloud Service (something similar to Dropbox or Google Drive).

The goal of this Snapin is to create an account (with a plan) on this 3rd Party Cloud Service when a Client/Package is created, on my Snapin I setup an array with a list of the events I want to "listen to" using the Clicksend Snapin as a base:
  • System-ActionCalled
  • Client-Create
  • Client-Delete
  • Client-Update
  • Account-Logoff
  • Account-StatusUpdate
  • Service-AutoSuspend-Suspend
  • Service-AutoSuspend-Unsuspend
  • UserPackage-Activate
  • Package-Update
  • Order-NewPackage
Screen Shot 2022-03-23 at 22.52.34.png

I can confirm the events "Client-Create" and "Order-NewPackage" are triggered when I place an order through the client/user interface, however, when I create a client and package through the admin interface, none of these events are triggered.

For the Products, I setup a "General" Product Group and then added Products for each "Plan" type I have on my 3rd Party Cloud Service.

I also wanted to ask if there is a way to add a custom field to a product? Each of my "Products" should be linked to a specific Plan on this 3rd Party Service, does anyone knows if this is possible?
Screen Shot 2022-03-23 at 22.58.24.png

If anyone could point me in the right direction, will be much appreciated.

Thank you!

- Ever Daniel
 
Hi there,

You'll need to develop a server plugin first (https://www.clientexec.com/members/...r-docs~89/server-plugin-development-guide~510), which would handle the creation, suspension, unsuspension, and deletion of the UserPackage. Then the snapin will be able to handle any other event you want to listen for.

You'll also want to use a server product type, instead of the general type so that auto suspend/unsuspend works.

In the server plugin, take a look at "package_vars_values", and this will allow you to set the package variables (such as Plan ID). This will show up under the "Advanced" tab of a product, once the product group is set to server.
 
Thank you @CE-Matt for your response, will proceed with the server plugin then, one last question though, is there a way to hide or disable the "domain name" field when the user orders a server product type? Can I use the "package_vars_values" to ask the user to enter additional details? Ideally, I would like to ask the user to enter a username and password instead of the Domain Name field, is that possible?

Screen Shot 2022-03-23 at 23.05.07.png
 
Hi,

You'll want to have "Hide Hosting Custom FIelds" enabled in the Product, this will remove the Domain Name field. Then you want to create Custom Fields, and attach them to the Product Group, and use them, like we do in SolusVM:

https://github.com/clientexec/solusvm-server/blob/master/PluginSolusvm.php#L112-L136 -> These first fields, create fields when you add/edit a server, to allow for the customization of the actual custom field names.
https://github.com/clientexec/solusvm-server/blob/master/PluginSolusvm.php#L397 -> You can then reference them like that in your create function.
 
Back
Top