We added this functionality in cPanel & WHM version 56.
We recommend that only advanced users use this feature.
This document explains how to create a third-party custom cPanel Market provider module with basic functionality.
The cPanel Market system allows you to purchase and automatically install SSL certificates and other products through cPanel's SSL/TLS Wizard interface (cPanel >> Home >> Security >> SSL/TLS Wizard). cPanel & WHM servers ship with the cPanel Store provider module.
Third-party vendors can create their own provider modules in Perl in the
/var/cpanel/perl/Cpanel/Market/Provider/ directory and should use the
Cpanel::Market::Provider namespace. For example, the Example certificate provider would create the
Example.pm module in the
Third-party developers must implement the following functions in order to create a functional cPanel Market provider module:
The URL that the browser should access to allow the user to log in.
Equivalent UAPI Function
We recommend that third-party developers declare the following constants:
|The path to DCV check file, relative to the document root directory.|
|The characters that the provider allows in the filename that it uses to check for DCV.|
|The number of characters that the provider allows in the DCV check filename.|
|The DCV check file's extension that the provider requires.|
|The user agent string that the system uses for the imitated local DCV check.|
Third-party provider modules must use the following workflow:
validate_login_tokenfunction in order to send that code to the provider and obtain an access token.
create_shopping_cartfunction. You can insert custom logic with the
create_shopping_cartfunction returns an
order_idvalue that the cPanel application will use to maintain state after payment.
create_shopping_cartfunction also returns a unique
order_item_idvalue for each item that the customer orders.
set_url_after_checkoutfunction to set a post-checkout redirection URL.
set_url_after_checkoutfunction previously set).
For certificate orders, the module performs the following additional steps:
get_ssl_certificate_if_availablefunction at regular intervals to poll the provider for the certificate.
After the provider issues the certificate, the provider finalizes payment.
We recommend that you finalize payment after you issue the certificate in order to avoid unnecessary additional chargeback fees. If the user deletes the Domain Control Validation (DCV) file from their account before the DCV process happens, this effectively cancels the order.
The following custom provider module outline demonstrates a minimal set of functionality.
|This example does not reflect a fully-functional module and only demonstrates a basic workflow. Your implementation requires more internal logic. Also, this example does not demonstrate the necessary API functions that would allow your module to hook into your store.|
Market Provider Modules