' . Language::_("ThesslstoreModule.success.resend_approver_email", true) . '
-diff --git a/api/abstractions.php b/api/abstractions.php index e7332e5..9b59a4b 100644 --- a/api/abstractions.php +++ b/api/abstractions.php @@ -1,154 +1,182 @@ - - * Date: 2/27/12 - * Time: 7:27 AM - * This file is created by www.thesslstore.com for your use. You are free to change the file as per your needs. - */ - -class baserequest -{ - public $AuthRequest; - public function __construct() - { - $this->AuthRequest = new apirequest(); - } - public function __toString() - { - return var_export($this,true); - } -} - -class baseresponse -{ - public $AuthResponse; - public function __construct() - { - $this->AuthResponse = new apiresponse(); - } - public function __toString() - { - return var_export($this,true); - } -} - -class curlresponse -{ - public $info; - public $response; - public $error=''; -} - -/* Common class across request/response */ - -class apiresponse -{ - public $isError = false; - public $Message; - public $Timestamp = ''; - public $ReplayToken = ''; - public $InvokingPartnerCode=''; - public function __toString() - { - return var_export($this,true); - } -} - -class apirequest -{ - public $PartnerCode = ''; - public $AuthToken = ''; - public $ReplayToken = ''; - public $UserAgent = ''; - public $TokenID = ''; - public $TokenCode = ''; - public $IPAddress = ''; - public $IsUsedForTokenSystem = false; - public $Token = ''; -} - -class OrganizationAddress -{ - public $AddressLine1; - public $AddressLine2; - public $AddressLine3; - public $City; - public $Region; - public $PostalCode; - public $Country; - public $Phone; - public $Fax; - public $LocalityName; -} - -class OrganizationInfo -{ - public $OrganizationName; - public $DUNS; - public $Division; - public $IncorporatingAgency; - public $RegistrationNumber; - public $JurisdictionCity; - public $JurisdictionRegion; - public $JurisdictionCountry; - /** - * @var - */ - public $OrganizationAddress; -} - -class contact -{ - public $FirstName; - public $LastName; - public $Phone; - public $Fax; - public $Email; - public $Title; - public $OrganizationName; - public $AddressLine1; - public $AddressLine2; - public $City; - public $Region; - public $PostalCode; - public $Country; -} - -class oldNewPair -{ - public $OldValue; - public $NewValue; -} - -class certificate -{ - public $FileName; - public $FileContent; -} - -class orderStatus -{ - public $isTinyOrder; - public $isTinyOrderClaimed; - public $MajorStatus; - public $MinorStatus; - public $AuthenticationStatuses; -} - -class productResponse -{ - public $ProductCode; - public $ProductName; - public $CanbeReissued; - public $ReissueDays; -} - -class productPricing -{ - public $NumberOfMonths; - public $NumberOfServer; - public $Price; - public $PricePerAdditionalSAN; - public $PricePerAdditionalServer; - public $SRP; + + * Date: 2/27/12 + * Time: 7:27 AM + * This file is created by www.thesslstore.com for your use. You are free to change the file as per your needs. + */ + +class baserequest +{ + public $AuthRequest; + public function __construct() + { + $this->AuthRequest = new apirequest(); + } + public function __toString() + { + return var_export($this,true); + } +} + +class baseresponse +{ + public $AuthResponse; + public function __construct() + { + $this->AuthResponse = new apiresponse(); + } + public function __toString() + { + return var_export($this,true); + } +} + +class curlresponse +{ + public $info; + public $response; + public $error=''; +} + +/* Common class across request/response */ + +class apiresponse +{ + public $isError = false; + public $Message; + public $Timestamp = ''; + public $ReplayToken = ''; + public $InvokingPartnerCode=''; + public function __toString() + { + return var_export($this,true); + } +} + +class apirequest +{ + public $PartnerCode = ''; + public $AuthToken = ''; + public $ReplayToken = ''; + public $UserAgent = ''; + public $TokenID = ''; + public $TokenCode = ''; + public $IPAddress = ''; + public $IsUsedForTokenSystem = false; + public $Token = ''; +} + +class OrganizationAddress +{ + public $AddressLine1; + public $AddressLine2; + public $AddressLine3; + public $City; + public $Region; + public $PostalCode; + public $Country; + public $Phone; + public $Fax; + public $LocalityName; +} + +class OrganizationInfo +{ + public $OrganizationName; + public $DUNS; + public $Division; + public $IncorporatingAgency; + public $RegistrationNumber; + public $JurisdictionCity; + public $JurisdictionRegion; + public $JurisdictionCountry; + /** + * @var + */ + public $OrganizationAddress; +} + +class contact +{ + public $FirstName; + public $LastName; + public $Phone; + public $Fax; + public $Email; + public $Title; + public $OrganizationName; + public $AddressLine1; + public $AddressLine2; + public $City; + public $Region; + public $PostalCode; + public $Country; +} + +class oldNewPair +{ + public $OldValue; + public $NewValue; +} + +class certificate +{ + public $FileName; + public $FileContent; +} + +class orderStatus +{ + public $isTinyOrder; + public $isTinyOrderClaimed; + public $MajorStatus; + public $MinorStatus; + public $AuthenticationStatuses; +} + +class productResponse +{ + public $ProductCode; + public $ProductName; + public $CanbeReissued; + public $ReissueDays; +} + +class productPricing +{ + public $NumberOfMonths; + public $NumberOfServer; + public $Price; + public $PricePerAdditionalSAN; + public $PricePerAdditionalServer; + public $SRP; +} + +class cwatch_admin_contact{ + public $FirstName; + public $LastName; + public $Phone; + public $Email; + public $Country; +} + +class digicert_organization_contact{ + public $Firstname; + public $Lastname; + public $Email; + public $JobTitle; + public $Phone; + public $Phone_Extension; +} + +class digicert_dcv_details{ + public $domain; + public $dcvMethod; + public $dcvStatus; + public $FileName; + public $FileContents; + public $DNSName; + public $DNSEntry; + public $ExpirationDate; } \ No newline at end of file diff --git a/api/requests.php b/api/requests.php index 79b2621..1242886 100644 --- a/api/requests.php +++ b/api/requests.php @@ -1,447 +1,570 @@ - - * Date: 2/27/12 - * Time: 7:27 AM - * This file is created by www.thesslstore.com for your use. You are free to change the file as per your needs. - */ - -include_once "abstractions.php"; - -class csr_request extends baserequest -{ - public $ProductCode; - public $CSR; -} - -class ssl_validation_request extends baserequest -{ - public $Domainname; -} - -class whois_request extends baserequest -{ - public $Domainname; -} - -class free_claimfree_request extends baserequest -{ - public function __construct() - { - $this->NewOrderRequest = new order_neworder_request_freeproduct(); - parent::__construct(); - } - public $ProductCode; - public $RelatedTheSSLStoreOrderID; - public $NewOrderRequest; -} - - -class free_cuinfo_request extends baserequest -{ - public function __construct() - { - $this->OrganizationInfo = new OrganizationInfo(); - $this->OrganizationInfo->OrganizationAddress = new OrganizationAddress(); - $this->AdminContact = new contact(); - $this->TechnicalContact = new contact(); - parent::__construct(); - } - - public $CustomOrderID; - public $ProductCode; - public $ExtraProductCodes; - public $OrganizationInfo; - public $ValidityPeriod; - public $ServerCount; - public $CSR; - public $DomainName; - public $WebServerType; - public $DNSNames; - public $isCUOrder; - public $isRenewalOrder; - public $SpecialInstructions; - public $RelatedTheSSLStoreOrderID; - public $isTrialOrder; - public $AdminContact; - public $TechnicalContact; - public $ApproverEmail; - public $ReserveSANCount; - public $AddInstallationSupport; - public $EmailLanguageCode; - public $FileAuthDVIndicator; - public $CNAMEAuthDVIndicator; - public $HTTPSFileAuthDVIndicator; - public $SignatureHashAlgorithm; -} - -class health_validate_request -{ - public $PartnerCode; - public $AuthToken; - public $ReplayToken; - public $UserAgent; -} - -class health_validate_token_request -{ - public $Token; - public $TokenID; - public $TokenCode; - public $IsUsedForTokenSystem = true; -} - -class order_agreement_request extends baserequest -{ - public function __construct() - { - $this->OrganizationInfo = new OrganizationInfo(); - $this->OrganizationInfo->OrganizationAddress = new OrganizationAddress(); - parent::__construct(); - } - public $CustomOrderID; - public $ProductCode; - public $ExtraProductCodes; - public $OrganizationInfo; - public $ValidityPeriod; - public $ServerCount; - public $CSR; - public $DomainName; - public $WebServerType; -} - -class order_download_request extends baserequest -{ - public $CustomOrderID; - public $TheSSLStoreOrderID; - public $ResendEmailType; - public $ResendEmail; - public $RefundReason; - public $RefundRequestID; - public $ApproverMethod; - public $DomainNames; - public $SerialNumber; - public $ReturnPKCS7Cert; - public $DateTimeCulture; -} - -class order_download_zip_request extends baserequest -{ - public $CustomOrderID; - public $TheSSLStoreOrderID; - public $ResendEmailType; - public $ResendEmail; - public $RefundReason; - public $RefundRequestID; - public $ApproverMethod; - public $DomainNames; - public $SerialNumber; - public $ReturnPKCS7Cert; - public $DateTimeCulture; -} - -class order_inviteorder_request extends baserequest -{ - public $PreferVendorLink; - public $ProductCode; - public $ExtraProductCode; - public $ServerCount; - public $RequestorEmail; - public $ExtraSAN; - public $CustomOrderID; - public $ValidityPeriod; - public $AddInstallationSupport; - public $SignatureHashAlgorithm; - public $EmailLanguageCode; - public $PreferSendOrderEmails; - public $CertTransparencyIndicator; - public $DateTimeCulture; -} - -class order_neworder_request extends baserequest -{ - public function __construct() - { - $this->OrganizationInfo = new OrganizationInfo(); - $this->OrganizationInfo->OrganizationAddress = new OrganizationAddress(); - $this->AdminContact= new contact(); - $this->TechnicalContact= new contact(); - parent::__construct(); - } - public $CustomOrderID; - public $ProductCode; - public $ExtraProductCodes; - public $OrganizationInfo; - public $ValidityPeriod; - public $ServerCount; - public $CSR; - public $DomainName; - public $WebServerType; - public $DNSNames; - public $isCUOrder; - public $isRenewalOrder; - public $SpecialInstructions; - public $RelatedTheSSLStoreOrderID; - public $isTrialOrder; - public $AdminContact; - public $TechnicalContact; - public $ApproverEmail; - public $ReserveSANCount; - public $AddInstallationSupport; - public $EmailLanguageCode; - public $FileAuthDVIndicator; - public $CNAMEAuthDVIndicator; - public $HTTPSFileAuthDVIndicator; - public $SignatureHashAlgorithm; - public $CertTransparencyIndicator = false; - public $DateTimeCulture = 'en-US'; - public $CSRUniqueValue; -} - - -class order_neworder_request_freeproduct extends baserequest -{ - public function __construct() - { - $this->TechnicalContact= new contact(); - parent::__construct(); - } - - public $TechnicalContact; - -} -class order_validate_request extends baserequest -{ - public $CSR; - public $ProductCode; - public $ServerCount; - public $ValidityPeriod; - public $WebServerType; -} -class order_query_request extends baserequest -{ - public $StartDate; - public $EndDate; - public $CertificateExpireToDate; - public $CertificateExpireFromDate; - public $DomainName; - public $SubUserID; - public $ProductCode; - public $DateTimeCulture; - -} - -class order_certificaterevokerequest_request extends baserequest -{ - public $CustomOrderID; - public $TheSSLStoreOrderID; - public $ResendEmail; - public $SerialNumber; -} - -class order_vulnerabilityscanrequest_request extends baserequest -{ - public $CustomOrderID; - public $TheSSLStoreOrderID; - public $ActionType; -} - -class order_refundrequest_request extends baserequest -{ - public $CustomOrderID; - public $TheSSLStoreOrderID; - public $ResendEmailType; - public $ResendEmail; - public $RefundReason; - public $RefundRequestID; - public $ApproverMethod; - public $DomainNames; - public $SerialNumber; -} - -class order_refundstatus_request extends baserequest -{ - public $CustomOrderID; - public $TheSSLStoreOrderID; - public $ResendEmailType; - public $ResendEmail; - public $RefundReason; - public $RefundRequestID; - public $ApproverMethod; - public $DomainNames; - public $SerialNumber; -} - -class order_reissue_request extends baserequest -{ - public function __construct() - { - $this->EditSAN = array(); - $this->DeleteSAN = array(); - $this->AddSAN = array(); - parent::__construct(); - } - public $TheSSLStoreOrderID; - public $CSR; - public $WebServerType; - public $DNSNames; - public $SpecialInstructions; - public $EditSAN; - public $DeleteSAN; - public $AddSAN; - public $isWildCard; - public $ReissueEmail; - public $PreferEnrollmentLink; - public $SignatureHashAlgorithm; - public $FileAuthDVIndicator; - public $HTTPSFileAuthDVIndicator; - public $CNAMEAuthDVIndicator; - public $ApproverEmails; - public $CertTransparencyIndicator; - public $DateTimeCulture; - public $CSRUniqueValue; -} - -class order_resend_request extends baserequest -{ - public $CustomOrderID; - public $TheSSLStoreOrderID; - public $ResendEmailType; - public $ResendEmail; - public $RefundReason; - public $RefundRequestID; - public $ApproverMethod; - public $DomainNames; - public $SerialNumber; -} - -class order_approverlist_request extends baserequest -{ - - public $ProductCode; - public $DomainName; - public $RelatedTheSSLStoreOrderID; -} - -class order_changeapproveremail_request extends baserequest -{ - public $CustomOrderID; - public $TheSSLStoreOrderID; - public $ResendEmailType; - public $ResendEmail; - public $RefundReason; - public $RefundRequestID; - public $ApproverMethod; - public $DomainNames; - public $SerialNumber; -} - -class order_status_request extends baserequest -{ - public $CustomOrderID; - public $TheSSLStoreOrderID; - public $ResendEmailType; - public $ResendEmail; - public $RefundReason; - public $RefundRequestID; - public $ApproverMethod; - public $DomainNames; - public $SerialNumber; - public $ReturnPKCS7Cert; - public $DateTimeCulture; -} - - -class product_query_request extends baserequest -{ - public $ProductCode; - public $ProductType; - public $NeedSortedList; -} - -class setting_setordercallback_request extends baserequest -{ - public $url; -} - -class setting_setpricecallback_request extends baserequest -{ - public $url; -} - -class setting_settemplate_request extends baserequest -{ - public $EmailSubject; - public $EmailMessage; - public $isDisabled; - public $EmailTemplateTypes; -} - -class setting_cancelnotification_request extends baserequest -{ - public $url; -} - -class user_add_request extends baserequest -{ - public $PartnerCode; - public $CustomPartnerCode; - public $AuthenticationToken; - public $PartnerEmail; - public $isEnabled; -} - -class user_activate_request extends baserequest -{ - public $PartnerCode; - public $CustomPartnerCode; - public $AuthenticationToken; - public $PartnerEmail; - public $isEnabled; -} - -class user_deactivate_request extends baserequest -{ - public $PartnerCode; - public $CustomPartnerCode; - public $AuthenticationToken; - public $PartnerEmail; - public $isEnabled; -} - -class user_query_request extends baserequest -{ - public $SubUserID; - public $StartDate; - public $EndDate; -} - -class user_newuser_request extends baserequest -{ - public $Email; - public $Password; - public $FirstName; - public $LastName; - public $AlternateEmail; - public $CompanyName; - public $Street; - public $CountryName; - public $State; - public $City; - public $Zip; - public $Phone; - public $Fax; - public $Mobile; - public $UserType; - public $HearedBy; -} -class order_replacement_request extends baserequest -{ - /* public $CustomOrderID; - public $TheSSLStoreOrderID; - public $ActionType; - public $Status; - public $ReplaceByDate; - public $PageNumber; - public $PageSize;*/ -} + + * Date: 2/27/12 + * Time: 7:27 AM + * This file is created by www.thesslstore.com for your use. You are free to change the file as per your needs. + */ + +include_once "abstractions.php"; + +class csr_request extends baserequest +{ + public $ProductCode = ''; + public $CSR = ''; +} + +class ssl_validation_request extends baserequest +{ + public $Domainname; +} + +class whois_request extends baserequest +{ + public $Domainname; +} + +class free_claimfree_request extends baserequest +{ + public function __construct() + { + $this->NewOrderRequest = new order_neworder_request_freeproduct(); + parent::__construct(); + } + public $ProductCode; + public $RelatedTheSSLStoreOrderID; + public $NewOrderRequest; +} + + +class free_cuinfo_request extends baserequest +{ + public function __construct() + { + $this->OrganizationInfo = new OrganizationInfo(); + $this->OrganizationInfo->OrganizationAddress = new OrganizationAddress(); + $this->AdminContact = new contact(); + $this->TechnicalContact = new contact(); + parent::__construct(); + } + + public $CustomOrderID; + public $ProductCode; + public $ExtraProductCodes; + public $OrganizationInfo; + public $ValidityPeriod; + public $ServerCount; + public $CSR; + public $DomainName; + public $WebServerType; + public $DNSNames; + public $isCUOrder; + public $isRenewalOrder; + public $SpecialInstructions; + public $RelatedTheSSLStoreOrderID; + public $isTrialOrder; + public $AdminContact; + public $TechnicalContact; + public $ApproverEmail; + public $ReserveSANCount; + public $AddInstallationSupport; + public $EmailLanguageCode; + public $FileAuthDVIndicator; + public $CNAMEAuthDVIndicator; + public $HTTPSFileAuthDVIndicator; + public $SignatureHashAlgorithm; +} + +class health_validate_request +{ + public $PartnerCode; + public $AuthToken; + public $ReplayToken; + public $UserAgent; +} + +class health_validate_token_request +{ + public $Token; + public $TokenID; + public $TokenCode; + public $IsUsedForTokenSystem = true; +} + +class order_agreement_request extends baserequest +{ + public function __construct() + { + $this->OrganizationInfo = new OrganizationInfo(); + $this->OrganizationInfo->OrganizationAddress = new OrganizationAddress(); + parent::__construct(); + } + public $CustomOrderID; + public $ProductCode; + public $ExtraProductCodes; + public $OrganizationInfo; + public $ValidityPeriod; + public $ServerCount; + public $CSR; + public $DomainName; + public $WebServerType; +} + +class order_download_request extends baserequest +{ + public $CustomOrderID; + public $TheSSLStoreOrderID; + public $ResendEmailType; + public $ResendEmail; + public $RefundReason; + public $RefundRequestID; + public $ApproverMethod; + public $DomainNames; + public $SerialNumber; + public $ReturnPKCS7Cert; + public $DateTimeCulture; +} + +class order_download_zip_request extends baserequest +{ + public $CustomOrderID; + public $TheSSLStoreOrderID; + public $ResendEmailType; + public $ResendEmail; + public $RefundReason; + public $RefundRequestID; + public $ApproverMethod; + public $DomainNames; + public $SerialNumber; + public $ReturnPKCS7Cert; + public $DateTimeCulture; +} + +class order_inviteorder_request extends baserequest +{ + public $PreferVendorLink; + public $ProductCode; + public $ExtraProductCode; + public $ServerCount; + public $RequestorEmail; + public $ExtraSAN; + public $CustomOrderID; + public $ValidityPeriod; + public $AddInstallationSupport; + public $SignatureHashAlgorithm; + public $EmailLanguageCode; + public $PreferSendOrderEmails; + public $CertTransparencyIndicator; + public $DateTimeCulture; +} + +class order_neworder_request extends baserequest +{ + public function __construct() + { + $this->OrganizationInfo = new OrganizationInfo(); + $this->OrganizationInfo->OrganizationAddress = new OrganizationAddress(); + $this->AdminContact= new contact(); + $this->TechnicalContact= new contact(); + parent::__construct(); + } + public $CustomOrderID; + public $ProductCode; + public $ExtraProductCodes; + public $OrganizationInfo; + public $ValidityPeriod; + public $ServerCount; + public $CSR; + public $DomainName; + public $WebServerType; + public $DNSNames; + public $isCUOrder; + public $isRenewalOrder; + public $SpecialInstructions; + public $RelatedTheSSLStoreOrderID; + public $isTrialOrder; + public $AdminContact; + public $TechnicalContact; + public $ApproverEmail; + public $ReserveSANCount; + public $AddInstallationSupport; + public $EmailLanguageCode; + public $FileAuthDVIndicator; + public $CNAMEAuthDVIndicator; + public $HTTPSFileAuthDVIndicator; + public $SignatureHashAlgorithm; + public $CertTransparencyIndicator; + public $RenewalDays; + public $DateTimeCulture; + public $CSRUniqueValue; + public $PreOrganizationId; +} + + +class order_neworder_request_freeproduct extends baserequest +{ + public function __construct() + { + $this->TechnicalContact= new contact(); + parent::__construct(); + } + + public $TechnicalContact; + +} +class order_validate_request extends baserequest +{ + public $CSR; + public $ProductCode; + public $ServerCount; + public $ValidityPeriod; + public $WebServerType; +} +class order_query_request extends baserequest +{ + public $StartDate; + public $EndDate; + public $CertificateExpireToDate; + public $CertificateExpireFromDate; + public $DomainName; + public $SubUserID; + public $ProductCode; + public $DateTimeCulture; + public $PageNumber; + public $PageSize; +} + +class order_modified_summary_request extends baserequest +{ + public $SubUserID; + public $StartDate; + public $EndDate; + public $PageNumber; + public $PageSize; +} + +class order_certificaterevokerequest_request extends baserequest +{ + public $CustomOrderID; + public $TheSSLStoreOrderID; + public $ResendEmail; + public $SerialNumber; +} + +class order_vulnerabilityscanrequest_request extends baserequest +{ + public $CustomOrderID; + public $TheSSLStoreOrderID; + public $ActionType; +} + +class order_refundrequest_request extends baserequest +{ + public $CustomOrderID; + public $TheSSLStoreOrderID; + public $ResendEmailType; + public $ResendEmail; + public $RefundReason; + public $RefundRequestID; + public $ApproverMethod; + public $DomainNames; + public $SerialNumber; +} + +class order_refundstatus_request extends baserequest +{ + public $CustomOrderID; + public $TheSSLStoreOrderID; + public $ResendEmailType; + public $ResendEmail; + public $RefundReason; + public $RefundRequestID; + public $ApproverMethod; + public $DomainNames; + public $SerialNumber; +} + +class order_reissue_request extends baserequest +{ + public function __construct() + { + $this->EditSAN = array(); + $this->DeleteSAN = array(); + $this->AddSAN = array(); + parent::__construct(); + } + public $TheSSLStoreOrderID; + public $CSR; + public $WebServerType; + public $DNSNames; + public $SpecialInstructions; + public $EditSAN; + public $DeleteSAN; + public $AddSAN; + public $isWildCard; + public $ReissueEmail; + public $PreferEnrollmentLink; + public $SignatureHashAlgorithm; + public $FileAuthDVIndicator; + public $HTTPSFileAuthDVIndicator; + public $CNAMEAuthDVIndicator; + public $ApproverEmails; + public $CertTransparencyIndicator; + public $DateTimeCulture; + public $CSRUniqueValue; +} + +class order_resend_request extends baserequest +{ + public $CustomOrderID; + public $TheSSLStoreOrderID; + public $ResendEmailType; + public $ResendEmail; + public $RefundReason; + public $RefundRequestID; + public $ApproverMethod; + public $DomainNames; + public $SerialNumber; +} + +class order_approverlist_request extends baserequest +{ + + public $ProductCode; + public $DomainName; +} + +class order_changeapproveremail_request extends baserequest +{ + public $TheSSLStoreOrderID; + public $ResendEmail; + public $ApproverMethod; + public $DomainNames; +} + +class order_change_approver_method_request extends baserequest +{ + public $CustomOrderID; + public $TheSSLStoreOrderID; + public $ResendEmailType; + public $ResendEmail; + public $RefundReason; + public $RefundRequestID; + public $ApproverMethod; + public $DomainNames; + public $SerialNumber; +} + +class order_status_request extends baserequest +{ + public $CustomOrderID; + public $TheSSLStoreOrderID; + public $ResendEmailType; + public $ResendEmail; + public $RefundReason; + public $RefundRequestID; + public $ApproverMethod; + public $DomainNames; + public $SerialNumber; + public $ReturnPKCS7Cert; + public $DateTimeCulture; +} + +class order_pmr_request extends baserequest{ + public $TheSSLStoreOrderID; +} + + +class product_query_request extends baserequest +{ + public $ProductCode; + public $ProductType; + public $NeedSortedList; +} + +class setting_setordercallback_request extends baserequest +{ + public $url; +} + +class setting_setpricecallback_request extends baserequest +{ + public $url; +} + +class setting_settemplate_request extends baserequest +{ + public $EmailSubject; + public $EmailMessage; + public $isDisabled; + public $EmailTemplateTypes; +} + +class setting_cancelnotification_request extends baserequest +{ + public $url; +} + +class user_add_request extends baserequest +{ + public $PartnerCode; + public $CustomPartnerCode; + public $AuthenticationToken; + public $PartnerEmail; + public $isEnabled; +} + +class user_activate_request extends baserequest +{ + public $PartnerCode; + public $CustomPartnerCode; + public $AuthenticationToken; + public $PartnerEmail; + public $isEnabled; +} + +class user_deactivate_request extends baserequest +{ + public $PartnerCode; + public $CustomPartnerCode; + public $AuthenticationToken; + public $PartnerEmail; + public $isEnabled; +} + +class user_query_request extends baserequest +{ + public $SubUserID; + public $StartDate; + public $EndDate; +} + +class user_newuser_request extends baserequest +{ + public $Email; + public $Password; + public $FirstName; + public $LastName; + public $AlternateEmail; + public $CompanyName; + public $Street; + public $CountryName; + public $State; + public $City; + public $Zip; + public $Phone; + public $Fax; + public $Mobile; + public $UserType; + public $HearedBy; +} + +class order_replacement_request extends baserequest +{ + /* public $CustomOrderID; + public $TheSSLStoreOrderID; + public $ActionType; + public $Status; + public $ReplaceByDate; + public $PageNumber; + public $PageSize;*/ +} + +class user_account_detail_request extends baserequest +{ + public $PartnerCode; + public $AuthToken; + public $ReplayToken; + public $UserAgent; + public $IPAddress; +} + +class csr_download_request extends baseRequest{ + public $CustomOrderID; + public $TheSSLStoreOrderID; +} + +class cwatch_product_list_request extends baserequest{ + public $ProductCode; +} + +class cwatch_invite_order_request extends baserequest +{ + public $ProductCode; + public $RequestorEmail; + public $CustomOrderID; + public $ValidityPeriod; + public $EmailLanguageCode; + public $PreferSendOrderEmails; +} + +class cwatch_new_order_request extends baserequest +{ + public function __construct(){ + $this->AdminContact = new cwatch_admin_contact(); + parent::__construct(); + } + public $autoLicenseUpgrade; + public $automaticRenewal; + public $CustomOrderID; + public $ProductCode; + public $ValidityPeriod; + public $DomainName; + public $SpecialInstructions; + public $AdminContact; + public $ApproverEmail; + public $EmailLanguageCode; +} + +class cwatch_update_site_request extends baserequest{ + public $TheSSLStoreOrderID; + public $DomainName; +} + +class cwatch_upgrade_license_request extends baserequest{ + public $TheSSLStoreOrderID; + public $ValidityPeriod; + public $ProductCode; +} + + +class digicert_create_organization_request extends baserequest{ + public function __construct(){ + $this->OrganizationContact = new digicert_organization_contact(); + $this->ApproversContact = new digicert_organization_contact(); + parent::__construct(); + } + public $Name; + public $AssumedName; + public $Address; + public $Address2; + public $Zip; + public $City; + public $State; + public $Country; + public $Organization_Phone; + public $OrganizationContact; + public $ApproversContatct; +} + +class digicert_get_organization_request extends baserequest{ + public $OrganizationId; +} + +class digicert_organization_list_request extends baserequest{ + +} + +class digicert_set_approver_method_request extends baserequest{ + public $DomainName; + public $PreOrganizationId; + public $TheSSLStoreOrderID; + public $ValidationsTypes; + public $ApproverMethod; +} + +class digicert_get_domain_request extends baseRequest{ + public $DomainName; + public $TheSSLStoreOrderID; +} + diff --git a/api/responses.php b/api/responses.php index 2724ccf..f71cf76 100644 --- a/api/responses.php +++ b/api/responses.php @@ -1,319 +1,453 @@ - - * Date: 2/27/12 - * Time: 7:27 AM - * This file is created by www.thesslstore.com for your use. You are free to change the file as per your needs. - */ - -include_once "abstractions.php"; - -class csr_response extends baseresponse -{ - public $DomainName; - public $DNSNames; - public $Country; - public $Email; - public $Locality; - public $Organization; - public $OrganizationUnit; - public $State; - public $hasBadExtensions = false; - public $isValidDomainName = false; - public $isWildcardCSR = false; - public $MD5Hash; - public $SHA1Hash; - public $RegionSpecificOrderIndicator; -} - -class ssl_validation_response extends baseresponse -{ - public $DomainName; - public $CommonName; - public $ChainRoot; - public $Subject; - public $Organization; - public $OrganizationUnit; - public $Country; - public $State; - public $Location; - public $SerialNumber; - public $PublicKey; - public $KeySize; - public $Issuer; - public $IssuerName; - public $KeyAlgorithmParameters; - public $KeyAlgorithm; - public $HashCode; - public $Format; - public $ExpirationDate; - public $EffectiveDate; - public $SANs; - public $Version; - public $ThumbPrint; - public $SignatureAlgorithm; - public $CertHash; - public $CertificateType; - public $Verify; - -} - -class whois_response extends baseresponse -{ - public $WhoisDetails; -} - -class free_claimfree_response extends baseresponse -{ - public $isAllowed; - public $PartnerOrderID; - public $LoginName; - public $LoginPassword; -} - -class free_cuinfo_response extends baseresponse -{ - public $isSupported; - public $Months; - public $SerialNumber; - public $ExpirationDate; - public $Issuer; -} - -class health_validate_response -{ - public $Status; -} - -class health_validate_token_response extends baseresponse -{ - public function __construct() - { - $this->OrderStatus = new orderStatus(); - parent::__construct(); - } - public $ProductName; - public $ProductCode; - public $San; - public $OrderStatus; - public $NumberOfMonths; - public $ServerCount; - public $isRenewalOrder; - public $ProductType; - public $VendorName; -} - - -class order_response extends baseresponse -{ - public function __construct() - { - $this->OrderStatus = new orderStatus(); - $this->AdminContact = new contact(); - $this->TechnicalContact = new contact(); - parent::__construct(); - } - public $PartnerOrderID; - public $CustomOrderID; - public $TheSSLStoreOrderID; - public $VendorOrderID; - public $RefundRequestID; - public $isRefundApproved; - public $TinyOrderLink; - public $OrderStatus; - public $OrderAmount; - public $PurchaseDate; - public $CertificateStartDate; - public $CertificateEndDate; - public $CommonName; - public $DNSNames; - public $SANCount; - public $ServerCount; - public $Validity; - public $Organization; - public $OrganizationalUnit; - public $State; - public $Country; - public $Locality; - public $OrganizationPhone; - public $OrganizationAddress; - public $OrganizationPostalcode; - public $DUNS; - public $WebServerType; - public $ApproverEmail; - public $ProductName; - public $AdminContact; - public $TechnicalContact; - public $ReissueSuccessCode; - public $AuthFileName; - public $AuthFileContent; - public $PollStatus; - public $PollDate; - public $CustomerLoginName; - public $CustomerPassword; - public $CustomerID; - public $TokenID; - public $TokenCode; - public $SiteSealurl; - public $CNAMEAuthName; - public $CNAMEAuthValue; - public $SignatureEncryptionAlgorithm; - public $SignatureHashAlgorithm; - public $VendorName; - public $SubVendorName; - public $Token; - public $SerialNumber; - public $CertificateStartDateInUTC; - public $CertificateEndDateInUTC; - public $PurchaseDateInUTC; - public $PollDateInUTC; -} - -class order_approverlist_response extends baseresponse -{ - public $ApproverEmailList; -} - -class order_agreement_response extends baseresponse -{ - public $Agreement; -} - -class user_subuser_response extends baseresponse -{ - public $PartnerCode; - public $CustomPartnerCode; - public $AuthenticationToken; - public $PartnerEmail; - public $isEnabled; - - -} - -class order_download_response extends baseresponse -{ - public $PartnerOrderID; - public $CertificateStatus; - public $ValidationStatus; - public $Certificates; - public $CertificateStartDate; - public $CertificateEndDate; - public $CertificateStartDateInUTC; - public $CertificateEndDateInUTC; -} - -class order_download_zip_response extends baseresponse -{ - public $PartnerOrderID; - public $CertificateStatus; - public $ValidationStatus; - public $Zip; - public $pkcs7zip; - public $CertificateStartDate; - public $CertificateEndDate; - public $CertificateStartDateInUTC; - public $CertificateEndDateInUTC; -} - -class order_query_response extends baseresponse -{ - public function __construct() - { - $this->OrderStatus = new orderStatus(); - $this->AdminContact = new contact(); - $this->TechnicalContact = new contact(); - parent::__construct(); - } - public $PartnerOrderID; - public $CustomOrderID; - public $TheSSLStoreOrderID; - public $VendorOrderID; - public $RefundRequestID; - public $isRefundApproved; - public $TinyOrderLink; - public $OrderStatus; - public $OrderAmount; - public $PurchaseDate; - public $CertificateStartDate; - public $CertificateEndDate; - public $CommonName; - public $DNSNames; - public $SANCount; - public $ServerCount; - public $Validity; - public $Organization; - public $OrganizationalUnit; - public $State; - public $Country; - public $Locality; - public $OrganizationPhone; - public $OrganizationAddress; - public $OrganizationPostalcode; - public $DUNS; - public $WebServerType; - public $ApproverEmail; - public $ProductName; - public $AdminContact; - public $TechnicalContact; - public $ReissueSuccessCode; - public $AuthFileName; - public $AuthFileContent; - public $PollStatus; - public $PollDate; - public $CustomerLoginName; - public $CustomerPassword; - public $CustomerID; - public $TokenID; - public $TokenCode; - public $SiteSealurl; - public $CNAMEAuthName; - public $CNAMEAuthValue; - public $SignatureEncryptionAlgorithm; - public $SignatureHashAlgorithm; - public $VendorName; - public $SubVendorName; - public $Token; - public $SerialNumber; - public $CertificateStartDateInUTC; - public $CertificateEndDateInUTC; - public $PurchaseDateInUTC; - public $PollDateInUTC; -} - -class user_newuser_response extends baseresponse -{ - public $PartnerCode; - public $isEnabled; -} -class user_query_response extends baseresponse -{ - public $PartnerCode; - public $CustomePartnerCode; - public $AuthenticationToken; - public $PartnerEmail; - public $isEnabled; -} -class order_vulnerabilityscanrequest_response extends baseresponse -{ - public $VulnerabilityScanDetails; -} -class order_replacement_response extends baseresponse -{ - /*public $PartnerOrderID; - public $TheSSLStoreOrderID; - public $VendorOrderID; - public $OrderStatus; - public $OrderAmount; - public $CertificateStartDate; - public $CertificateEndDate; - public $CommonName; - public $DNSNames; - public $State; - public $Country; - public $Locality; - public $Organization; - public $OrganizationalUnit; - public $WebServerType; - public $ReissueSuccessCode; - public $SiteSealurl;*/ -} + + * Date: 2/27/12 + * Time: 7:27 AM + * This file is created by www.thesslstore.com for your use. You are free to change the file as per your needs. + */ + +include_once "abstractions.php"; + +class csr_response extends baseresponse +{ + public $DomainName; + public $DNSNames; + public $Country; + public $Email; + public $Locality; + public $Organization; + public $OrganizationUnit; + public $State; + public $hasBadExtensions = false; + public $isValidDomainName = false; + public $isWildcardCSR = false; + public $MD5Hash; + public $SHA1Hash; + public $sha256; + public $RegionSpecificOrderIndicator; +} + +class ssl_validation_response extends baseresponse +{ + public $DomainName; + public $CommonName; + public $ChainRoot; + public $Subject; + public $Organization; + public $OrganizationUnit; + public $Country; + public $State; + public $Location; + public $SerialNumber; + public $PublicKey; + public $KeySize; + public $Issuer; + public $IssuerName; + public $KeyAlgorithmParameters; + public $KeyAlgorithm; + public $HashCode; + public $Format; + public $ExpirationDate; + public $EffectiveDate; + public $SANs; + public $Version; + public $ThumbPrint; + public $SignatureAlgorithm; + public $CertHash; + public $CertificateType; + public $Verify; + +} + +class whois_response extends baseresponse +{ + public $WhoisDetails; +} + +class free_claimfree_response extends baseresponse +{ + public $isAllowed; + public $PartnerOrderID; + public $TheSSLStoreOrderID; + public $VendorOrderID; + public $LoginName; + public $LoginPassword; +} + +class free_cuinfo_response extends baseresponse +{ + public $isSupported; + public $Months; + public $SerialNumber; + public $ExpirationDate; + public $Issuer; +} + +class health_validate_response +{ + public $Status; +} + +class health_validate_token_response extends baseresponse +{ + public function __construct() + { + $this->OrderStatus = new orderStatus(); + parent::__construct(); + } + public $ProductName; + public $ProductCode; + public $San; + public $OrderStatus; + public $NumberOfMonths; + public $ServerCount; + public $isRenewalOrder; + public $ProductType; + public $VendorName; +} + + + + +class order_response extends baseresponse +{ + public function __construct() + { + $this->OrderStatus = new orderStatus(); + $this->AdminContact = new contact(); + $this->TechnicalContact = new contact(); + parent::__construct(); + } + public $PartnerOrderID; + public $CustomOrderID; + public $TheSSLStoreOrderID; + public $VendorOrderID; + public $RefundRequestID; + public $isRefundApproved; + public $TinyOrderLink; + public $OrderStatus; + public $OrderAmount; + public $PurchaseDate; + public $CertificateStartDate; + public $CertificateEndDate; + public $CommonName; + public $DNSNames; + public $SANCount; + public $ServerCount; + public $Validity; + public $Organization; + public $OrganizationalUnit; + public $State; + public $Country; + public $Locality; + public $OrganizationPhone; + public $OrganizationAddress; + public $OrganizationPostalcode; + public $DUNS; + public $WebServerType; + public $ApproverEmail; + public $ProductName; + public $AdminContact; + public $TechnicalContact; + public $ReissueSuccessCode; + public $AuthFileName; + public $AuthFileContent; + public $PollStatus; + public $PollDate; + public $CustomerLoginName; + public $CustomerPassword; + public $CustomerID; + public $TokenID; + public $TokenCode; + public $SiteSealurl; + public $CNAMEAuthName; + public $CNAMEAuthValue; + public $SignatureEncryptionAlgorithm; + public $SignatureHashAlgorithm; + public $VendorName; + public $SubVendorName; + public $Token; + public $SerialNumber; + public $CertificateStartDateInUTC; + public $CertificateEndDateInUTC; + public $PurchaseDateInUTC; + public $PollDateInUTC; + public $PreOrganizationId; +} + +class order_approverlist_response extends baseresponse +{ + public $ApproverEmailList; +} + +class order_agreement_response extends baseresponse +{ + public $Agreement; +} + +class user_subuser_response extends baseresponse +{ + public $PartnerCode; + public $CustomPartnerCode; + public $AuthenticationToken; + public $PartnerEmail; + public $isEnabled; + + +} + +class order_download_response extends baseresponse +{ + public $PartnerOrderID; + public $CertificateStatus; + public $ValidationStatus; + public $Certificates; + public $CertificateStartDate; + public $CertificateEndDate; + public $CertificateStartDateInUTC; + public $CertificateEndDateInUTC; +} + +class order_download_zip_response extends baseresponse +{ + public $PartnerOrderID; + public $CertificateStatus; + public $ValidationStatus; + public $Zip; + public $pkcs7zip; + public $CertificateStartDate; + public $CertificateEndDate; + public $CertificateStartDateInUTC; + public $CertificateEndDateInUTC; +} + +class order_query_response extends baseresponse +{ + public function __construct() + { + $this->OrderStatus = new orderStatus(); + $this->AdminContact = new contact(); + $this->TechnicalContact = new contact(); + parent::__construct(); + } + public $PartnerOrderID; + public $CustomOrderID; + public $TheSSLStoreOrderID; + public $VendorOrderID; + public $RefundRequestID; + public $isRefundApproved; + public $TinyOrderLink; + public $OrderStatus; + public $OrderAmount; + public $PurchaseDate; + public $CertificateStartDate; + public $CertificateEndDate; + public $CommonName; + public $DNSNames; + public $SANCount; + public $ServerCount; + public $Validity; + public $Organization; + public $OrganizationalUnit; + public $State; + public $Country; + public $Locality; + public $OrganizationPhone; + public $OrganizationAddress; + public $OrganizationPostalcode; + public $DUNS; + public $WebServerType; + public $ApproverEmail; + public $ProductName; + public $AdminContact; + public $TechnicalContact; + public $ReissueSuccessCode; + public $AuthFileName; + public $AuthFileContent; + public $PollStatus; + public $PollDate; + public $CustomerLoginName; + public $CustomerPassword; + public $CustomerID; + public $TokenID; + public $TokenCode; + public $SiteSealurl; + public $CNAMEAuthName; + public $CNAMEAuthValue; + public $SignatureEncryptionAlgorithm; + public $SignatureHashAlgorithm; + public $VendorName; + public $SubVendorName; + public $Token; + public $SerialNumber; + public $CertificateStartDateInUTC; + public $CertificateEndDateInUTC; + public $PurchaseDateInUTC; + public $PollDateInUTC; +} + +class order_modified_summary_response extends baseresponse{ + public $Orders; + public $TotalOrders; +} + +class order_pmr_response extends baseresponse{ + public $TheSSLStoreOrderID; + public $PMRStatus; + public $ExpediteDate; +} + +class user_newuser_response extends baseresponse +{ + public $PartnerCode; + public $isEnabled; +} + +class user_account_detail_response extends baseresponse +{ + public $PartnerCode; + public $CompanyName; + public $FullName; + public $Email; + public $AlternateEmail; + public $AccountType; + public $AccountBalance; + public $CurrentPlan; + public $AllowCredit; + public $Address; + public $City; + public $Country; + public $Phone; + public $State; + public $Zip; +} + +class user_query_response extends baseresponse +{ + public $PartnerCode; + public $CustomePartnerCode; + public $AuthenticationToken; + public $PartnerEmail; + public $isEnabled; +} +class order_vulnerabilityscanrequest_response extends baseresponse +{ + public $VulnerabilityScanDetails; +} +class order_replacement_response extends baseresponse +{ + /*public $PartnerOrderID; + public $TheSSLStoreOrderID; + public $VendorOrderID; + public $OrderStatus; + public $OrderAmount; + public $CertificateStartDate; + public $CertificateEndDate; + public $CommonName; + public $DNSNames; + public $State; + public $Country; + public $Locality; + public $Organization; + public $OrganizationalUnit; + public $WebServerType; + public $ReissueSuccessCode; + public $SiteSealurl;*/ +} +class csr_download_response extends baseresponse{ + public $CSR; +} + +class cwatch_order_response extends baseresponse{ + + public function __construct() + { + $this->OrderStatus = new orderStatus(); + $this->AdminContact = new cwatch_admin_contact(); + parent::__construct(); + } + public $PartnerOrderID; + public $CustomOrderID; + public $TheSSLStoreOrderID; + public $VendorOrderID; + public $RefundRequestID; + public $isRefundApproved; + public $TinyOrderLink; + public $OrderStatus; + public $OrderAmount; + public $PurchaseDate; + public $LicenseStartDate; + public $LicenseEndDate; + public $DomainName; + public $Validity; + public $ApproverEmail; + public $ProductName; + public $ProductCode; + public $AdminContact; + public $Token; + public $LicenseKey; +} + +class digicert_create_organization_response extends baseresponse{ + public $VendorOrganizationId; + public $VendorApproversContactId; + public $OrganizationId; + public $ValidationsTypes; +} + +class digicert_get_organization_response extends baseresponse{ + + public function __construct(){ + $this->OrganizationContact = new digicert_organization_contact(); + $this->ApproversContact = new digicert_organization_contact(); + parent::__construct(); + } + public $Name; + public $AssumedName; + public $Address; + public $Address2; + public $Zip; + public $City; + public $State; + public $Country; + public $Organization_Phone; + public $OrganizationContact; + public $ApproversContatct; + public $VendorOrganizationId; + public $OrganizationId; + public $VendorOrgContactId; + public $VendorApproversContactId; + public $Status; + public $isActive; +} + +class digicert_set_approver_method_response extends baseresponse{ + + public function __construct(){ + $this->dcvDetails = new digicert_dcv_details(); + parent::__construct(); + } + public $DomainName; + public $preOrganizationId; + public $TheSSLStoreOrderID; + public $domain_id; + public $domain_status; + public $ValidationsTypes; + public $date_created; + public $dcvDetails; +} + +class digicert_get_domain_resonse extends baseresponse{ + public function __construct(){ + $this->dcvDetails = new digicert_dcv_details(); + parent::__construct(); + } + public $DomainName; + public $domain_status; + public $date_created; + public $domain_isactive; + public $TheSSLStoreOrderID; + public $OrganizationDetails; + public $dcvDetails; + public $validations; +} \ No newline at end of file diff --git a/api/thesslstoreApi.php b/api/thesslstoreApi.php index 55a9152..051a454 100644 --- a/api/thesslstoreApi.php +++ b/api/thesslstoreApi.php @@ -25,39 +25,39 @@ class thesslstoreApi private $_IsUsedForTokenSystem=false; private $_userAgent=''; - function __construct($partnerCode,$authToken,$token,$tokenID,$tokenCode,$IsUsedForTokenSystem,$apimode, $userAgent = 'Blesta-1.4.0') + function __construct($partnerCode,$authToken,$token,$tokenID,$tokenCode,$IsUsedForTokenSystem,$apimode, $userAgent = 'Blesta-1.8.0') { - $this->EnsurePHPVersion(); - $this->_apimode = $apimode; - $this->_partnerCode = $partnerCode; - $this->_authToken = $authToken; - $this->_token = $token; - $this->_tokenID = $tokenID; - $this->_tokenCode = $tokenCode; - $this->_IsUsedForTokenSystem = $IsUsedForTokenSystem; - $this->_userAgent = $userAgent; + $this->EnsurePHPVersion(); + $this->_apimode = $apimode; + $this->_partnerCode = $partnerCode; + $this->_authToken = $authToken; + $this->_token = $token; + $this->_tokenID = $tokenID; + $this->_tokenCode = $tokenCode; + $this->_IsUsedForTokenSystem = $IsUsedForTokenSystem; + $this->_userAgent = $userAgent; } public function EnsurePHPVersion() { - if(floatval(phpversion())< 5.2) - { - throw new Exception('Not Supported version of PHP. Requires atleast 5.2 or greater version of PHP.'); - } + if(floatval(phpversion())< 5.2) + { + throw new Exception('Not Supported version of PHP. Requires atleast 5.2 or greater version of PHP.'); + } } private function getAPIRequest() { - $AuthRequest = new apirequest(); - $AuthRequest->AuthToken = $this->_authToken; - $AuthRequest->PartnerCode = $this->_partnerCode; - $AuthRequest->UserAgent = $this->_userAgent; - $AuthRequest->Token = $this->_token; - $AuthRequest->TokenID = $this->_tokenID; - $AuthRequest->TokenCode = $this->_tokenCode; - $AuthRequest->IsUsedForTokenSystem = $this->_IsUsedForTokenSystem; - $AuthRequest->ReplayToken = uniqid('SSLSTORE-Blesta'); - return $AuthRequest; + $AuthRequest = new apirequest(); + $AuthRequest->AuthToken = $this->_authToken; + $AuthRequest->PartnerCode = $this->_partnerCode; + $AuthRequest->UserAgent = $this->_userAgent; + $AuthRequest->Token = $this->_token; + $AuthRequest->TokenID = $this->_tokenID; + $AuthRequest->TokenCode = $this->_tokenCode; + $AuthRequest->IsUsedForTokenSystem = $this->_IsUsedForTokenSystem; + $AuthRequest->ReplayToken = uniqid('SSLSTORE-Blesta'); + return $AuthRequest; } private function cloneObjectFromJson($obj,$jsonobj) @@ -73,38 +73,38 @@ private function cloneObjectFromJson($obj,$jsonobj) private function getCURL($url,$method,$message='') { - $ch = curl_init(); - if (!$ch) - { - die("Couldn't initialize a cURL handle"); - } - curl_setopt($ch, CURLOPT_URL,$url); - if($method=='POST') - { - curl_setopt($ch, CURLOPT_POST, 1); - } - else - { - curl_setopt($ch,CURLOPT_HTTPGET,1); - } - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); - if($message!='') - curl_setopt($ch, CURLOPT_POSTFIELDS,$message); //Append POST messages - curl_setopt($ch,CURLOPT_HTTPHEADER,array ("Content-Type: application/json; charset=utf-8")); - return $ch; + $ch = curl_init(); + if (!$ch) + { + die("Couldn't initialize a cURL handle"); + } + curl_setopt($ch, CURLOPT_URL,$url); + if($method=='POST') + { + curl_setopt($ch, CURLOPT_POST, 1); + } + else + { + curl_setopt($ch,CURLOPT_HTTPGET,1); + } + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); + if($message!='') + curl_setopt($ch, CURLOPT_POSTFIELDS,$message); //Append POST messages + curl_setopt($ch,CURLOPT_HTTPHEADER,array ("Content-Type: application/json; charset=utf-8")); + return $ch; } private function getCURLResponse($curl) { - $returnresp = new curlresponse(); - $returnresp->response = curl_exec($curl); - if(curl_errno($curl)) - $returnresp->error = curl_error($curl); - $returnresp->info = curl_getinfo($curl); - curl_close($curl); // close cURL handler - return $returnresp; //Return Result + $returnresp = new curlresponse(); + $returnresp->response = curl_exec($curl); + if(curl_errno($curl)) + $returnresp->error = curl_error($curl); + $returnresp->info = curl_getinfo($curl); + curl_close($curl); // close cURL handler + return $returnresp; //Return Result } private function postToCurl($url,$requestData,$responseData,$HttpMethod='POST') @@ -121,8 +121,8 @@ private function postToCurl($url,$requestData,$responseData,$HttpMethod='POST') die();*/ if($requestData!=null) $msg = json_encode($requestData); //SET JSON FORMAT if not null - $curl = $this->getCURL($url,$HttpMethod, $msg); - $response = $this->getCURLResponse($curl); + $curl = $this->getCURL($url,$HttpMethod, $msg); + $response = $this->getCURLResponse($curl); if(self::$LOG_ALLAPICALLS) { @@ -132,21 +132,21 @@ private function postToCurl($url,$requestData,$responseData,$HttpMethod='POST') file_put_contents($responsefile, $response); } if($response->error=='') - { - $respobj = json_decode($response->response); - if($responseData!=null) //Indicates if Casting required to a class type - $result = $this->cloneObjectFromJson($responseData,$respobj); + { + $respobj = json_decode($response->response); + if($responseData!=null) //Indicates if Casting required to a class type + $result = $this->cloneObjectFromJson($responseData,$respobj); else - $result = $respobj; //Returns raw response if not + $result = $respobj; //Returns raw response if not - if(isset($result->AuthRequest)) - { + if(isset($result->AuthRequest)) + { if($result->AuthResponse->ReplayToken!=$requestData->AuthRequest->ReplayToken) { - $result = $responseData; - die('Something wrong with API, ReplayTokens does not match!'); + $result = $responseData; + die('Something wrong with API, ReplayTokens does not match!'); } - } + } return $result; } else @@ -160,22 +160,22 @@ private function postToCurl($url,$requestData,$responseData,$HttpMethod='POST') } } - public function getURL() - { - if(strtoupper($this->_apimode)=='LIVE') - { - return 'https://api.thesslstore.com/rest'; - } - else + public function getURL() + { + if(strtoupper($this->_apimode)=='LIVE') + { + return 'https://api.thesslstore.com/rest'; + } + else { return 'https://sandbox-wbapi.thesslstore.com/rest'; } - } + } /** * @param csr_request $csr_request * @return csr_response - */ + */ public function csr($csr_request) { $url = $this->getURL() . '/csr/'; @@ -186,7 +186,7 @@ public function csr($csr_request) /** * @param ssl_validation_request $ssl_validation_request * @return ssl_validation_response - */ + */ public function ssl_validation($ssl_validation_request) { $url = $this->getURL() . '/sslchecker/'; @@ -197,7 +197,7 @@ public function ssl_validation($ssl_validation_request) /** * @param whois_request $whois_request * @return whois_response - */ + */ public function whois($whois_request) { $url = $this->getURL() . '/whois/'; @@ -208,7 +208,7 @@ public function whois($whois_request) /** * @param free_claimfree_request $free_claimfree_request * @return free_claimfree_response - */ + */ public function free_claimfree($free_claimfree_request) { $url = $this->getURL() . '/free/claimfree/'; @@ -219,7 +219,7 @@ public function free_claimfree($free_claimfree_request) /** * @param free_cuinfo_request $free_cuinfo_request * @return free_cuinfo_response - */ + */ public function free_cuinfo($free_cuinfo_request) { $url = $this->getURL() . '/free/cuinfo/'; @@ -228,10 +228,10 @@ public function free_cuinfo($free_cuinfo_request) } /** - * @return apiresponse - */ + * @return apiresponse + */ public function health_status() - { + { $url = $this->getURL() . '/health/status/'; $resp = new apiresponse(); return $this->postToCurl($url,null,$resp,'GET'); @@ -240,7 +240,7 @@ public function health_status() /** * @param health_validate_request $health_validate_request * @return health_validate_response - */ + */ public function health_validate($health_validate_request) { $url = $this->getURL() . '/health/validate/'; @@ -273,7 +273,7 @@ public function health_validate_token($health_validate_token_request) /** * @param order_agreement_request $order_agreement_request * @return string - */ + */ public function order_agreement($order_agreement_request) { $url = $this->getURL() . '/order/agreement/'; @@ -284,7 +284,7 @@ public function order_agreement($order_agreement_request) /** * @param order_neworder_request $order_approverlist_request * @return order_approverlist_response - */ + */ public function order_approverlist($order_approverlist_request) { $url = $this->getURL() . '/order/approverlist/'; @@ -295,7 +295,7 @@ public function order_approverlist($order_approverlist_request) /** * @param order_download_request $order_download_request * @return order_download_response - */ + */ public function order_download($order_download_request) { $url = $this->getURL() . '/order/download/'; @@ -318,7 +318,7 @@ public function order_download_zip($order_download_request) /** * @param order_inviteorder_request $order_inviteorder_request * @return order_response - */ + */ public function order_inviteorder($order_inviteorder_request) { $url = $this->getURL() . '/order/inviteorder/'; @@ -329,235 +329,280 @@ public function order_inviteorder($order_inviteorder_request) /** * @param order_neworder_request $order_neworder_request * @return order_response - */ + */ public function order_neworder($order_neworder_request) { - $url = $this->getURL() . '/order/neworder/'; - $resp = new order_response(); - return $this->postToCurl($url,$order_neworder_request,$resp); + $url = $this->getURL() . '/order/neworder/'; + $resp = new order_response(); + return $this->postToCurl($url,$order_neworder_request,$resp); + } + + /** + * @param order_neworder_request $order_neworder_request + * @return order_response + */ + public function order_midterm_upgrade($order_neworder_request) + { + $url = $this->getURL() . '/order/midtermupgrade/'; + $resp = new order_response(); + return $this->postToCurl($url,$order_neworder_request,$resp); } /** Should return array(order_response()) * @param order_query_request $order_query_request * @return object - */ + */ public function order_query($order_query_request) { - $url = $this->getURL() . '/order/query/'; - $resp = new order_query_response(); - return $this->postToCurl($url,$order_query_request,$resp); + $url = $this->getURL() . '/order/query/'; + $resp = new order_query_response(); + return $this->postToCurl($url,$order_query_request,$resp); + } + + /** Should return array(order_modified_summary_response()) + * @param order_modified_summary_request $order_modified_summary_request + * @return object + */ + public function order_modified_summary($order_modified_summary_request) + { + $url = $this->getURL() . '/order/getmodifiedorderssummary/'; + $resp = new order_modified_summary_response(); + return $this->postToCurl($url,$order_modified_summary_request,$resp); } /** * @param order_vulnerabilityscanrequest_request $order_refundrequest_request * @return order_vulnerabilityscanrequest_response - */ + */ public function order_certificaterevokerequest($order_certificaterevokerequest_request) { - $url = $this->getURL() . '/order/certificaterevokerequest/'; - $resp = new apiresponse(); - return $this->postToCurl($url,$order_certificaterevokerequest_request,$resp); + $url = $this->getURL() . '/order/certificaterevokerequest/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$order_certificaterevokerequest_request,$resp); } /** * @param order_vulnerabilityscanrequest_request $order_refundrequest_request * @return order_vulnerabilityscanrequest_response - */ + */ public function order_vulnerabilityscanrequest($order_vulnerabilityscanrequest_request) { - $url = $this->getURL() . '/order/vulnerabilityscanrequest/'; - $resp = new order_vulnerabilityscanrequest_response(); - return $this->postToCurl($url,$order_vulnerabilityscanrequest_request,$resp); + $url = $this->getURL() . '/order/vulnerabilityscanrequest/'; + $resp = new order_vulnerabilityscanrequest_response(); + return $this->postToCurl($url,$order_vulnerabilityscanrequest_request,$resp); } /** * @param order_refundrequest_request $order_refundrequest_request * @return order_response - */ + */ public function order_refundrequest($order_refundrequest_request) { - $url = $this->getURL() . '/order/refundrequest/'; - $resp = new order_response(); - return $this->postToCurl($url,$order_refundrequest_request,$resp); + $url = $this->getURL() . '/order/refundrequest/'; + $resp = new order_response(); + return $this->postToCurl($url,$order_refundrequest_request,$resp); } /** * @param order_refundstatus_request $order_refundstatus_request * @return order_response - */ + */ public function order_refundstatus($order_refundstatus_request) { - $url = $this->getURL() . '/order/refundstatus/'; - $resp = new order_response(); - return $this->postToCurl($url,$order_refundstatus_request,$resp); + $url = $this->getURL() . '/order/refundstatus/'; + $resp = new order_response(); + return $this->postToCurl($url,$order_refundstatus_request,$resp); } /** * @param order_reissue_request $order_reissue_request * @return order_response - */ + */ public function order_reissue($order_reissue_request) { - $url = $this->getURL() . '/order/reissue/'; - $resp = new order_response(); - return $this->postToCurl($url,$order_reissue_request,$resp); + $url = $this->getURL() . '/order/reissue/'; + $resp = new order_response(); + return $this->postToCurl($url,$order_reissue_request,$resp); } - /** + /** * @param order_changeapproveremail_request $order_changeapproveremail_request * @return apiresponse - */ + */ public function order_changeapproveremail($order_changeapproveremail_request) { - $url = $this->getURL() . '/order/changeapproveremail/'; - $resp = new apiresponse(); - return $this->postToCurl($url,$order_changeapproveremail_request,$resp); + $url = $this->getURL() . '/order/changeapproveremail/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$order_changeapproveremail_request,$resp); + } + + /** + * @param order_change_approver_method_request $order_change_approver_method_request + * @return apiresponse + */ + public function order_change_approver_method($order_change_approver_method_request) + { + $url = $this->getURL() . '/order/changeapprovermethod/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$order_change_approver_method_request,$resp); } /** * @param order_resend_request $order_resend_request * @return apiresponse - */ + */ public function order_resend($order_resend_request) { - $url = $this->getURL() . '/order/resend/'; - $resp = new apiresponse(); - return $this->postToCurl($url,$order_resend_request,$resp); + $url = $this->getURL() . '/order/resend/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$order_resend_request,$resp); } /** * @param order_status_request $order_status_request * @return order_response - */ + */ public function order_status($order_status_request) { - $url = $this->getURL() . '/order/status/'; - $resp = new order_response(); - return $this->postToCurl($url,$order_status_request,$resp); + $url = $this->getURL() . '/order/status/'; + $resp = new order_response(); + return $this->postToCurl($url,$order_status_request,$resp); } /** * @param order_neworder_request $order_validate_request * @return apiresponse - */ + */ public function order_validate($order_validate_request) { - $url = $this->getURL() . '/order/validate/'; - $resp = new apiresponse(); - return $this->postToCurl($url,$order_validate_request,$resp); + $url = $this->getURL() . '/order/validate/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$order_validate_request,$resp); + } + + /** + * @param order_pmr_request $order_pmr_request + * @return apiresponse + */ + public function order_pmr($order_pmr_request) + { + $url = $this->getURL() . '/order/pmrrequest/'; + $resp = new order_pmr_response(); + return $this->postToCurl($url,$order_pmr_request,$resp); + } /** * @param product_query_request $product_query_request * @return object - */ + */ public function product_query($product_query_request) { - $url = $this->getURL() . '/product/query/'; - $resp = new apiresponse(); - return $this->postToCurl($url,$product_query_request,$resp); + $url = $this->getURL() . '/product/query/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$product_query_request,$resp); } /** * @param setting_setordercallback_request $setting_setordercallback_request * @return apiresponse - */ + */ public function setting_setordercallback($setting_setordercallback_request) { - $url = $this->getURL() . '/setting/setordercallback/'; - $resp = new apiresponse(); - return $this->postToCurl($url,$setting_setordercallback_request,$resp); + $url = $this->getURL() . '/setting/setordercallback/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$setting_setordercallback_request,$resp); } /** * @param setting_setpricecallback_request $setting_setpricecallback_request * @return apiresponse - */ + */ public function setting_setpricecallback($setting_setpricecallback_request) { - $url = $this->getURL() . '/setting/setpricecallback/'; - $resp = new apiresponse(); - return $this->postToCurl($url,$setting_setpricecallback_request,$resp); + $url = $this->getURL() . '/setting/setpricecallback/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$setting_setpricecallback_request,$resp); } /** * @param setting_settemplate_request $setting_settemplate_request * @return apiresponse - */ + */ public function setting_settemplate($setting_settemplate_request) { - $url = $this->getURL() . '/setting/settemplate/'; - $resp = new apiresponse(); - return $this->postToCurl($url,$setting_settemplate_request,$resp); + $url = $this->getURL() . '/setting/settemplate/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$setting_settemplate_request,$resp); } /** * @param setting_cancelnotification_request $setting_cancelnotification_request * @return apiresponse - */ + */ public function setting_setcancelnotification($setting_cancelnotification_request) { - $url = $this->getURL() . '/setting/cancelnotification/'; - $resp = new apiresponse(); - return $this->postToCurl($url,$setting_cancelnotification_request,$resp); + $url = $this->getURL() . '/setting/cancelnotification/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$setting_cancelnotification_request,$resp); } /** * @param user_add_request $user_add_request * @return user_subuser_response - */ + */ public function user_add($user_add_request) { - $url = $this->getURL() . '/user/add/'; - $resp = new user_subuser_response(); - return $this->postToCurl($url,$user_add_request,$resp); + $url = $this->getURL() . '/user/add/'; + $resp = new user_subuser_response(); + return $this->postToCurl($url,$user_add_request,$resp); } /** * @param user_activate_request $user_activate_request * @return user_subuser_response - */ + */ public function user_activate($user_activate_request) { - $url = $this->getURL() . '/user/activate/'; - $resp = new user_subuser_response(); - return $this->postToCurl($url,$user_activate_request,$resp); + $url = $this->getURL() . '/user/activate/'; + $resp = new user_subuser_response(); + return $this->postToCurl($url,$user_activate_request,$resp); } /** * @param user_deactivate_request $user_deactivate_request * @return user_subuser_response - */ + */ public function user_deactivate($user_deactivate_request) { - $url = $this->getURL() . '/user/deactivate/'; - $resp = new user_subuser_response(); - return $this->postToCurl($url,$user_deactivate_request,$resp); + $url = $this->getURL() . '/user/deactivate/'; + $resp = new user_subuser_response(); + return $this->postToCurl($url,$user_deactivate_request,$resp); } /** * @param user_query_request $user_query_request * @return object - */ + */ public function user_query($user_query_request) { - $url = $this->getURL() . '/user/query/'; - $resp = new user_query_response(); - return $this->postToCurl($url,$user_query_request,$resp); + $url = $this->getURL() . '/user/query/'; + $resp = new user_query_response(); + return $this->postToCurl($url,$user_query_request,$resp); } /** * @param user_newuser_request $user_newuser_request * @return object - */ + */ public function user_newuser($user_newuser_request) { - $url = $this->getURL() . '/user/newuser/'; - $resp = new user_newuser_response(); - return $this->postToCurl($url,$user_newuser_request,$resp); + $url = $this->getURL() . '/user/newuser/'; + $resp = new user_newuser_response(); + return $this->postToCurl($url,$user_newuser_request,$resp); } /** @@ -571,8 +616,265 @@ public function order_replacement($order_replacement_request) return $this->postToCurl($url,$order_replacement_request,$resp); } + /** + * @param user_account_detail_request $user_account_detail_request + * @return user_account_detail_response + */ + public function user_account_detail($user_account_detail_request) + { + $url = $this->getURL() . '/user/accountdetail/'; + $resp = new user_account_detail_response(); + $apidetails = $this->getAPIRequest(); + + $user_account_detail_request->PartnerCode = $apidetails->PartnerCode; + $user_account_detail_request->AuthToken = $apidetails->AuthToken; + $user_account_detail_request->ReplayToken = $apidetails->ReplayToken; + $user_account_detail_request->UserAgent = $apidetails->UserAgent; + $user_account_detail_request->IPAddress = $apidetails->IPAddress; + + return $this->postToCurl($url,$user_account_detail_request,$resp); + } + + /** + * @param csr_download_request $csr_download_request + * @return csr_download_response + */ + public function csr_download($csr_download_request) + { + $url = $this->getURL() . '/csr/download/'; + $resp = new csr_download_response(); + return $this->postToCurl($url,$csr_download_request,$resp); + } + + /** + * @param cwatch_product_list_request $cwatch_product_list_request + * @return object + */ + public function cwatch_product_list($cwatch_product_list_request) + { + $url = $this->getURL() . '/cwatch/listproducts/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$cwatch_product_list_request,$resp); + } + + /** + * @param cwatch_invite_order_request $cwatch_invite_order_request + * @return cwatch_order_response + */ + public function cwatch_invite_order($cwatch_invite_order_request) + { + $url = $this->getURL() . '/cwatch/inviteorder/'; + $resp = new cwatch_order_response(); + return $this->postToCurl($url,$cwatch_invite_order_request,$resp); + } + + /** + * @param cwatch_new_order_request $cwatch_new_order_request + * @return cwatch_order_response + */ + public function cwatch_new_order($cwatch_new_order_request) + { + $url = $this->getURL() . '/cwatch/placeorder/'; + $resp = new cwatch_order_response(); + return $this->postToCurl($url,$cwatch_new_order_request,$resp); + } + + /** + * @param order_status_request $order_status_request + * @return cwatch_order_response + */ + public function cwatch_order_status($order_status_request) + { + $url = $this->getURL() . '/cwatch/getstatus/'; + $resp = new cwatch_order_response(); + return $this->postToCurl($url,$order_status_request,$resp); + } + + /** + * @param order_refundrequest_request $order_refundrequest_request + * @return cwatch_order_response + */ + public function cwatch_deactivate_license($order_refundrequest_request) + { + $url = $this->getURL() . '/cwatch/deactivatelicense/'; + $resp = new cwatch_order_response(); + return $this->postToCurl($url,$order_refundrequest_request,$resp); + } + + /** + * @param cwatch_update_site_request $update_site_request + * @return cwatch_order_response + */ + public function cwatch_update_site($update_site_request) + { + $url = $this->getURL() . '/cwatch/updatesite/'; + $resp = new cwatch_order_response(); + return $this->postToCurl($url,$update_site_request,$resp); + } + + /** + * @param cwatch_upgrade_license_request $upgrade_license_request + * @return cwatch_order_response + */ + public function cwatch_upgrade_license($upgrade_license_request) + { + $url = $this->getURL() . '/cwatch/upgradelicense/'; + $resp = new cwatch_order_response(); + return $this->postToCurl($url,$upgrade_license_request,$resp); + } + + /** + * @param digicert_create_organization_request $digicert_create_organization_request + * @return digicert_create_organization_response + */ + public function digicert_create_organization($digicert_create_organization_request) + { + $url = $this->getURL() . '/digicert/createorganization/'; + $resp = new digicert_create_organization_response(); + return $this->postToCurl($url,$digicert_create_organization_request,$resp); + } + + /** + * @param digicert_get_organization_request $digicert_get_organization_request + * @return digicert_get_organization_response + */ + public function digicert_get_organization_info($digicert_get_organization_request) + { + $url = $this->getURL() . '/digicert/organizationinfo/'; + $resp = new digicert_get_organization_response(); + return $this->postToCurl($url,$digicert_get_organization_request,$resp); + } + + /** + * @param order_inviteorder_request $order_inviteorder_request + * @return order_response + */ + public function digicert_inviteorder($order_inviteorder_request) + { + $url = $this->getURL() . '/digicert/inviteorder/'; + $resp = new order_response(); + return $this->postToCurl($url,$order_inviteorder_request,$resp); + } + + /** + * @param digicert_organization_list_request $digicert_organization_list_request + * @return digicert_organization_list_response + */ + public function digicert_organization_list($digicert_organization_list_request) + { + $url = $this->getURL() . '/digicert/organizationlist/'; + $resp = new digicert_get_organization_response(); + return $this->postToCurl($url,$digicert_organization_list_request,$resp); + } + + /** + * @param order_neworder_request $order_neworder_request + * @return order_response + */ + public function digicert_new_order($order_neworder_request) + { + $url = $this->getURL() . '/digicert/neworder/'; + $resp = new order_response(); + return $this->postToCurl($url,$order_neworder_request,$resp); + } + + /** + * @param order_reissue_request $order_reissue_request + * @return order_response + */ + public function digicert_order_reissue($order_reissue_request){ + $url = $this->getURL() . '/digicert/reissue/'; + $resp = new order_response(); + return $this->postToCurl($url,$order_reissue_request,$resp); + } + + /** + * @param order_status_request $order_status_request + * @return order_response + */ + public function digicert_order_status($order_status_request) + { + $url = $this->getURL() . '/digicert/status/'; + $resp = new order_response(); + return $this->postToCurl($url,$order_status_request,$resp); + } + + /** + * @param order_refundrequest_request $order_refundrequest_request + * @return order_response + */ + public function digicert_refundrequest($order_refundrequest_request) + { + $url = $this->getURL() . '/digicert/refundrequest/'; + $resp = new order_response(); + return $this->postToCurl($url,$order_refundrequest_request,$resp); + } + + /** + * @param order_resend_request $order_resend_request + * @return apiresponse + */ + public function digicert_order_resend($order_resend_request) + { + $url = $this->getURL() . '/digicert/resend/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$order_resend_request,$resp); + } + + /** + * @param digicert_set_approver_method_request $digicert_set_approver_method_request + * @return digicert_set_approver_method_response + */ + public function digicert_set_approver_method($digicert_set_approver_method_request) + { + $url = $this->getURL() . '/digicert/setapprovermethod/'; + $resp = new digicert_set_approver_method_response(); + return $this->postToCurl($url,$digicert_set_approver_method_request,$resp); + } + + /** + * @param order_change_approver_method_request $order_change_approver_method_request + * @return apiresponse + */ + public function digicert_change_approver_method($order_change_approver_method_request) + { + $url = $this->getURL() . '/digicert/changeapprovermethod/'; + $resp = new apiresponse(); + return $this->postToCurl($url,$order_change_approver_method_request,$resp); + } + /** + * @param order_neworder_request $order_approverlist_request + * @return order_approverlist_response + */ + public function digicert_get_approver_list($order_approverlist_request) + { + $url = $this->getURL() . '/digicert/approverlist/'; + $resp = new order_approverlist_response(); + return $this->postToCurl($url,$order_approverlist_request,$resp); + } + + /** + * @param digicert_get_domain_request $digicert_get_domain_request + * @return digicert_get_domain_resonse + */ + public function digicert_get_domain_info($digicert_get_domain_request) + { + $url = $this->getURL() . '/digicert/getdomaininfo/'; + $resp = new digicert_get_domain_resonse(); + return $this->postToCurl($url,$digicert_get_domain_request,$resp); + } + /** + * @param order_download_request $order_download_request + * @return order_download_zipresponse + */ + public function digicert_download_zip($order_download_request) + { + $url = $this->getURL() . '/digicert/downloadaszip/'; + $resp = new order_download_zip_response(); + return $this->postToCurl($url,$order_download_request,$resp); + } } class messagehelper diff --git a/language/en_us/thesslstore_module.php b/language/en_us/thesslstore_module.php index 814478d..78c2274 100644 --- a/language/en_us/thesslstore_module.php +++ b/language/en_us/thesslstore_module.php @@ -1,196 +1,258 @@ -Note:-The price of all the products will be setup base on the \"Base Conv. Rate\" of the selected Currency Code and %apicurrencycode% Currency Code. So please make sure that you have set up the correct \"Base Conv. Rate\" for each currency. (The default price of all the products from TheSSLStore API is in %apicurrencycode%.)"; + +$lang['ThesslstoreModule.row_meta.default_tech_details'] = 'Use This Information During Client Side Certificate Generation Process?'; +$lang['ThesslstoreModule.row_meta.default_tech_job_title'] = 'Job Title'; +$lang['ThesslstoreModule.row_meta.default_tech_first_name'] = 'First Name'; +$lang['ThesslstoreModule.row_meta.default_tech_last_name'] = 'Last Name'; +$lang['ThesslstoreModule.row_meta.default_tech_organization_name'] = 'Organization Name'; +$lang['ThesslstoreModule.row_meta.default_tech_address'] = 'Address'; +$lang['ThesslstoreModule.row_meta.default_tech_phone_number'] = 'Phone Number'; +$lang['ThesslstoreModule.row_meta.default_tech_email_address'] = 'Email Address'; +$lang['ThesslstoreModule.row_meta.default_tech_city'] = 'City'; +$lang['ThesslstoreModule.row_meta.default_tech_state'] = 'State/Region'; +$lang['ThesslstoreModule.row_meta.default_tech_country'] = 'Country'; +$lang['ThesslstoreModule.row_meta.default_tech_zip_code'] = 'Zip Code'; + +$lang['ThesslstoreModule.row_meta.additionaldays_for_new_order'] = 'Additional Days for New Order (0 - 90 days)'; +$lang['ThesslstoreModule.row_meta.additionaldays_for_renew_order'] = 'Additional Days for ReNew Order (0 - 90 days)'; + +$lang['ThesslstoreModule.row_meta.store_order_id'] = 'Enter SSL Store OrderID'; +$lang['ThesslstoreModule.row_meta.import_order_type_new'] = 'Create new order in Blesta Panel'; +$lang['ThesslstoreModule.row_meta.import_order_type_existing'] = 'Map with existing order'; +$lang['ThesslstoreModule.row_meta.client_label'] = 'Select Client'; +$lang['ThesslstoreModule.row_meta.invoice_method_label'] = 'Invoice Method'; +$lang['ThesslstoreModule.row_meta.invoice_method_create'] = 'Create Invoice'; +$lang['ThesslstoreModule.row_meta.invoice_method_append'] = 'Append to Invoice'; +$lang['ThesslstoreModule.row_meta.invoice_method_none'] = 'Do Not Invoice'; +$lang['ThesslstoreModule.row_meta.send_email_label'] = 'Send order confirmation email'; +$lang['ThesslstoreModule.row_meta.service_id_label'] = 'Select Blesta Service Id'; + + + + +$lang['ThesslstoreModule.credential_row.add_btn'] = "Save"; +$lang['ThesslstoreModule.import_packages_row.add_btn'] = "Import Packages"; +$lang['ThesslstoreModule.change_approver_email.save_btn'] = "Save"; +$lang['ThesslstoreModule.setup_price.currency_submit_btn'] = "Submit"; +$lang['ThesslstoreModule.import_orders_row.add_btn'] = "Import Order"; + +//Package +$lang['ThesslstoreModule.package_fields.product_code'] = "Product code"; +$lang['TheSSLStore.!error.meta[thesslstore_product_code].valid'] = "Please Select Product"; +$lang['TheSSLStore.!error.meta[thesslstore_vendor_name].valid'] = "Invalid Vendor Name"; +$lang['TheSSLStore.!error.meta[thesslstore_is_code_signing].valid'] = "Invalid Code Signing Value"; +$lang['TheSSLStore.!error.meta[thesslstore_min_san].valid'] = "Invalid Min SAN Value"; +$lang['TheSSLStore.!error.meta[thesslstore_is_scan_product].valid'] = "Invalid Scan Product Value"; +$lang['TheSSLStore.!error.meta[thesslstore_validation_type].valid'] = "Invalid Validation Type"; + +//Client Service Management - Certificate Details +$lang['ThesslstoreModule.!error.invalid_service_status'] = "Service must be active for this features"; +$lang['ThesslstoreModule.success.generate_cert'] = "Certificate generation process completed successfully"; +$lang['ThesslstoreModule.tab_client_cert_details.cert_completed_details'] = "Your SSL certificate generation process has now been completed and sent to the Certificate Authority for validation. If there are any questions or issues, the Certificate Authority will reach out to the admin contact to clarify and resolve."; +$lang['ThesslstoreModule.tab_CertDetails'] = "Certificate Details"; +$lang['ThesslstoreModule.tab_client_cert_details'] = "Certificate Details"; +$lang['ThesslstoreModule.tab_client_cert_details.order_status'] = "Order Status"; +$lang['ThesslstoreModule.tab_client_cert_details.renew_from'] = "Renew From"; +$lang['ThesslstoreModule.tab_client_cert_details.store_order_id'] = "Store Order ID"; +$lang['ThesslstoreModule.tab_client_cert_details.token'] = "Token"; +$lang['ThesslstoreModule.tab_client_cert_details.package_name'] = "Package Name"; +$lang['ThesslstoreModule.tab_client_cert_details.vendor_order_id'] = "Vendor Order ID"; +$lang['ThesslstoreModule.tab_client_cert_details.org_name'] = "Organization"; +$lang['ThesslstoreModule.tab_client_cert_details.vendor_status'] = "Vendor Status"; +$lang['ThesslstoreModule.tab_client_cert_details.ssl_start_date'] = "SSL Provisioning Date"; +$lang['ThesslstoreModule.tab_client_cert_details.ssl_end_date'] = "SSL Expiry Date"; +$lang['ThesslstoreModule.tab_client_cert_details.domains'] = "Domain(s)"; +$lang['ThesslstoreModule.tab_client_cert_details.verification_email'] = "Verification Email"; +$lang['ThesslstoreModule.tab_client_cert_details.siteseal_url'] = "Get Your Site Seal"; +$lang['ThesslstoreModule.tab_client_cert_details.admin_details'] = "Admin Details"; +$lang['ThesslstoreModule.tab_client_cert_details.admin_title'] = "Title"; +$lang['ThesslstoreModule.tab_client_cert_details.admin_first_name'] = "First Name"; +$lang['ThesslstoreModule.tab_client_cert_details.admin_last_name'] = "Last Name"; +$lang['ThesslstoreModule.tab_client_cert_details.admin_email'] = "Email"; +$lang['ThesslstoreModule.tab_client_cert_details.admin_phone'] = "Phone"; +$lang['ThesslstoreModule.tab_client_cert_details.tech_details'] = "Technical Details"; +$lang['ThesslstoreModule.tab_client_cert_details.tech_title'] = "Title"; +$lang['ThesslstoreModule.tab_client_cert_details.tech_first_name'] = "First Name"; +$lang['ThesslstoreModule.tab_client_cert_details.tech_last_name'] = "Last Name"; +$lang['ThesslstoreModule.tab_client_cert_details.tech_email'] = "Email"; +$lang['ThesslstoreModule.tab_client_cert_details.tech_phone'] = "Phone"; +$lang['ThesslstoreModule.tab_client_cert_details.auth_details'] = "Validation Details"; + + +//Client Reissue Cert tab +$lang['ThesslstoreModule.!error.reissue_cert_invalid_certificate_status'] = "Reissue available only for Active certificate."; +$lang['ThesslstoreModule.success.reissue_cert'] = "Certificate Re-Issue process completed successfully"; +$lang['ThesslstoreModule.tab_reissue_cert.heading'] = "Re-Issue Certificate"; +$lang['ThesslstoreModule.tab_reissue_cert.submit'] = "Re-Issue"; + +//Change approver method tab field +$lang['ThesslstoreModule.tab_ChangeApproverEmail'] = "Manage Approver Email/Method"; +$lang['ThesslstoreModule.!error.change_approver_email_not_available_for_order'] = "Change Approver Email feature is not available for this order."; +$lang['ThesslstoreModule.!error.change_approver_email_not_available_for_product'] = "Change Approver Email feature is not available for this certificate."; +$lang['ThesslstoreModule.!error.resend_approver_email_not_available_for_order'] = "Resend Approver Email feature is not available for this order."; +$lang['ThesslstoreModule.success.change_approver_email'] = "Approver Email/Method changed successfully"; + +//Download Authfile tab field +$lang['ThesslstoreModule.tab_DownloadAuthFile'] = "Download Auth File"; +$lang['ThesslstoreModule.!error.download_authfile_invalid_state'] = "Download Authfile feature is available only for Pending/Re-issue Pending orders."; +$lang['ThesslstoreModule.!error.download_authfile_not_available'] = "Download Authfile feature is not available for this order."; +//Download Certificate tab field +$lang['ThesslstoreModule.tab_DownloadCertificate'] = "Download Certificate"; +$lang['ThesslstoreModule.!error.download_cert_invalid_state'] = "Download Certificate feature is available only for Active orders."; +//Management Action tab admin side +$lang['ThesslstoreModule.!error.initial_order_status'] = "This feature is not available for the initial order."; + +//Client Service Management - +$lang['ThesslstoreModule.tab_GenerateCert'] = "Generate Certificate"; +//$lang['ThesslstoreModule.tab_generate_cert.heading_approver_email'] = "Select Approver Email"; +$lang['ThesslstoreModule.tab_generate_cert.heading_step3'] = "Configuration Complete"; +$lang['ThesslstoreModule.!error.generate_cert_invalid_certificate_status'] = "Generation process already completed."; +$lang['ThesslstoreModule.tab_generate_cert.heading_server'] = "Server Information"; +$lang['ThesslstoreModule.service_field.thesslstore_csr'] = "Input CSR"; +$lang['ThesslstoreModule.service_field.thesslstore_additional_san'] = "Additional SAN"; +$lang['ThesslstoreModule.service_field.thesslstore_additional_san_help'] = "(Input every SAN in separate line)"; +$lang['ThesslstoreModule.service_field.thesslstore_webserver_type'] = "Select Your Web Server"; +$lang['ThesslstoreModule.service_field.thesslstore_signature_algorithm'] = "Signature Algorithm"; +$lang['ThesslstoreModule.tab_generate_cert.heading_auth_method'] = "Authentication Method"; +$lang['ThesslstoreModule.tab_generate_cert.heading_admin'] = "Administrative Contact Information"; +$lang['ThesslstoreModule.service_field.thesslstore_admin_first_name'] = "First Name"; +$lang['ThesslstoreModule.service_field.thesslstore_admin_last_name'] = "Last Name"; +$lang['ThesslstoreModule.service_field.thesslstore_admin_title'] = "Title"; +$lang['ThesslstoreModule.service_field.thesslstore_admin_email'] = "Email Address"; +$lang['ThesslstoreModule.service_field.thesslstore_admin_phone'] = "Phone Number"; +$lang['ThesslstoreModule.tab_generate_cert.heading_organization'] = "Organization Information"; +$lang['ThesslstoreModule.service_field.thesslstore_org_name'] = "Organization Name"; +$lang['ThesslstoreModule.service_field.thesslstore_org_division'] = "Organization Division"; +$lang['ThesslstoreModule.service_field.thesslstore_admin_address1'] = "Address 1"; +$lang['ThesslstoreModule.service_field.thesslstore_admin_address2'] = "Address 2"; +$lang['ThesslstoreModule.service_field.thesslstore_admin_city'] = "City"; +$lang['ThesslstoreModule.service_field.thesslstore_admin_state'] = "State/Region"; +$lang['ThesslstoreModule.service_field.thesslstore_admin_country'] = "Country"; +$lang['ThesslstoreModule.service_field.thesslstore_admin_zip'] = "Zip Code"; +$lang['ThesslstoreModule.tab_generate_cert.heading_tech'] = "Technical Contact Information"; +$lang['ThesslstoreModule.service_field.thesslstore_same_as_admin'] = "Same as the Admin info above ?"; +$lang['ThesslstoreModule.service_field.thesslstore_tech_first_name'] = "First Name"; +$lang['ThesslstoreModule.service_field.thesslstore_tech_last_name'] = "Last Name"; +$lang['ThesslstoreModule.service_field.thesslstore_tech_title'] = "Title"; +$lang['ThesslstoreModule.service_field.thesslstore_tech_email'] = "Email Address"; +$lang['ThesslstoreModule.service_field.thesslstore_tech_phone'] = "Phone Number"; +$lang['ThesslstoreModule.service_field.ssl_org_detail_new'] = "Create New Organization"; +$lang['ThesslstoreModule.service_field.ssl_org_detail_existing'] = "Use Existing Organization"; +$lang['ThesslstoreModule.please_select'] = "-- Please Select --"; +$lang['ThesslstoreModule.sslstore_mass_email'] = "Select default email for all domains"; +$lang['ThesslstoreModule.tab_generate_cert_step1.submit'] = "Submit"; + +$lang['ThesslstoreModule.!error.thesslstore_csr.empty'] = "Please enter CSR"; +$lang['ThesslstoreModule.!error.thesslstore_csr.valid'] = "Please enter Valid CSR"; +$lang['ThesslstoreModule.!error.thesslstore_additional_san.empty'] = "Please enter minimum 1 additional SAN"; +$lang['ThesslstoreModule.!error.thesslstore_webserver_type.empty'] = "Please select Web Server"; +$lang['ThesslstoreModule.!error.thesslstore_auth_method.empty'] = "Please select Authentication Method"; +$lang['ThesslstoreModule.!error.thesslstore_signature_algorithm.empty'] = "Please select Signature Algorithm"; +$lang['ThesslstoreModule.!error.thesslstore_admin_first_name.empty'] = "Please enter Admin First Name"; +$lang['ThesslstoreModule.!error.thesslstore_admin_last_name.empty'] = "Please enter Admin Last Name"; +$lang['ThesslstoreModule.!error.thesslstore_admin_email.empty'] = "Please enter Admin Email"; +$lang['ThesslstoreModule.!error.thesslstore_admin_phone.empty'] = "Please enter Admin Phone"; +$lang['ThesslstoreModule.!error.thesslstore_org_id.empty'] = "Please select Organization"; +$lang['ThesslstoreModule.!error.thesslstore_org_name.empty'] = "Please enter Organization Name"; +$lang['ThesslstoreModule.!error.thesslstore_org_division.empty'] = "Please enter Organization Division"; +$lang['ThesslstoreModule.!error.thesslstore_admin_address1.empty'] = "Please enter Address"; +$lang['ThesslstoreModule.!error.thesslstore_admin_city.empty'] = "Please enter City"; +$lang['ThesslstoreModule.!error.thesslstore_admin_state.empty'] = "Please enter State/Region"; +$lang['ThesslstoreModule.!error.thesslstore_admin_country.empty'] = "Please select County"; +$lang['ThesslstoreModule.!error.thesslstore_admin_zip.empty'] = "Please enter ZipCode"; +$lang['ThesslstoreModule.!error.thesslstore_tech_first_name.empty'] = "Please enter Technical First Name"; +$lang['ThesslstoreModule.!error.thesslstore_tech_last_name.empty'] = "Please enter Technical Last Name"; +$lang['ThesslstoreModule.!error.thesslstore_tech_email.empty'] = "Please enter Technical Email"; +$lang['ThesslstoreModule.!error.thesslstore_tech_phone.empty'] = "Please enter Technical Phone"; + +$lang['ThesslstoreModule.tab_change_approver.button'] = "Change"; +$lang['ThesslstoreModule.tab_change_approver_for_all.button'] = "Change All"; +$lang['ThesslstoreModule.tab_resend_approver.button'] = "Resend"; +$lang['ThesslstoreModule.tab_ResendApproverEmail'] = "Resend Approver Email"; +$lang['ThesslstoreModule.success.resend_approver_email'] = "Approver Email sent successfully"; +$lang['ThesslstoreModule.!error.resend_invalid_status'] = "Resend Approver Email is available only for pending order"; +$lang['ThesslstoreModule.tab_change_approver_success_msg'] = "Approver Method Updated Successfully"; + +$lang['ThesslstoreModule.tab_ReissueCert'] = "Re-issue Certificate"; + +$lang['ThesslstoreModule.tab_AdminManagementAction'] = "Management Actions"; + +//Symantec Replacement Order Related +$lang['ThesslstoreModule.replacement_order.box_title'] = "Symantec Replacement Orders List"; +$lang['ThesslstoreModule.replacement_order.export_csv'] = "Export to CSV"; +$lang['ThesslstoreModule.row_meta.replace_date'] = "Replace By Date"; ?> \ No newline at end of file diff --git a/thesslstore_module.php b/thesslstore_module.php index d9b73ed..957bae3 100644 --- a/thesslstore_module.php +++ b/thesslstore_module.php @@ -9,7 +9,7 @@ class ThesslstoreModule extends Module { /** * @var string The version of this module */ - private static $version = "1.7.0"; + private static $version = "1.9.0"; /** * @var string The name of this module @@ -21,6 +21,12 @@ class ThesslstoreModule extends Module { */ private $api_partner_code = ''; + + /** + * @var string API Mode + */ + + private $is_sandbox_mode = 'n'; /** * @var string The authors of this module */ @@ -71,6 +77,8 @@ public function getAuthors() { */ public function install() { + //Create database table + $this->createTables(); // Add cron tasks for this module $this->addCronTasks($this->getCronTasks()); } @@ -124,6 +132,123 @@ public function upgrade($current_version) if (version_compare($current_version, '1.7.0', '<')) { $this->addCronTasks($this->getCronTasks()); } + + // Upgrade if possible + if (version_compare($current_version, '1.8.0', '<')) { + $this->createTables(); + $this->make_db_entry_in_ssl_orders(); + } + + // Upgrade if possible + if (version_compare($current_version, '1.9.0', '<')) { + $this->createTables(); + } + } + + /* + * Perform a database operation like create table etc. when module being installed + */ + private function createTables(){ + if (!isset($this->Record)) { + Loader::loadComponents($this, ['Record']); + } + try{ + $this->Record->query(" + CREATE TABLE IF NOT EXISTS sslstore_orders( + id int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + service_id int(10) UNSIGNED NOT NULL, + package_id int(10) UNSIGNED NOT NULL, + invoice_id int(10) UNSIGNED NOT NULL, + store_order_id int(10) UNSIGNED NOT NULL, + renew_to int(10) UNSIGNED NOT NULL DEFAULT '0', + renew_from int(10) UNSIGNED NOT NULL DEFAULT '0', + is_sandbox_order enum('y','n') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'n', + created datetime DEFAULT NULL, + PRIMARY KEY (id) + )"); + + $this->Record->query(" + CREATE TABLE IF NOT EXISTS sslstore_organisations( + id int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + user_id int(10) UNSIGNED NOT NULL, + org_id int(10) UNSIGNED NOT NULL, + vendor_org_id int(10) UNSIGNED NOT NULL, + org_name varchar(255) NOT NULL, + is_sandbox enum('y','n') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'n', + created datetime DEFAULT NULL, + PRIMARY KEY (id) + )"); + + $this->Record->query(" + CREATE TABLE IF NOT EXISTS sslstore_import_orders( + id int(10) UNSIGNED NOT NULL AUTO_INCREMENT, + client_id int(10) UNSIGNED NOT NULL, + service_id int(10) UNSIGNED NOT NULL, + package_id int(10) UNSIGNED NOT NULL, + invoice_id int(10) UNSIGNED NOT NULL, + store_order_id int(10) UNSIGNED NOT NULL, + package_name varchar(255) NOT NULL, + product_code varchar(255) NOT NULL, + term int(10) UNSIGNED NOT NULL, + period varchar(10) NOT NULL, + date_added datetime NOT NULL, + date_renews datetime DEFAULT NULL, + PRIMARY KEY (id) + )"); + } + catch(Exception $e){ + $this->log('Database operation', $e->getMessage(),'output', false); + } + } + + /* + * Make an entry of old records in ssl_orders table + */ + + private function make_db_entry_in_ssl_orders(){ + if (!isset($this->Record)) { + Loader::loadComponents($this, ['Record']); + } + if (!isset($this->Services)){ + Loader::loadModels($this, ['Services']); + } + + $services = $this->getAllServiceIds(); + foreach($services as $service){ + + // Fetch the service + if (!($service_obj = $this->Services->get($service->id))) { + continue; + } + + $fields = $this->serviceFieldsToObject($service_obj->fields); + + // Require the SSL Store order ID field be available + if (!isset($fields->thesslstore_order_id)){ + continue; + } + //the SSL Store order ID not blank + if (empty($fields->thesslstore_order_id)){ + continue; + } + try{ + $inserted_order = $this->Record->select(['id'])->from("sslstore_orders")->where("store_order_id", "=", $fields->thesslstore_order_id)->fetch(); + if(!$inserted_order){ + $invoice_data = $this->Record->select(['invoice_id'])->from("service_invoices")->where("service_id", "=", $service_obj->id)->order(array("invoice_id" => "desc"))->fetch(); + $this->Record->insert("sslstore_orders", + array('service_id' => $service_obj->id, + 'package_id' => $service_obj->package->id, + 'invoice_id' => $invoice_data->invoice_id, + 'store_order_id' => $fields->thesslstore_order_id, + 'created' => $service_obj->date_added + ) + ); + } + } + catch(Exception $e){ + $this->log('Database operation: Make Entry in ssl_orders', $e->getMessage(),'output', false); + } + } } /** @@ -262,7 +387,7 @@ private function orderSynchronization() } // Update renewal date - if (!empty($order->CertificateEndDateInUTC)) { + if (!empty($order->CertificateEndDateInUTC) && strtolower($order->OrderStatus->MajorStatus) == 'active') { // Get the date 30 days before the certificate expires $end_date = $this->Date->modify( strtotime($order->CertificateEndDateInUTC), @@ -302,6 +427,53 @@ private function orderSynchronization() } } + /** + * Update order data + */ + private function updateOrderData($order_resp, $service) + { + Loader::loadModels($this, ['Services']); + Loader::loadHelpers($this, ['Date']); + $this->Date->setTimezone('UTC', 'UTC'); + // Update renewal date + if (!empty($order_resp->CertificateEndDateInUTC) && strtolower($order_resp->OrderStatus->MajorStatus) == 'active') { + // Get the date 30 days before the certificate expires + $end_date = $this->Date->modify( + strtotime($order_resp->CertificateEndDateInUTC), + '-30 days', + 'Y-m-d H:i:s', + 'UTC' + ); + if ($end_date != $service->date_renews) { + $vars['date_renews'] = $end_date . 'Z'; + $this->Services->edit($service->id, $vars, $bypass_module = true); + } + } + + $fields = $this->serviceFieldsToObject($service->fields); + // Update domain name(fqdn) + if (!empty($order_resp->CommonName)) { + if (isset($fields->thesslstore_fqdn)) { + if ($fields->thesslstore_fqdn != $order_resp->CommonName) { + // Update + $this->Services->editField($service->id, [ + 'key' => 'thesslstore_fqdn', + 'value' => $order_resp->CommonName, + 'encrypted' => 0 + ]); + } + } else { + // Add + $this->Services->addField($service->id, [ + 'key' => 'thesslstore_fqdn', + 'value' => $order_resp->CommonName, + 'encrypted' => 0 + ]); + } + } + return; + } + /** * Retrieves a list of all service IDs representing active/suspended SSL Store module services for this company * @@ -317,7 +489,7 @@ private function getAllServiceIds(array $filters = []) $this->Record->select(['services.id']) ->from('services') - ->on('service_fields.key', '=', 'thesslstore_order_id') + ->on('service_fields.key', '=', 'thesslstore_order_id') ->innerJoin('service_fields', 'service_fields.service_id', '=', 'services.id', false) ->innerJoin('clients', 'clients.id', '=', 'services.client_id', false) ->innerJoin('client_groups', 'client_groups.id', '=', 'clients.client_group_id', false) @@ -412,7 +584,6 @@ public function getPackageServiceName($packages, array $vars=null) { * @return string HTML content containing information to display when viewing the service info */ public function getClientServiceInfo($service, $package) { - if($service->status == 'active') { // Load the view into this object, so helpers can be automatically added to the view $this->view = new View("client_service_info", "default"); @@ -425,7 +596,11 @@ public function getClientServiceInfo($service, $package) { // Get the service fields $service_fields = $this->serviceFieldsToObject($service->fields); - $order_resp = $this->getSSLOrderStatus($service_fields->thesslstore_order_id); + $order_resp = $this->getSSLOrderStatus($service_fields->thesslstore_order_id, $package->meta->thesslstore_vendor_name); + + //Update Order Info + $update_order_data_resp = $this->updateOrderData($order_resp, $service); + if($order_resp != NULL && $order_resp->AuthResponse->isError == false) { $store_order_id = $order_resp->TheSSLStoreOrderID; @@ -495,10 +670,12 @@ public function getApi($api_partner_code = null, $api_auth_token = null, $api_mo if($api_mode == 'LIVE'){ $api_partner_code = $row->meta->api_partner_code_live; $api_auth_token = $row->meta->api_auth_token_live; + $this->is_sandbox_mode = 'n'; } else{ $api_partner_code = $row->meta->api_partner_code_test; $api_auth_token = $row->meta->api_auth_token_test; + $this->is_sandbox_mode = 'y'; } break; } @@ -507,7 +684,7 @@ public function getApi($api_partner_code = null, $api_auth_token = null, $api_mo $this->api_partner_code = $api_partner_code; - $api = new thesslstoreApi($api_partner_code, $api_auth_token, $token, $tokenID = '', $tokenCode = '', $IsUsedForTokenSystem, $api_mode); + $api = new thesslstoreApi($api_partner_code, $api_auth_token, $token, $tokenID = '', $tokenCode = '', $IsUsedForTokenSystem, $api_mode,'Blesta-'.$this->getVersion()); return $api; } @@ -630,20 +807,23 @@ private function getCredentialRules(array &$vars) { * @return array A list of rules */ private function getImportPackageRules(array &$vars) { - return array( - 'profit_margin' => array( - 'empty' => array( - 'rule' => "isEmpty", - 'negate' => true, - 'message' => Language::_("ThesslstoreModule.!error.profit_margin.empty", true) - ), - 'valid' => array( - 'rule' => array("isPassword", 1, "num"), - 'message' => Language::_("ThesslstoreModule.!error.profit_margin.valid", true) + // If the option is set to percentage then only validate that value + if($vars['import_package_mode'] == 'with_percentage') { + return array( + 'profit_margin' => array( + 'empty' => array( + 'rule' => "isEmpty", + 'negate' => true, + 'message' => Language::_("ThesslstoreModule.!error.profit_margin.empty", true) + ), + 'valid' => array( + 'rule' => array("isPassword", 1, "num"), + 'message' => Language::_("ThesslstoreModule.!error.profit_margin.valid", true) + ) ) - ) - ); + ); + } } /** @@ -790,10 +970,12 @@ public function manageModule($module, array &$vars) { if(isset($row->meta->thesslstore_reseller_name)){ $credential_added = true; - $link_buttons[] = array('name'=>Language::_("ThesslstoreModule.replacement_order_row",true),'attributes'=>array('href'=>array('href'=>$this->base_uri . "settings/company/modules/addrow/" . $module->id."?scr=replacementorder"))); + //$link_buttons[] = array('name'=>Language::_("ThesslstoreModule.replacement_order_row",true),'attributes'=>array('href'=>$this->base_uri . "settings/company/modules/addrow/" . $module->id."?scr=replacementorder")); $link_buttons[] = array('name'=>Language::_("ThesslstoreModule.edit_credential_row", true), 'attributes'=>array('href'=>$this->base_uri . "settings/company/modules/addrow/" . $module->id."?scr=editcredential")); - $link_buttons[] = array('name'=>Language::_("ThesslstoreModule.import_product_row",true),'attributes'=>array('href'=>array('href'=>$this->base_uri . "settings/company/modules/addrow/" . $module->id."?scr=importpackage"))); - $link_buttons[] = array('name'=>Language::_("ThesslstoreModule.setup_price_row",true),'attributes'=>array('href'=>array('href'=>$this->base_uri . "settings/company/modules/addrow/" . $module->id."?scr=setupprice"))); + $link_buttons[] = array('name'=>Language::_("ThesslstoreModule.edit_additional_settings_row", true), 'attributes'=>array('href'=>$this->base_uri . "settings/company/modules/addrow/" . $module->id."?scr=additionalsettings")); + $link_buttons[] = array('name'=>Language::_("ThesslstoreModule.import_order_row",true),'attributes'=>array('href'=>$this->base_uri . "settings/company/modules/addrow/" . $module->id."?scr=importorder")); + $link_buttons[] = array('name'=>Language::_("ThesslstoreModule.import_product_row",true),'attributes'=>array('href'=>$this->base_uri . "settings/company/modules/addrow/" . $module->id."?scr=importpackage")); + $link_buttons[] = array('name'=>Language::_("ThesslstoreModule.setup_price_row",true),'attributes'=>array('href'=>$this->base_uri . "settings/company/modules/addrow/" . $module->id."?scr=setupprice")); break; } } @@ -880,6 +1062,69 @@ public function manageAddRow(array &$vars) { { $vars['packageGroupsArray'] = "false"; } + + // Load the Loader to fetch supported Currencies + Loader::loadModels($this, array("Currencies")); + $currenciesArray=$this->Currencies->getAll($companyID); + foreach ($currenciesArray as $key => $value) { + $currencies[$value->code] = $value->code; + if($this->Currencies->validateCurrencyIsDefault($value->code,$companyID)) + { + $defaultCurrency = $value->code; + } + } + + if (!empty($currenciesArray)) { + // Load the Loader to fetch Existing products from the DB + Loader::loadModels($this, array("Packages")); + $existingProducts = $this->Packages->getAll($companyID, $order = ['name' => 'ASC'], $status = null, $type = null ); + $already_added_packages = array(); + + /* Call the function to get the module name */ + $moduleName = $this->getName(); + + /* Load the Loader to fetch info of All the installed Module */ + Loader::loadModels($this, array("ModuleManager")); + $moduleArray = $this->ModuleManager->getInstalled(); + /* Retrieve the Company ID which was assigned to our module */ + $moduleIDObject = null; + foreach ($moduleArray as $info) { + if ($moduleName == $info->name) { + $moduleIDObject = $info; + break; + } + } + $moduleID = $moduleIDObject->id; + + foreach($existingProducts as $pack_data){ + if ($pack_data->module_id == $moduleID) { + $package = $this->Packages->get($pack_data->id); + $already_added_packages[$pack_data->id] = $package->meta->thesslstore_product_code; + } + } + + //Get products + $products = $this->getProducts(); + //echo "
";
+ //print_r($products);die();
+ //TSS API supports USD,EUR currency
+ $apiCurrencyCode = (isset($products[0]->CurrencyCode) ? $products[0]->CurrencyCode : '') ;
+ $currencyDetails = $this->Currencies-> get($apiCurrencyCode,$companyID);
+ $api_currency_rate = $currencyDetails->exchange_rate;
+
+ $vars['currencies'] = $currencies;
+ $vars['currenciesArray'] = "true";
+ $vars['defaultCurrency'] = $defaultCurrency;
+ $vars['apiCurrencyCode'] = $apiCurrencyCode;
+ $vars['products'] = $products;
+ $vars['existingProducts'] = $already_added_packages;
+ $vars['api_currency_rate'] = $api_currency_rate;
+ $vars['product_edit_url'] = "/admin/packages/edit/";
+ }
+ else
+ {
+ $vars['currenciesArray'] = "false";
+ }
// Set unspecified checkboxes
$this->view->set("vars", (object)$vars);
@@ -896,7 +1141,33 @@ public function manageAddRow(array &$vars) {
//Get current company ID
$company_id = Configure::get("Blesta.company_id");
- //Load Packages Model
+ // Load the Loader to fetch supported Currencies
+ Loader::loadModels($this, array("Currencies"));
+ $currenciesArray=$this->Currencies->getAll($company_id);
+ foreach ($currenciesArray as $key => $value) {
+ $currencies[$value->code] = $value->code;
+ if($this->Currencies->validateCurrencyIsDefault($value->code,$company_id))
+ {
+ $defaultCurrency = $value->code;
+ }
+ }
+ if(isset($_REQUEST['currency'])) {
+ $defaultCurrency = $_REQUEST['currency'];
+ }
+ //Get products
+ $products = $this->getProducts();
+ $apiCurrencyCode = (isset($products[0]->CurrencyCode) ? $products[0]->CurrencyCode : '') ;
+ //Check the api currency is setup there or not
+ $isApiCurrencySet = $this->Currencies-> get($apiCurrencyCode,$company_id);
+ if (!empty($isApiCurrencySet)) {
+ $vars['isApiCurrencySet'] = "true";
+ }
+ else
+ {
+ $vars['isApiCurrencySet'] = "false";
+ }
+
+ //Load Packages Model
Loader::loadModels($this, array("Packages","PackageOptions"));
$package_data = array();
@@ -905,27 +1176,25 @@ public function manageAddRow(array &$vars) {
$package = $this->Packages->get($pack->id);
- if(isset($package->meta->thesslstore_product_code)) {
+ if(isset($package->meta->thesslstore_product_code) && ($package->pricing[0]->currency == $defaultCurrency || $package->pricing[1]->currency == $defaultCurrency || $package->pricing[2]->currency == $defaultCurrency)) {
$package_data[$pack->id]['name'] = $package->name;
$package_data[$pack->id]['group_name'] = isset($package->groups[0]->name) ? $package->groups[0]->name : '';
$package_data[$pack->id]['product_code'] = $package->meta->thesslstore_product_code;
-
foreach($package->pricing as $pricing){
- if(($pricing->term == 12 && $pricing->period == 'month') || ($pricing->term == 1 && $pricing->period == 'year') && $pricing->currency == 'USD'){
+ if((($pricing->term == 12 && $pricing->period == 'month') || ($pricing->term == 1 && $pricing->period == 'year')) && $pricing->currency == $defaultCurrency){
$package_data[$pack->id]['pricing']['1year']['pricing_id'] = $pricing->pricing_id;
$package_data[$pack->id]['pricing']['1year']['price'] = $pricing->price;
}
- elseif(($pricing->term == 24 && $pricing->period == 'month') || ($pricing->term == 2 && $pricing->period == 'year') && $pricing->currency == 'USD'){
+ elseif((($pricing->term == 24 && $pricing->period == 'month') || ($pricing->term == 2 && $pricing->period == 'year')) && $pricing->currency == $defaultCurrency){
$package_data[$pack->id]['pricing']['2year']['pricing_id'] = $pricing->pricing_id;
$package_data[$pack->id]['pricing']['2year']['price'] = $pricing->price;
}
- elseif(($pricing->term == 36 && $pricing->period == 'month') || ($pricing->term == 3 && $pricing->period == 'year') && $pricing->currency == 'USD'){
+ elseif((($pricing->term == 36 && $pricing->period == 'month') || ($pricing->term == 3 && $pricing->period == 'year')) && $pricing->currency == $defaultCurrency){
$package_data[$pack->id]['pricing']['3year']['pricing_id'] = $pricing->pricing_id;
$package_data[$pack->id]['pricing']['3year']['price'] = $pricing->price;
}
}
-
//Get Options Price
$package_data[$pack->id]['has_additional_san'] = false;
$package_data[$pack->id]['has_additional_server'] = false;
@@ -944,15 +1213,15 @@ public function manageAddRow(array &$vars) {
if(isset($option->values[0]->pricing)){
foreach($option->values[0]->pricing as $pricing){
- if(($pricing->term == 12 && $pricing->period == 'month') || ($pricing->term == 1 && $pricing->period == 'year') && $pricing->currency == 'USD'){
+ if((($pricing->term == 12 && $pricing->period == 'month') || ($pricing->term == 1 && $pricing->period == 'year')) && $pricing->currency == $defaultCurrency){
$package_data[$pack->id][$key.'_pricing']['1year']['pricing_id'] = $pricing->pricing_id;
$package_data[$pack->id][$key.'_pricing']['1year']['price'] = $pricing->price;
}
- elseif(($pricing->term == 24 && $pricing->period == 'month') || ($pricing->term == 2 && $pricing->period == 'year' ) && $pricing->currency == 'USD'){
+ elseif((($pricing->term == 24 && $pricing->period == 'month') || ($pricing->term == 2 && $pricing->period == 'year' )) && $pricing->currency == $defaultCurrency){
$package_data[$pack->id][$key.'_pricing']['2year']['pricing_id'] = $pricing->pricing_id;
$package_data[$pack->id][$key.'_pricing']['2year']['price'] = $pricing->price;
}
- elseif(($pricing->term == 36 && $pricing->period == 'month') || ($pricing->term == 3 && $pricing->period == 'year') && $pricing->currency == 'USD'){
+ elseif((($pricing->term == 36 && $pricing->period == 'month') || ($pricing->term == 3 && $pricing->period == 'year')) && $pricing->currency == $defaultCurrency){
$package_data[$pack->id][$key.'_pricing']['3year']['pricing_id'] = $pricing->pricing_id;
$package_data[$pack->id][$key.'_pricing']['3year']['price'] = $pricing->price;
}
@@ -963,11 +1232,20 @@ public function manageAddRow(array &$vars) {
}
}
}
- $reseller_price_link = explode("?",$_SERVER['REQUEST_URI']);
- $reseller_price_link = $reseller_price_link[0]."?scr=resellerprice";
+ $vars['currencies'] = $currencies;
+ $vars['currenciesArray'] = "true";
+ $vars['defaultCurrency'] = $defaultCurrency;
+ $vars['apiCurrencyCode'] = $apiCurrencyCode;
+
+ $request_uri = explode("?",$_SERVER['REQUEST_URI']);
+ $setup_price_link = $request_uri[0]."?scr=setupprice";
+ $reseller_price_link = $request_uri[0]."?scr=resellerprice";
+ $update_currency_link = $request_uri[0]."?scr=updatecurrency";
$this->view->set("package_data", $package_data);
$this->view->set("vars",(object)$vars);
+ $this->view->set("setup_price_link",$setup_price_link);
$this->view->set("reseller_price_link",$reseller_price_link);
+ $this->view->set("update_currency_link",$update_currency_link);
return $this->view->fetch();
}
elseif($scr == 'resellerprice'){
@@ -988,7 +1266,6 @@ public function manageAddRow(array &$vars) {
}
}
-
$reseller_pricing = array();
foreach($products as $product){
$reseller_pricing[$product->ProductCode]['has_additional_san'] = false;
@@ -1007,10 +1284,6 @@ public function manageAddRow(array &$vars) {
$has_additonal_server = true;
}
-
-
-
-
$reseller_pricing[$product->ProductCode]['name'] = $product->ProductName;
foreach($product->PricingInfo as $pricing_info){
if($pricing_info->NumberOfMonths == 12){
@@ -1124,6 +1397,93 @@ public function manageAddRow(array &$vars) {
fclose($output);
exit;
+ }elseif($scr == "additionalsettings"){
+
+ //This function is just called to set row meta because in current method row meta is not set by blesta.
+ $this->getApi();
+
+ $this->view = new View("additional_settings", "default");
+ $this->view->base_uri = $this->base_uri;
+ $this->view->setDefaultView("components" . DS . "modules" . DS . "thesslstore_module" . DS);
+
+ // Load the helpers required for this view
+ Loader::loadHelpers($this, array("Form", "Html", "Widget"));
+
+ $vars = array();
+ /* Call the function to get the module name */
+ $moduleName = $this->getName();
+
+ /* Load the Loader to fetch info of All the installed Module */
+ Loader::loadModels($this, array("ModuleManager"));
+ $moduleArray = $this->ModuleManager->getInstalled();
+ /* Retrieve the Company ID which was assigned to our module */
+ $moduleIDObject = null;
+ foreach ($moduleArray as $info) {
+ if ($moduleName == $info->name) {
+ $moduleIDObject = $info;
+ break;
+ }
+ }
+ $moduleID = $moduleIDObject->id;
+ $vars = $this->ModuleManager->getMeta($moduleID);
+
+ $this->view->set("thesslstore_countries", $this->getCountryList());
+ $this->view->set("vars",$vars);
+ return $this->view->fetch();
+ }elseif($scr == 'importorder'){
+ $this->view = new View("import_orders", "default");
+ $this->view->base_uri = $this->base_uri;
+ $this->view->setDefaultView("components" . DS . "modules" . DS . "thesslstore_module" . DS);
+
+ // Load the helpers required for this view
+ Loader::loadHelpers($this, array("Form", "Html", "Widget"));
+ if (!isset($this->Record)){
+ Loader::loadComponents($this, ['Record']);
+ }
+ $clientsArray = array();
+ $invoiceArray = array();
+ $serviceArray = array();
+ $importOrderData = array();
+ /* Retrieve the company ID */
+ $companyID=Configure::get("Blesta.company_id");
+ // Load the Loader to fetch Package Groups to assign to the packages
+ Loader::loadModels($this, array("Clients","Invoices","Services"));
+ $clientsArray = $this->Clients->getAll($status = 'active');
+
+ foreach ($clientsArray as $key => $value) {
+ $clients[''] = Language::_("ThesslstoreModule.please_select", true);
+ $clients[$value->id] = $value->first_name.' '.$value->last_name.' (#'.$value->id.')';
+ }
+
+ $invoiceArray=$this->Invoices->getAll($client_id = null, $status = 'open', $order_by = ['id' => 'DESC'], $currency = null);
+
+ foreach ($invoiceArray as $key => $value) {
+ $invoices[$value->id] = $value->id;
+ }
+
+ $serviceArray = $this->Record->select(['id'])->from("services")->order(array("id"=>"desc"))->fetchAll();
+
+ foreach ($serviceArray as $key => $value) {
+ $services[$value->id] = $value->id;
+ }
+
+ //Get package pricing id
+ $importOrderData = $this->Record->select()->from("sslstore_import_orders")->where("date_renews", ">=", date('Y-m-d H:i:s'))->fetchAll();
+
+ if (!empty($clients)) {
+ $vars['clients'] = $clients;
+ $vars['invoices'] = $invoices;
+ $vars['services'] = $services;
+ $vars['importOrderData'] = $importOrderData;
+ }
+ else
+ {
+ $vars['clients'] = "false";
+ }
+ // Set unspecified checkboxes
+
+ $this->view->set("vars", (object)$vars);
+ return $this->view->fetch();
}
else{
$this->view = new View("invalid_action", "default");
@@ -1159,7 +1519,7 @@ public function addModuleRow(array &$vars) {
}
}
$meta_fields = array("thesslstore_reseller_name","api_partner_code_live", "api_auth_token_live", "api_partner_code_test",
- "api_auth_token_test", "api_mode", "hide_changeapprover_option");
+ "api_auth_token_test", "api_mode");
$encrypted_fields = array("api_partner_code_live", "api_auth_token_live", "api_partner_code_test", "api_auth_token_test");
@@ -1193,12 +1553,6 @@ public function addModuleRow(array &$vars) {
}
}
$this->Input->setRules($this->getCredentialRules($vars));
- if(!empty($vars['hide_changeapprover_option'])){
- $hide_changeapprover_option=$vars['hide_changeapprover_option'];
- }
- else{
- $hide_changeapprover_option='NO';
- }
if ($this->Input->validates($vars)) {
$meta['thesslstore_reseller_name'] = $vars['thesslstore_reseller_name'];
$meta['api_partner_code_live'] = $vars['api_partner_code_live'];
@@ -1206,7 +1560,6 @@ public function addModuleRow(array &$vars) {
$meta['api_partner_code_test'] = $vars['api_partner_code_test'];
$meta['api_auth_token_test'] = $vars['api_auth_token_test'];
$meta['api_mode'] = $vars['api_mode'];
- $meta['hide_changeapprover_option'] = $hide_changeapprover_option;
Loader::loadModels($this, array("ModuleManager"));
$this->ModuleManager->editRow($vars['module_row_id'], $meta);
@@ -1230,6 +1583,9 @@ public function addModuleRow(array &$vars) {
elseif($scr == 'importpackage') {
$this->Input->setRules($this->getImportPackageRules($vars));
if ($this->Input->validates($vars)) {
+ $posted_products = $vars['products'];
+ $import_package_mode = $vars['import_package_mode'];
+ $currency_code = $vars['currency_code'];
/* Retrieve the module row ID */
$module_rows = $this->getModuleRows();
@@ -1241,6 +1597,17 @@ public function addModuleRow(array &$vars) {
}
/* Get the products array */
$products = $this->getProducts();
+ //get api currency exchange rate
+ $apiCurrencyCode = (isset($products[0]->CurrencyCode) ? $products[0]->CurrencyCode : '') ;
+ /* Retrieve the company ID */
+ $companyID=Configure::get("Blesta.company_id");
+ // Load the Loader to fetch supported Currencies
+ Loader::loadModels($this, array("Currencies"));
+ $currencyDetails = $this->Currencies->get($apiCurrencyCode,$companyID);
+ $api_currency_rate = $currencyDetails->exchange_rate;
+ //Get the selected currecny exchange rate
+ $getSelectedCurrency = $this->Currencies->get($currency_code,$companyID);
+ $currency_rate = $getSelectedCurrency->exchange_rate;
/* Call the function to get the module name */
$moduleName = $this->getName();
@@ -1263,157 +1630,185 @@ public function addModuleRow(array &$vars) {
Loader::loadModels($this, array("Packages"));
$packagesByGroupArray = $this->Packages->getAllPackagesByGroup($vars['product_group']);
- $already_added_packages = array();
+ $alreadyAdded = array();
foreach($packagesByGroupArray as $pack_data){
if ($pack_data->module_id == $moduleID) {
$package = $this->Packages->get($pack_data->id);
- $already_added_packages[] = $package->meta->thesslstore_product_code;
+ $alreadyAdded[] = $package->meta->thesslstore_product_code;
}
}
- //get Email content
- $email_content = $this->emailContent();
-
+ $already_added_packages = array();
$packageArray = array();
/* Set the import package count default ZERO */
$countOfImportPackages = 0;
- foreach ($products as $key => $value) {
- if(!in_array($value->ProductCode, $already_added_packages)){
-
- $packageArray['name'] = $value->ProductName;
- $packageArray['status'] = 'active';
- $packageArray['qty_unlimited'] = 'true';
- $ProductDescription = $value->ProductDescription;
- $sslfeaturelink = $value->ProductSlug;
- $viewmorelink = " View Full Product Details";
- $packageArray['description_html'] = $ProductDescription . $viewmorelink;
- $packageArray['description'] = '';
- $profitmargin = $vars['profit_margin'];
-
-
- /* Create Option group for Additional SAN / Additional Server products */
- $packageArray['option_groups'] = array();
- if(($value->IsSanEnable == 'true' && $value->ProductCode != 'quicksslpremiummd') || ($value->isNoOfServerFree == false && $value->isCodeSigning == false && $value->isScanProduct == false)) {
-
- /* Load the Loader to get Package Group Name for given ID */
- Loader::loadModels($this, array("PackageGroups"));
- $packageGroupArray = $this->PackageGroups->get($vars['product_group']);
- $packageGroupName = $packageGroupArray->name;
- $optionGroupValue = array('name' => $packageGroupName . '#' . $value->ProductName, 'description' => '', 'company_id' => Configure::get("Blesta.company_id"));
- /* Load the Loader to add option group for respective products */
- Loader::loadModels($this, array("PackageOptionGroups"));
- $optionGroupId = $this->PackageOptionGroups->add($optionGroupValue);
-
-
- /* Create Configuration options of Additional SAN */
- if ($value->IsSanEnable == 'true' && $value->ProductCode != 'quicksslpremiummd') {
- $TotalMaxSan = $value->MaxSan - $value->MinSan;
- $PackageOptions['label'] = 'Additional SAN (' . $value->ProductName . ')';
- $PackageOptions['name'] = 'additional_san';
- $PackageOptions['type'] = 'quantity';
- $PackageOptions['addable'] = 1;
- /* Call setupPrice function to calculate the price based on the desired profit margin */
- $sanPricingArray = array();
-
- //setup SAN price
- foreach($value->PricingInfo as $price_info){
- $san_price = $this->setupPrice($price_info->PricePerAdditionalSAN, $profitmargin);
- $sanPricingArray[] = array('term' => $price_info->NumberOfMonths, 'period' => 'month', 'currency' => 'USD', 'price' => $san_price, 'setup_fee' => '', 'cancel_fee' => '');
- }
+ foreach ($posted_products as $productCode) {
+ if (in_array($productCode, $alreadyAdded)) {
+ $already_added_packages[] = $productCode;
+ }
+ else{
+ //get Email content
+ $email_content = $this->emailContent();
+
+ foreach ($products as $key => $value) {
+ if ($value->ProductCode == $productCode) {
+ $packageArray['name'] = $value->ProductName;
+ $packageArray['status'] = 'active';
+ $packageArray['qty_unlimited'] = 'true';
+ $ProductDescription = $value->ProductDescription;
+ $sslfeaturelink = $value->ProductSlug;
+ $viewmorelink = " View Full Product Details";
+ $packageArray['description_html'] = $ProductDescription . $viewmorelink;
+ $packageArray['description'] = '';
+ $profitmargin = $vars['profit_margin'];
+
+
+ /* Create Option group for Additional SAN / Additional Server products */
+ $packageArray['option_groups'] = array();
+ if(($value->IsSanEnable == 'true' && $value->ProductCode != 'quicksslpremiummd') || ($value->isNoOfServerFree == false && $value->isCodeSigning == false && $value->isScanProduct == false)) {
+
+ /* Load the Loader to get Package Group Name for given ID */
+ Loader::loadModels($this, array("PackageGroups"));
+ $packageGroupArray = $this->PackageGroups->get($vars['product_group']);
+ $packageGroupName = $packageGroupArray->name;
+ $optionGroupValue = array('name' => $packageGroupName . '#' . $value->ProductName, 'description' => '', 'company_id' => Configure::get("Blesta.company_id"));
+ /* Load the Loader to add option group for respective products */
+ Loader::loadModels($this, array("PackageOptionGroups"));
+ $optionGroupId = $this->PackageOptionGroups->add($optionGroupValue);
+
+
+ /* Create Configuration options of Additional SAN */
+ if ($value->IsSanEnable == 'true' && $value->ProductCode != 'quicksslpremiummd') {
+ $TotalMaxSan = $value->MaxSan - $value->MinSan;
+ $PackageOptions['label'] = 'Additional SAN (' . $value->ProductName . ')';
+ $PackageOptions['name'] = 'additional_san';
+ $PackageOptions['type'] = 'quantity';
+ $PackageOptions['addable'] = 1;
+ /* Call setupPrice function to calculate the price based on the desired profit margin */
+ $sanPricingArray = array();
+
+ //setup SAN price
+ foreach($value->PricingInfo as $price_info){
+ if($import_package_mode == 'with_price'){
+ $san_price = $vars[$value->ProductCode.'_'.$price_info->NumberOfMonths.'_san'];
+ $san_price = number_format($san_price,2, '.', '');
+ }
+ else{
+ $san_price = $this->setupPrice($price_info->PricePerAdditionalSAN, $profitmargin);
+ $san_price = $this->currecncy_converter($san_price, $currency_rate, $api_currency_rate);
+ }
+ $sanPricingArray[] = array('term' => $price_info->NumberOfMonths, 'period' => 'month', 'currency' => $currency_code, 'price' => $san_price, 'setup_fee' => '', 'cancel_fee' => '');
+ }
- if ($value->MinSan != 0) {
- $PackageOptions['values'][0] = array('name' => 'Additional SAN (' . $value->MinSan . ' domains are included by default)', 'value' => '', 'min' => '0', 'max' => $TotalMaxSan, 'step' => 1, 'pricing' => $sanPricingArray);
- } else {
- $PackageOptions['values'][0] = array('name' => 'Additional SAN', 'value' => '', 'min' => '0', 'max' => $TotalMaxSan, 'step' => 1, 'pricing' => $sanPricingArray);
- }
- $PackageOptions['groups'][0] = $optionGroupId;
- $PackageOptions['company_id'] = Configure::get("Blesta.company_id");
- $PackageOptions['editable'] = 0;
- /* Load the Loader to add options for respective option group */
- Loader::loadModels($this, array("PackageOptions"));
- $additionalSanOptionId = $this->PackageOptions->add($PackageOptions);
- }
+ if ($value->MinSan != 0) {
+ $PackageOptions['values'][0] = array('name' => 'Additional SAN (' . $value->MinSan . ' domains are included by default)', 'value' => '', 'min' => '0', 'max' => $TotalMaxSan, 'step' => 1, 'pricing' => $sanPricingArray);
+ } else {
+ $PackageOptions['values'][0] = array('name' => 'Additional SAN', 'value' => '', 'min' => '0', 'max' => $TotalMaxSan, 'step' => 1, 'pricing' => $sanPricingArray);
+ }
+ $PackageOptions['groups'][0] = $optionGroupId;
+ $PackageOptions['company_id'] = Configure::get("Blesta.company_id");
+ $PackageOptions['editable'] = 0;
+ /* Load the Loader to add options for respective option group */
+ Loader::loadModels($this, array("PackageOptions"));
+ $additionalSanOptionId = $this->PackageOptions->add($PackageOptions);
+ }
- /* Create Configuration options of Additional SERVER */
- if ( $value->isNoOfServerFree == false && $value->isCodeSigning == false && $value->isScanProduct == false) {
- $TotalMaxServer = '9';
- $PackageOptions['label'] = 'Additional SERVER (' . $value->ProductName . ')';
- $PackageOptions['name'] = 'additional_server';
- $PackageOptions['type'] = 'quantity';
- $PackageOptions['addable'] = 1;
- /* Call setupPrice function to calculate the price based on the desired profit margin */
- $serverPricingArray = array();
- //Setup Server Price
+ /* Create Configuration options of Additional SERVER */
+ if ( $value->isNoOfServerFree == false && $value->isCodeSigning == false && $value->isScanProduct == false) {
+ $TotalMaxServer = '9';
+ $PackageOptions['label'] = 'Additional SERVER (' . $value->ProductName . ')';
+ $PackageOptions['name'] = 'additional_server';
+ $PackageOptions['type'] = 'quantity';
+ $PackageOptions['addable'] = 1;
+ /* Call setupPrice function to calculate the price based on the desired profit margin */
+ $serverPricingArray = array();
+ //Setup Server Price
+ foreach($value->PricingInfo as $price_info){
+ if($import_package_mode == 'with_price'){
+ $server_price = $vars[$value->ProductCode.'_'.$price_info->NumberOfMonths.'_server'];
+ $server_price = number_format($server_price,2, '.', '');
+ }
+ else{
+ $server_price = $this->setupPrice($price_info->PricePerAdditionalServer, $profitmargin);
+ $server_price = $this->currecncy_converter($server_price, $currency_rate, $api_currency_rate);
+ }
+ $serverPricingArray[] = array('term' => $price_info->NumberOfMonths, 'period' => 'month', 'currency' => $currency_code, 'price' => $server_price, 'setup_fee' => '', 'cancel_fee' => '');
+ }
+ $PackageOptions['values'][0] = array('name' => 'Additional SERVER', 'value' => '', 'min' => '0', 'max' => $TotalMaxServer, 'step' => 1, 'pricing' => $serverPricingArray);
+ $PackageOptions['groups'][0] = $optionGroupId;
+ $PackageOptions['company_id'] = Configure::get("Blesta.company_id");
+ $PackageOptions['editable'] = 0;
+ /* Load the Loader to add options for respective option group */
+ Loader::loadModels($this, array("PackageOptions"));
+ $additionalServerOptionId = $this->PackageOptions->add($PackageOptions);
+ }
+ $packageArray['option_groups'][0] = $optionGroupId;
+ }
+ $packageArray['module_id'] = $moduleID;
+ $packageArray['module_row'] = $moduleRowID;
+ /* Set the product type */
+ $productValidationType = 'N/A';
+ if($value->isDVProduct == 'true'){
+ $productValidationType='DV';
+ }
+ elseif($value->isOVProduct == 'true')
+ {
+ $productValidationType='OV';
+ }
+ elseif($value->isEVProduct == 'true')
+ {
+ $productValidationType='EV';
+ }
+ $isScanProduct='n';
+ if($value->isScanProduct == 'true')
+ {
+ $isScanProduct='y';
+ }
+ $isCodeSigning='n';
+ if($value->isCodeSigning == 'true')
+ {
+ $isCodeSigning='y';
+ }
+ $packageArray['meta'] = array(
+ 'thesslstore_product_code' => $value->ProductCode,
+ 'thesslstore_min_san' => $value->MinSan,
+ 'thesslstore_vendor_name' => strtoupper($value->VendorName),
+ 'thesslstore_validation_type' => $productValidationType,
+ 'thesslstore_is_scan_product' => $isScanProduct,
+ 'thesslstore_is_code_signing' => $isCodeSigning
+ );
+ /* Get the profit margin % from the vars */
+ $packageArray['pricing'] = array();
+
+ //Setup Price
foreach($value->PricingInfo as $price_info){
- $server_price = $this->setupPrice($price_info->PricePerAdditionalServer, $profitmargin);
- $serverPricingArray[] = array('term' => $price_info->NumberOfMonths, 'period' => 'month', 'currency' => 'USD', 'price' => $server_price, 'setup_fee' => '', 'cancel_fee' => '');
+ if($import_package_mode == 'with_price'){
+ $final_price = $vars[$value->ProductCode.'_'.$price_info->NumberOfMonths];
+ $final_price = number_format($final_price,2, '.', '');
+ }
+ else{
+ $final_price = $this->setupPrice($price_info->Price, $profitmargin);
+ $final_price = $this->currecncy_converter($final_price, $currency_rate, $api_currency_rate);
+ }
+ $packageArray['pricing'][] = array('term' => $price_info->NumberOfMonths, 'period' => 'month', 'currency' => $currency_code, 'price' => $final_price, 'setup_fee' => '', 'cancel_fee' => '');
}
- $PackageOptions['values'][0] = array('name' => 'Additional SERVER', 'value' => '', 'min' => '0', 'max' => $TotalMaxServer, 'step' => 1, 'pricing' => $serverPricingArray);
- $PackageOptions['groups'][0] = $optionGroupId;
- $PackageOptions['company_id'] = Configure::get("Blesta.company_id");
- $PackageOptions['editable'] = 0;
+
+ $packageArray['email_content'][0] = array('lang' => 'en_us','html' => $email_content);
+ $packageArray['select_group_type'] = 'existing';
+ $packageArray['groups'][0] = $vars['product_group'];
+ $packageArray['group_name'] = '';
+ $packageArray['company_id'] = Configure::get("Blesta.company_id");
+ $packageArray['taxable'] = 0;
+ $packageArray['single_term'] = 0;
/* Load the Loader to add options for respective option group */
- Loader::loadModels($this, array("PackageOptions"));
- $additionalServerOptionId = $this->PackageOptions->add($PackageOptions);
+ Loader::loadModels($this, array("Packages"));
+ $packageId = $this->Packages->add($packageArray);
+ $countOfImportPackages++;
}
- $packageArray['option_groups'][0] = $optionGroupId;
}
- $packageArray['module_id'] = $moduleID;
- $packageArray['module_row'] = $moduleRowID;
- /* Set the product type */
- $productValidationType = 'N/A';
- if($value->isDVProduct == 'true'){
- $productValidationType='DV';
- }
- elseif($value->isOVProduct == 'true')
- {
- $productValidationType='OV';
- }
- elseif($value->isEVProduct == 'true')
- {
- $productValidationType='EV';
- }
- $isScanProduct='n';
- if($value->isScanProduct == 'true')
- {
- $isScanProduct='y';
- }
- $isCodeSigning='n';
- if($value->isCodeSigning == 'true')
- {
- $isCodeSigning='y';
- }
- $packageArray['meta'] = array(
- 'thesslstore_product_code' => $value->ProductCode,
- 'thesslstore_min_san' => $value->MinSan,
- 'thesslstore_vendor_name' => $value->VendorName,
- 'thesslstore_validation_type' => $productValidationType,
- 'thesslstore_is_scan_product' => $isScanProduct,
- 'thesslstore_is_code_signing' => $isCodeSigning
- );
- /* Get the profit margin % from the vars */
- $packageArray['pricing'] = array();
-
- //Setup Price
- foreach($value->PricingInfo as $price_info){
- $final_price = $this->setupPrice($price_info->Price, $profitmargin);
- $packageArray['pricing'][] = array('term' => $price_info->NumberOfMonths, 'period' => 'month', 'currency' => 'USD', 'price' => $final_price, 'setup_fee' => '', 'cancel_fee' => '');
- }
-
- $packageArray['email_content'][0] = array('lang' => 'en_us','html' => $email_content);
- $packageArray['select_group_type'] = 'existing';
- $packageArray['groups'][0] = $vars['product_group'];
- $packageArray['group_name'] = '';
- $packageArray['company_id'] = Configure::get("Blesta.company_id");
- $packageArray['taxable'] = 0;
- $packageArray['single_term'] = 0;
- /* Load the Loader to add options for respective option group */
- Loader::loadModels($this, array("Packages"));
- $packageId = $this->Packages->add($packageArray);
- $countOfImportPackages++;
}
}
$urlRedirect = explode("&", $_SERVER['REQUEST_URI']);
@@ -1426,10 +1821,9 @@ public function addModuleRow(array &$vars) {
}
}
elseif($scr == 'setupprice'){
-
//Load Pricing Model
- Loader::loadModels($this, array("Packages","PackageOptions","Pricings"));
-
+ Loader::loadModels($this, array("Currencies","Packages","PackageOptions","Pricings"));
+ $currency_code = $vars['currency_code'];
if(isset($vars['thesslstore_apply_margin']) && $vars['thesslstore_apply_margin'] == 'yes'){
$rules = array(
'thesslstore_margin_percentage' => array(
@@ -1437,19 +1831,30 @@ public function addModuleRow(array &$vars) {
'rule' => "isEmpty",
'negate' => true,
'message' => Language::_("ThesslstoreModule.!error.profit_margin.empty", true)
- ),
+ ),
'valid' => array(
'rule' => array("isPassword", 1, "num"),
'message' => Language::_("ThesslstoreModule.!error.profit_margin.valid", true)
- )
)
- );
+ )
+ );
//Set rules to validate fields
$this->Input->setRules($rules);
if ($this->Input->validates($vars)) {
$margin_percentage = $vars['thesslstore_margin_percentage'];
//Get product pricing from API
$api_products = $this->getProducts();
+ //get api currency exchange rate
+ $apiCurrencyCode = (isset($api_products[0]->CurrencyCode) ? $api_products[0]->CurrencyCode : '') ;
+ /* Retrieve the company ID */
+ $companyID=Configure::get("Blesta.company_id");
+ // Load the Loader to fetch supported Currencies
+ $currencyDetails = $this->Currencies->get($apiCurrencyCode,$companyID);
+ $api_currency_rate = $currencyDetails->exchange_rate;
+ //Get the selected currecny exchange rate
+ $getSelectedCurrency = $this->Currencies->get($currency_code,$companyID);
+ $currency_rate = $getSelectedCurrency->exchange_rate;
+
$products = array();
foreach($api_products as $product){
$products[$product->ProductCode] = $product->PricingInfo;
@@ -1466,13 +1871,13 @@ public function addModuleRow(array &$vars) {
foreach($package->pricing as $pricing){
$packages_pricing[$package_id][$pricing->term]['price_id'] = $pricing->pricing_id;
- if(($pricing->term == 12 && $pricing->period == 'month') || ($pricing->term == 1 && $pricing->period == 'year') && $pricing->currency == 'USD'){
+ if(($pricing->term == 12 && $pricing->period == 'month') || ($pricing->term == 1 && $pricing->period == 'year') && $pricing->currency == $currency_code){
$packages_pricing[$package_id][12]['price_id'] = $pricing->pricing_id;
}
- elseif(($pricing->term == 24 && $pricing->period == 'month') || ($pricing->term == 2 && $pricing->period == 'year' ) && $pricing->currency == 'USD'){
+ elseif(($pricing->term == 24 && $pricing->period == 'month') || ($pricing->term == 2 && $pricing->period == 'year' ) && $pricing->currency == $currency_code){
$packages_pricing[$package_id][24]['price_id'] = $pricing->pricing_id;
}
- elseif(($pricing->term == 36 && $pricing->period == 'month') || ($pricing->term == 3 && $pricing->period == 'year') && $pricing->currency == 'USD'){
+ elseif(($pricing->term == 36 && $pricing->period == 'month') || ($pricing->term == 3 && $pricing->period == 'year') && $pricing->currency == $currency_code){
$packages_pricing[$package_id][36]['price_id'] = $pricing->pricing_id;
}
else{
@@ -1493,13 +1898,13 @@ public function addModuleRow(array &$vars) {
}
if(isset($option->values[0]->pricing)){
foreach($option->values[0]->pricing as $pricing){
- if(($pricing->term == 12 && $pricing->period == 'month') || ($pricing->term == 1 && $pricing->period == 'year') && $pricing->currency == 'USD'){
+ if(($pricing->term == 12 && $pricing->period == 'month') || ($pricing->term == 1 && $pricing->period == 'year') && $pricing->currency == $currency_code){
$packages_pricing[$package_id][12][$key] = $pricing->pricing_id;
}
- elseif(($pricing->term == 24 && $pricing->period == 'month') || ($pricing->term == 2 && $pricing->period == 'year' ) && $pricing->currency == 'USD'){
+ elseif(($pricing->term == 24 && $pricing->period == 'month') || ($pricing->term == 2 && $pricing->period == 'year' ) && $pricing->currency == $currency_code){
$packages_pricing[$package_id][24][$key] = $pricing->pricing_id;
}
- elseif(($pricing->term == 36 && $pricing->period == 'month') || ($pricing->term == 3 && $pricing->period == 'year') && $pricing->currency == 'USD'){
+ elseif(($pricing->term == 36 && $pricing->period == 'month') || ($pricing->term == 3 && $pricing->period == 'year') && $pricing->currency == $currency_code){
$packages_pricing[$package_id][36][$key] = $pricing->pricing_id;
}
else{
@@ -1524,7 +1929,9 @@ public function addModuleRow(array &$vars) {
//Update with new price
$data['term'] = $info->term;
$data['period'] = $info->period;
- $data['price'] = $this->setupPrice($pricing_info->Price,$margin_percentage);
+ $price = $this->setupPrice($pricing_info->Price,$margin_percentage);
+ $final_price = $this->currecncy_converter($price, $currency_rate, $api_currency_rate);
+ $data['price'] = $final_price;
$data['setup_fee'] = $info->setup_fee;
$data['cancel_fee'] = $info->cancel_fee;
$data['currency'] = $info->currency;
@@ -1539,7 +1946,9 @@ public function addModuleRow(array &$vars) {
//Update with new price
$data['term'] = $info->term;
$data['period'] = $info->period;
- $data['price'] = $this->setupPrice($pricing_info->PricePerAdditionalSAN, $margin_percentage);
+ $price = $this->setupPrice($pricing_info->PricePerAdditionalSAN, $margin_percentage);
+ $final_price = $this->currecncy_converter($price, $currency_rate, $api_currency_rate);
+ $data['price'] = $final_price;
$data['setup_fee'] = $info->setup_fee;
$data['cancel_fee'] = $info->cancel_fee;
$data['currency'] = $info->currency;
@@ -1555,7 +1964,9 @@ public function addModuleRow(array &$vars) {
//Update with new price
$data['term'] = $info->term;
$data['period'] = $info->period;
- $data['price'] = $this->setupPrice($pricing_info->PricePerAdditionalServer, $margin_percentage);
+ $price = $this->setupPrice($pricing_info->PricePerAdditionalServer, $margin_percentage);
+ $final_price = $this->currecncy_converter($price, $currency_rate, $api_currency_rate);
+ $data['price'] = $final_price;
$data['setup_fee'] = $info->setup_fee;
$data['cancel_fee'] = $info->cancel_fee;
$data['currency'] = $info->currency;
@@ -1567,37 +1978,39 @@ public function addModuleRow(array &$vars) {
//Redirect with success message
$url = explode("?",$_SERVER['REQUEST_URI']);
- header('Location:' . $url[0].'?scr=setupprice&msg=success');
+ header('Location:' . $url[0].'?scr=setupprice¤cy='.$currency_code.'&msg=success');
exit();
}
-
-
}
else{
//Update value based on textboxes
-
- $company_id = Configure::get("Blesta.company_id");
- $pricings = $this->Pricings->getAll($company_id);
- $new_price = $vars['price'];
- foreach($pricings as $pricing){
- $pricing_id = $pricing->id;
- if(isset($new_price[$pricing_id])){
- if($new_price[$pricing_id] != $pricing->price){
- //Update with new price
- $data['term'] = $pricing->term;
- $data['period'] = $pricing->period;
- $data['price'] = $new_price[$pricing_id];
- $data['setup_fee'] = $pricing->setup_fee;
- $data['cancel_fee'] = $pricing->cancel_fee;
- $data['currency'] = $pricing->currency;
-
- $this->Pricings->edit($pricing_id, $data);
+ $new_price_array = isset($vars['price']) ? $vars['price']: array();
+
+ //Update Package data
+ foreach($new_price_array as $price_id => $price_value){
+ //Get package data using pricing_id
+ $pricings = $this->Pricings->get($price_id);
+ $pricings = array($pricings);
+ foreach($pricings as $pricing){
+ $pricing_id = $pricing->id;
+ if(isset($price_value)){
+ if($price_value != $pricing->price){
+ //Update with new price
+ $data['term'] = $pricing->term;
+ $data['period'] = $pricing->period;
+ $data['price'] = $price_value;
+ $data['setup_fee'] = $pricing->setup_fee;
+ $data['cancel_fee'] = $pricing->cancel_fee;
+ $data['currency'] = $pricing->currency;
+
+ $this->Pricings->edit($pricing_id, $data);
+ }
}
}
}
$url = explode("?",$_SERVER['REQUEST_URI']);
- header('Location:' . $url[0].'?scr=setupprice&msg=success');
+ header('Location:' . $url[0].'?scr=setupprice¤cy='.$currency_code.'&msg=success');
exit();
}
@@ -1608,17 +2021,396 @@ public function addModuleRow(array &$vars) {
header('Location:' . $url[0].'?scr=replacementorder&date='.$replace_by_date);
exit();
}
+ elseif($scr == 'updatecurrency'){
+ $currency_code = $vars['currency_code'];
+ $url = explode("?",$_SERVER['REQUEST_URI']);
+ header('Location:' . $url[0].'?scr=setupprice¤cy='.$currency_code);
+ exit();
+ }
+ elseif($scr == 'additionalsettings'){
+ $meta_fields = array("use_default_tech_details","thesslstore_tech_job_title", "thesslstore_tech_first_name", "thesslstore_tech_last_name",
+ "thesslstore_tech_org_name", "thesslstore_tech_address", "thesslstore_tech_phone", "thesslstore_tech_email", "thesslstore_tech_city", "thesslstore_tech_state", "thesslstore_tech_country", "thesslstore_tech_zipcode","additional_days_for_neworder","additional_days_for_reneworder");
+ $encrypted_fields = array();
+
+ // Build the meta data
+ $meta = array();
+ foreach ($vars as $key => $value) {
+ if (in_array($key, $meta_fields)) {
+ $meta[] = array(
+ 'key' => $key,
+ 'value' => $value,
+ 'encrypted' => in_array($key, $encrypted_fields) ? 1 : 0
+ );
+ }
+ }
+ /* Call the function to get the module name */
+ $moduleName = $this->getName();
+
+ /* Load the Loader to fetch info of All the installed Module */
+ Loader::loadModels($this, array("ModuleManager"));
+ $moduleArray = $this->ModuleManager->getInstalled();
+ /* Retrieve the Company ID which was assigned to our module */
+ $moduleIDObject = null;
+ foreach ($moduleArray as $info) {
+ if ($moduleName == $info->name) {
+ $moduleIDObject = $info;
+ break;
+ }
+ }
+ $moduleID = $moduleIDObject->id;
+ $this->ModuleManager->setMeta($moduleID, $meta);
+ //Redirect with success message
+ $url = explode("?",$_SERVER['REQUEST_URI']);
+ header('Location:' . $url[0].'?scr=additionalsettings&msg=success');
+ exit();
+ }
+ elseif($scr == 'importorder'){
+ /* Load the Loader to fetch info of All the installed Module */
+ Loader::loadModels($this, array("ModuleManager","Services","Packages","PackageOptions","Invoices"));
- }
+ if (!isset($this->Record)){
+ Loader::loadComponents($this, ['Record']);
+ }
- /**
- * Use this function to set up product pricing with the desired margin
- */
- private function setupPrice($price,$margin){
- $givenPrice = ($price+$price*$margin/100);
- $finalPrice = number_format($givenPrice,2, '.', '');
+ $errors = '';
+ $storeOrderId = (isset($_POST['store_order_id']) ? $_POST['store_order_id'] : '' );
+ $orderType = (isset($_POST['order_type']) ? $_POST['order_type'] : '' );
+ $clientId = (isset($_POST['client']) ? $_POST['client'] : '' );
+ $invoiceMethod = (isset($_POST['invoice_method']) ? $_POST['invoice_method'] : '');
+ $sendEmail = (isset($_POST['send_email']) ? true : false);
+
+ $enteredServiceId = (isset($_POST['service_id']) ? $_POST['service_id'] : '' );
+
+ if(!empty($storeOrderId)){
+ $api = $this->getApi();
+ $orderStatusReq = new order_status_request();
+ $orderStatusReq->TheSSLStoreOrderID = $storeOrderId;
+ $orderStatusResp = $api->order_status($orderStatusReq);
+
+ if($orderStatusResp->AuthResponse->isError == false){
+ /* Call the function to get the module name */
+ $moduleName = $this->getName();
+
+ $moduleArray = $this->ModuleManager->getInstalled();
+ /* Retrieve the Company ID which was assigned to our module */
+ $moduleIDObject = null;
+ foreach ($moduleArray as $info) {
+ if ($moduleName == $info->name) {
+ $moduleIDObject = $info;
+ break;
+ }
+ }
+ $moduleID = $moduleIDObject->id;
- return $finalPrice;
+ $serviceArray = $this->Services->searchServiceFields($moduleID,'thesslstore_order_id',$storeOrderId);
+
+ if(isset($serviceArray[0]->id))
+ {
+ $existingServiceId = $serviceArray[0]->id;
+ }
+
+ if(!$existingServiceId) {
+ //Get Product query
+ $productQueryReq = new product_query_request();
+ $productQueryReq->ProductType = 0;
+ $productQueryReq->ProductCode = $orderStatusResp->ProductCode;
+ $productQueryResp = $api->product_query($productQueryReq);
+ if ($productQueryResp != null && $productQueryResp[0]->AuthResponse->isError == false) {
+ if ($orderType == 'new_order') {
+ if (!empty($clientId)) {
+ //Get package id
+ $package_meta = $this->Record->select(['package_id'])->from("package_meta")->where("key", "=", "thesslstore_product_code")->where("value", "=", $orderStatusResp->ProductCode)->fetch();
+ $package_id = $package_meta->package_id;
+ //Get package
+ $package_data = $this->Packages->get($package_id);
+
+
+ if (isset($package_id) && $package_data != NULL) {
+ //Get pricing id
+ $pricingArray = array();
+ foreach ($package_data->pricing as $pricing) {
+ if ($pricing->term == $orderStatusResp->Validity && $pricing->period == "month") {
+ $pricing_id = $pricing->pricing_id;
+ }
+ }
+ //Get package pricing id
+ $packagePricingData = $this->Record->select(['id'])->from("package_pricing")->where("package_id", "=", $package_id)->where("pricing_id", "=", $pricing_id)->fetch();
+ $packagePrcingId = $packagePricingData->id;
+
+ $values["pricing_id"] = $packagePrcingId;
+ $values["client_id"] = $clientId;
+ $values["status"] = "active";
+ $values["use_module"] = 'false';
+ $values["thesslstore_order_id"] = $orderStatusResp->TheSSLStoreOrderID;
+ $values["thesslstore_token"] = $orderStatusResp->Token;
+
+ $configoptionsArray = array();
+
+ foreach ($package_data->option_groups as $confOptionGroup) {
+ $confOptionGroupID = $confOptionGroup->id;
+ //Get option id
+ $configOptionGroupData = $this->Record->select(['option_id'])->from("package_option_group")->where("option_group_id", "=", $confOptionGroupID)->fetch();
+ $configOptionID = $configOptionGroupData->option_id;
+ //Get option Name
+ $configOptionData = $this->PackageOptions-> getValues($configOptionID);
+ if (strpos($configOptionData[0]->name, 'Additional SAN') !== false) {
+ $configoptionsArray[$configOptionData[0]->id] = $orderStatusResp->SANCount - $productQueryResp[0]->MinSan;
+ } elseif (strpos($configOptionData[0]->name, 'Additional SERVER') !== false) {
+ $configoptionsArray[$configOptionData[0]->id] = $orderStatusResp->ServerCount - 1;
+ }
+ }
+ $values["configoptions"] = $configoptionsArray;
+ //place service in Blesta
+ $addedServiceId = $this->Services->add($values, $package = null, $sendEmail );
+
+ if (!empty($addedServiceId)) {
+ //Get service info
+ $serviceInfo = $this->Services->get($addedServiceId);
+ if(isset($invoiceMethod) && $invoiceMethod == 'create')
+ {
+ //Invoice Generation
+ $currency = $serviceInfo->package_pricing->currency;
+ $due_date = $serviceInfo->date_added;
+ $invoiceId = $this->Invoices->createFromServices($clientId,array($addedServiceId),$currency, $due_date,true,false);
+ }
+ else if(isset($invoiceMethod) && $invoiceMethod == 'append')
+ {
+ $invoiceId = (isset($_POST['invoice']) ? $_POST['invoice'] : 0 );
+ }
+ else{
+ $invoiceId = 0;
+ }
+
+ try{
+ $this->Record->insert("sslstore_orders",
+ array('service_id' => $addedServiceId,
+ 'package_id' => $package_id,
+ 'invoice_id' => $invoiceId,
+ 'store_order_id' => $orderStatusResp->TheSSLStoreOrderID,
+ 'is_sandbox_order' => $this->is_sandbox_mode,
+ 'created' => date('Y-m-d H:i:s')
+ )
+ );
+ }
+ catch(Exception $e){
+ $this->log('Database operation: Add Order Data', $e->getMessage(),'output', false);
+ }
+
+ try{
+ $this->Record->insert("sslstore_import_orders",
+ array('client_id' => $serviceInfo->client_id,
+ 'service_id' => $addedServiceId,
+ 'package_id' => $package_id,
+ 'invoice_id' => $invoiceId,
+ 'store_order_id' => $orderStatusResp->TheSSLStoreOrderID,
+ 'package_name' => $serviceInfo->package->name,
+ 'product_code' => $orderStatusResp->ProductCode,
+ 'term' => $serviceInfo->package_pricing->term,
+ 'period' => $serviceInfo->package_pricing->period,
+ 'date_added' => $serviceInfo->date_added,
+ 'date_renews' => $serviceInfo->date_renews
+ )
+ );
+ }
+ catch(Exception $e){
+ $this->log('Database operation: import order', $e->getMessage(),'output', false);
+ }
+
+ $url = explode("?",$_SERVER['REQUEST_URI']);
+ header('Location:' . $url[0].'?scr=importorder&msg=success');
+ exit();
+
+ } else {
+ $errors = "There is some issue while adding the service";
+ }
+ } else {
+ $errors = "No product found in panel";
+ }
+ } else {
+ $errors = "Please select Client";
+ }
+ } elseif ($orderType == 'existing_order') {
+ //Map existing Blesta Service with TSS order
+ //Check this service id is exist or not
+ if(!empty($enteredServiceId)){
+ //Get service info
+ $serviceInfo = $this->Services->get($enteredServiceId);
+ if(!empty($serviceInfo)){
+ $packageId = $serviceInfo->package->id;
+ //Get service info
+ $packageInfo = $this->Packages->get($packageId);
+ if($packageInfo->meta->thesslstore_product_code == $orderStatusResp->ProductCode){
+ //check service is already linked store order id
+ $storeOrderId = '';
+ $sslOrderData = $this->Record->select(['store_order_id'])->from("sslstore_orders")->where("service_id", "=", $enteredServiceId)->fetch();
+ $storeOrderId = $sslOrderData->store_order_id;
+ if(empty($storeOrderId)){
+ $invoice_data = $this->Record->select(['invoice_id'])->from("service_invoices")->where("service_id", "=", $enteredServiceId)->order(array("invoice_id" => "desc"))->fetch();
+ try{
+ $this->Record->insert("sslstore_orders",
+ array('service_id' => $enteredServiceId,
+ 'package_id' => $serviceInfo->package->id,
+ 'invoice_id' => $invoice_data->invoice_id,
+ 'store_order_id' => $orderStatusResp->TheSSLStoreOrderID,
+ 'is_sandbox_order' => $this->is_sandbox_mode,
+ 'created' => date('Y-m-d H:i:s')
+ )
+ );
+ }
+ catch(Exception $e){
+ $this->log('Database operation: Add Order Data', $e->getMessage(),'output', false);
+ }
+
+ try{
+ $this->Record->insert("sslstore_import_orders",
+ array('client_id' => $serviceInfo->client_id,
+ 'service_id' => $enteredServiceId,
+ 'package_id' => $serviceInfo->package->id,
+ 'invoice_id' => $invoice_data->invoice_id,
+ 'store_order_id' => $orderStatusResp->TheSSLStoreOrderID,
+ 'package_name' => $serviceInfo->package->name,
+ 'product_code' => $orderStatusResp->ProductCode,
+ 'term' => $serviceInfo->package_pricing->term,
+ 'period' => $serviceInfo->package_pricing->period,
+ 'date_added' => $serviceInfo->date_added,
+ 'date_renews' => $serviceInfo->date_renews
+ )
+ );
+ }
+ catch(Exception $e){
+ $this->log('Database operation: import order', $e->getMessage(),'output', false);
+ }
+
+ $this->Services->editField($enteredServiceId, array(
+ 'key' => "thesslstore_order_id",
+ 'value' => $orderStatusResp->TheSSLStoreOrderID,
+ 'encrypted' => 0,
+ ));
+
+ $this->Services->editField($enteredServiceId, array(
+ 'key' => "thesslstore_token",
+ 'value' => $orderStatusResp->Token,
+ 'encrypted' => 0,
+ ));
+
+ $this->Services->addField($enteredServiceId, array(
+ 'key' => "thesslstore_fqdn",
+ 'value' => $orderStatusResp->CommonName,
+ 'encrypted' => 0,
+ 'serialized' => 0
+ ));
+
+ try{
+ //update old record
+ $this->Record->where("service_id", "=", $enteredServiceId)->update("service_fields", array('serialized' => "0"));
+ }
+ catch(Exception $e){
+ $this->log('Database operation: update service fields', $e->getMessage(),'output', false);
+ }
+
+ $url = explode("?",$_SERVER['REQUEST_URI']);
+ header('Location:' . $url[0].'?scr=importorder&msg=success');
+ exit();
+ }
+ else{
+ $errors = 'This service id is already linked with Store order id:'.$storeOrderId;
+ }
+ }
+ else{
+ $errors = 'Package does not match with Store';
+ }
+ }
+ else{
+ $errors = 'Invalid service id';
+ }
+ }
+ else{
+ $errors = 'Please enter Blesta service id';
+ }
+ } else {
+ $errors = 'Please select order type';
+ }
+ } else {
+ $errors = (isset($productQueryResp[0]->AuthResponse->Message[0]) ? $productQueryResp[0]->AuthResponse->Message[0] : 'Invalid Product Code');
+ }
+ }
+ else{
+ $errors = 'This Store Order Id already linked with service id:'.$existingServiceId;
+ }
+ }
+ else{
+ $errors = (isset($orderStatusResp->AuthResponse->Message[0]) ? $orderStatusResp->AuthResponse->Message[0] : 'Invalid Store Order Id') ;
+ }
+ }
+ else{
+ $errors = 'Please enter store order id';
+ }
+ if(!empty($errors))
+ {
+ //Redirect with success message
+ $url = explode("?",$_SERVER['REQUEST_URI']);
+ header('Location:' . $url[0].'?scr=importorder&error=true&errormsg='. $errors);
+ exit();
+ }
+ die();
+
+ $meta_fields = array("use_default_tech_details","thesslstore_tech_job_title", "thesslstore_tech_first_name", "thesslstore_tech_last_name",
+ "thesslstore_tech_org_name", "thesslstore_tech_address", "thesslstore_tech_phone", "thesslstore_tech_email", "thesslstore_tech_city", "thesslstore_tech_state", "thesslstore_tech_country", "thesslstore_tech_zipcode","additional_days_for_neworder","additional_days_for_reneworder");
+ $encrypted_fields = array();
+
+ // Build the meta data
+ $meta = array();
+ foreach ($vars as $key => $value) {
+ if (in_array($key, $meta_fields)) {
+ $meta[] = array(
+ 'key' => $key,
+ 'value' => $value,
+ 'encrypted' => in_array($key, $encrypted_fields) ? 1 : 0
+ );
+ }
+ }
+ /* Call the function to get the module name */
+ $moduleName = $this->getName();
+
+ /* Load the Loader to fetch info of All the installed Module */
+ Loader::loadModels($this, array("ModuleManager"));
+ $moduleArray = $this->ModuleManager->getInstalled();
+ /* Retrieve the Company ID which was assigned to our module */
+ $moduleIDObject = null;
+ foreach ($moduleArray as $info) {
+ if ($moduleName == $info->name) {
+ $moduleIDObject = $info;
+ break;
+ }
+ }
+ $moduleID = $moduleIDObject->id;
+ $this->ModuleManager->setMeta($moduleID, $meta);
+ //Redirect with success message
+ $url = explode("?",$_SERVER['REQUEST_URI']);
+ header('Location:' . $url[0].'?scr=additionalsettings&msg=success');
+ exit();
+ }
+ }
+
+ /**
+ * Use this function to set up product pricing with the desired margin
+ */
+ private function setupPrice($price,$margin){
+ $givenPrice = ($price+$price*$margin/100);
+ $finalPrice = number_format($givenPrice,2, '.', '');
+
+ return $finalPrice;
+ }
+
+ /*------------------ Currency Converter Function ---------------------------*/
+ /**
+ * Use this function to convert the pricing
+ */
+ private function currecncy_converter($productprice, $currency_rate, $api_currency_rate){
+
+ $final_price = (($productprice * $currency_rate)/$api_currency_rate);
+
+ return number_format($final_price, 2, '.', '');
}
/**
@@ -1636,7 +2428,7 @@ public function editModuleRow($module_row, array &$vars) {
$scr = isset($_GET['scr']) ? $_GET['scr'] : '';
if($scr == 'editcredential') {
$meta_fields = array("thesslstore_reseller_name","api_partner_code_live", "api_auth_token_live", "api_partner_code_test",
- "api_auth_token_test", "api_mode", "hide_changeapprover_option");
+ "api_auth_token_test", "api_mode");
$encrypted_fields = array("api_partner_code_live", "api_auth_token_live", "api_partner_code_test", "api_auth_token_test");
// Validate module row
@@ -1652,7 +2444,6 @@ public function editModuleRow($module_row, array &$vars) {
);
}
}
-
return $meta;
}
}
@@ -1770,17 +2561,23 @@ function get_ssl_meta(code){
* @see Module::getModuleRow()
*/
public function addService($package, array $vars=null, $parent_package=null, $parent_service=null, $status="pending") {
+ if (!isset($this->Record)) {
+ Loader::loadComponents($this, ['Record']);
+ }
+
+
$thesslstore_order_id = '';
$token = '';
-
if($vars["use_module"] == "true") {
+ //Get Custom Order ID
+ $tssCustomOrderID = $this->customOrderId($vars["service_id"]);
$api = $this->getApi();
$invite_order_req = new order_inviteorder_request();
$invite_order_req->AddInstallationSupport = false;
- $invite_order_req->CustomOrderID = uniqid('TinyOrder-');
+ $invite_order_req->CustomOrderID = $tssCustomOrderID;
$invite_order_req->EmailLanguageCode = 'EN';
$invite_order_req->PreferVendorLink = false;
$invite_order_req->ProductCode = $package->meta->thesslstore_product_code;
@@ -1804,22 +2601,52 @@ public function addService($package, array $vars=null, $parent_package=null, $pa
$this->log($this->api_partner_code . "|ssl-invite-order", serialize($invite_order_req), "input", true);
- $result = $this->parseResponse($api->order_inviteorder($invite_order_req));
+ if(strtoupper($package->meta->thesslstore_vendor_name) == 'DIGICERT'){
+ $result = $this->parseResponse($api->digicert_inviteorder($invite_order_req));
+ }
+ else{
+ $result = $this->parseResponse($api->order_inviteorder($invite_order_req));
+ }
- if(empty($result)) {
+ if(empty($result)){
return;
}
- if(!empty($result->TheSSLStoreOrderID)) {
+ if(!empty($result->TheSSLStoreOrderID)){
$thesslstore_order_id = $result->TheSSLStoreOrderID;
$token = $result->Token;
+ //make entry in database
+ //get invoice id
+ $invoice_data = $this->Record->select(['invoice_id'])->from("service_invoices")->where("service_id", "=", $vars['service_id'])->order(array("invoice_id"=>"desc"))->fetch();
+ if($invoice_data){
+ try{
+ $this->Record->insert("sslstore_orders",
+ array('service_id' => $vars['service_id'],
+ 'package_id' => $package->id,
+ 'invoice_id' => $invoice_data->invoice_id,
+ 'store_order_id' => $thesslstore_order_id,
+ 'is_sandbox_order' => $this->is_sandbox_mode,
+ 'created' => date('Y-m-d H:i:s')
+ )
+ );
+ }
+ catch(Exception $e){
+ $this->log('Database operation: Add Service', $e->getMessage(),'output', false);
+ }
+ }
+
+
}
else {
$this->Input->setErrors(array('api' => array('internal' => 'No OrderID')));
return;
}
}
+ else{
+ $thesslstore_order_id = $vars['thesslstore_order_id'];
+ $token = $vars['thesslstore_token'];
+ }
// Return service fields
return array(
@@ -1851,10 +2678,10 @@ public function addService($package, array $vars=null, $parent_package=null, $pa
* @see Module::getModule()
* @see Module::getModuleRow()
*/
- public function renewService($package, $service, $parent_package=null, $parent_service=null) {
-
- $thesslstore_order_id = '';
- $thesslstore_token = '';
+ public function renewService($package, $service, $parent_package=null, $parent_service=null){
+ if (!isset($this->Record)) {
+ Loader::loadComponents($this, ['Record']);
+ }
$service_fields = $this->serviceFieldsToObject($service->fields);
@@ -1862,20 +2689,22 @@ public function renewService($package, $service, $parent_package=null, $parent_s
$old_thesslstore_order_id = $service_fields->thesslstore_order_id;
- $order_status_response = $this->getSSLOrderStatus($old_thesslstore_order_id);
+ $order_status_response = $this->getSSLOrderStatus($old_thesslstore_order_id, $package->meta->thesslstore_vendor_name);
+
+ //Get Custom Order ID
+ $tssCustomOrderID = $this->customOrderId($service->id);
+ $tssCustomOrderID = $tssCustomOrderID."-renew-".$old_thesslstore_order_id;
//Placed Invite order first
$api = $this->getApi();
-
$invite_order_req = new order_inviteorder_request();
$invite_order_req->AddInstallationSupport = false;
- $invite_order_req->CustomOrderID = uniqid('TinyOrder-');
+ $invite_order_req->CustomOrderID = $tssCustomOrderID;
$invite_order_req->EmailLanguageCode = 'EN';
$invite_order_req->PreferVendorLink = false;
$invite_order_req->ProductCode = $package->meta->thesslstore_product_code;
-
//get additional server and san value
$additional_san = 0;
$additional_server = 0;
@@ -1892,8 +2721,8 @@ public function renewService($package, $service, $parent_package=null, $parent_s
$invite_order_req->ServerCount = $server_count;
$validity_period = 12; //Months
- foreach($package->pricing as $pricing) {
- if ($pricing->id == $service->pricing_id) {
+ foreach($package->pricing as $pricing){
+ if($pricing->id == $service->pricing_id){
if($pricing->period == 'month')
$validity_period = $pricing->term;
elseif($pricing->period == 'year')
@@ -1907,16 +2736,45 @@ public function renewService($package, $service, $parent_package=null, $parent_s
$this->log($this->api_partner_code . "|ssl-invite-renew-order", serialize($invite_order_req), "input", true);
- $result = $this->parseResponse($api->order_inviteorder($invite_order_req));
+ if($package->meta->thesslstore_vendor_name == 'DIGICERT'){
+ $result = $this->parseResponse($api->digicert_inviteorder($invite_order_req));
+ }
+ else{
+ $result = $this->parseResponse($api->order_inviteorder($invite_order_req));
+ }
if(empty($result)) {
return null;
}
- if(!empty($result->TheSSLStoreOrderID)) {
+ if(!empty($result->TheSSLStoreOrderID)){
$thesslstore_order_id = $result->TheSSLStoreOrderID;
$thesslstore_token = $result->Token;
+ //make entry in database
+ //get invoice id
+ $invoice_data = $this->Record->select(['invoice_id'])->from("service_invoices")->where("service_id", "=", $service->id)->order(array("invoice_id"=>"desc"))->fetch();
+ if($invoice_data){
+ try{
+ $this->Record->insert("sslstore_orders",
+ array('service_id' => $service->id,
+ 'package_id' => $package->id,
+ 'invoice_id' => $invoice_data->invoice_id,
+ 'store_order_id' => $thesslstore_order_id,
+ 'renew_from' => $old_thesslstore_order_id,
+ 'is_sandbox_order' => $this->is_sandbox_mode,
+ 'created' => date('Y-m-d H:i:s')
+ )
+ );
+
+ //update old record
+ $this->Record->where("store_order_id", "=", $old_thesslstore_order_id)->update("sslstore_orders", array('renew_to' => $thesslstore_order_id));
+ }
+ catch(Exception $e){
+ $this->log('Database operation: Renew Service', $e->getMessage(),'output', false);
+ }
+ }
+
$service_meta[] = array(
'key' => "thesslstore_order_id",
'value' => $thesslstore_order_id,
@@ -1927,6 +2785,12 @@ public function renewService($package, $service, $parent_package=null, $parent_s
'value' => $thesslstore_token,
'encrypted' => 0
);
+
+ $service_meta[] = array(
+ 'key' => "thesslstore_renew_from",
+ 'value' => $old_thesslstore_order_id,
+ 'encrypted' => 0
+ );
$send_invite_order_email = true;
//if CSR is found then place full order.
@@ -1984,30 +2848,31 @@ public function renewService($package, $service, $parent_package=null, $parent_s
$new_order->AddInstallationSupport = false;
$new_order->AdminContact = $contact;
$new_order->CSR = $service_fields->thesslstore_csr;
- $new_order->DomainName = '';
- $new_order->CustomOrderID = uniqid('BlestaFullOrder-');
+ $new_order->DomainName = $order_status_response->CommonName;
$new_order->RelatedTheSSLStoreOrderID = '';
$new_order->DNSNames = explode(',',$order_status_response->DNSNames);
$new_order->EmailLanguageCode = 'EN';
$new_order->ExtraProductCodes = '';
- $new_order->OrganizationInfo->DUNS = $order_status_response->DUNS;
- $new_order->OrganizationInfo->Division = $order_status_response->OrganizationalUnit;
- $new_order->OrganizationInfo->IncorporatingAgency = '';
- $new_order->OrganizationInfo->JurisdictionCity = $order_status_response->Locality;
- $new_order->OrganizationInfo->JurisdictionCountry = $org_country;
- $new_order->OrganizationInfo->JurisdictionRegion = $order_status_response->State;
- $new_order->OrganizationInfo->OrganizationName = $order_status_response->Organization;
- $new_order->OrganizationInfo->RegistrationNumber = '';
- $new_order->OrganizationInfo->OrganizationAddress->AddressLine1 = $order_status_response->OrganizationAddress;
- $new_order->OrganizationInfo->OrganizationAddress->AddressLine2 = '';
- $new_order->OrganizationInfo->OrganizationAddress->AddressLine3 = '';
- $new_order->OrganizationInfo->OrganizationAddress->City = $order_status_response->Locality;
- $new_order->OrganizationInfo->OrganizationAddress->Country = $org_country;
- $new_order->OrganizationInfo->OrganizationAddress->Fax = '';
- $new_order->OrganizationInfo->OrganizationAddress->LocalityName = '';
- $new_order->OrganizationInfo->OrganizationAddress->Phone = $order_status_response->OrganizationPhone;
- $new_order->OrganizationInfo->OrganizationAddress->PostalCode = $order_status_response->OrganizationPostalcode;
- $new_order->OrganizationInfo->OrganizationAddress->Region = $order_status_response->State;
+ if($package->meta->thesslstore_vendor_name != 'DIGICERT'){
+ $new_order->OrganizationInfo->DUNS = $order_status_response->DUNS;
+ $new_order->OrganizationInfo->Division = $order_status_response->OrganizationalUnit;
+ $new_order->OrganizationInfo->IncorporatingAgency = '';
+ $new_order->OrganizationInfo->JurisdictionCity = $order_status_response->Locality;
+ $new_order->OrganizationInfo->JurisdictionCountry = $org_country;
+ $new_order->OrganizationInfo->JurisdictionRegion = $order_status_response->State;
+ $new_order->OrganizationInfo->OrganizationName = $order_status_response->Organization;
+ $new_order->OrganizationInfo->RegistrationNumber = '';
+ $new_order->OrganizationInfo->OrganizationAddress->AddressLine1 = $order_status_response->OrganizationAddress;
+ $new_order->OrganizationInfo->OrganizationAddress->AddressLine2 = '';
+ $new_order->OrganizationInfo->OrganizationAddress->AddressLine3 = '';
+ $new_order->OrganizationInfo->OrganizationAddress->City = $order_status_response->Locality;
+ $new_order->OrganizationInfo->OrganizationAddress->Country = $org_country;
+ $new_order->OrganizationInfo->OrganizationAddress->Fax = '';
+ $new_order->OrganizationInfo->OrganizationAddress->LocalityName = '';
+ $new_order->OrganizationInfo->OrganizationAddress->Phone = $order_status_response->OrganizationPhone;
+ $new_order->OrganizationInfo->OrganizationAddress->PostalCode = $order_status_response->OrganizationPostalcode;
+ $new_order->OrganizationInfo->OrganizationAddress->Region = $order_status_response->State;
+ }
$new_order->ProductCode = $package->meta->thesslstore_product_code;
$new_order->ReserveSANCount = $additional_san;
$new_order->ServerCount = $server_count;
@@ -2020,25 +2885,53 @@ public function renewService($package, $service, $parent_package=null, $parent_s
$new_order->isTrialOrder = false;
$new_order->SignatureHashAlgorithm = $order_status_response->SignatureHashAlgorithm;
- if($order_status_response->AuthFileName != ''){
+ if (!empty($order_status_response->AuthFileContent)) {
$new_order->FileAuthDVIndicator = true;
- $new_order->HTTPSFileAuthDVIndicator = false;
$new_order->ApproverEmail = $order_status_response->ApproverEmail;
- if($order_status_response->VendorName == 'COMODO'){
- $new_order->CSRUniqueValue = date('YmdHisa');
- }
+ } elseif (!empty($order_status_response->CNAMEAuthValue)) {
+ $new_order->CNAMEAuthDVIndicator = true;
+ $new_order->ApproverEmail = $order_status_response->ApproverEmail;
+ } else {
+ $new_order->FileAuthDVIndicator = false;
+ $new_order->ApproverEmail = $order_status_response->ApproverEmail;
+ }
+ //Pass additional days for renew order, based on the admin side settings
+ $additionalDays = 0;
+ $moduleID = $package->module_id;
+ $meta = $this->ModuleManager->getMeta($moduleID,'additional_days_for_reneworder');
+ if(isset($meta->additional_days_for_reneworder))
+ {
+ $additionalDays = $meta->additional_days_for_reneworder;
+ }
+ if($order_status_response->ProductCode == 'freessl' || $additionalDays <=0){
+ $new_order->isRenewalOrder = false;
}
else{
- $new_order->FileAuthDVIndicator = false;
- $new_order->HTTPSFileAuthDVIndicator = false;
- $new_order->ApproverEmail = $order_status_response->ApproverEmail;
+ $new_order->isRenewalOrder = true;
+ $new_order->RenewalDays = $additionalDays;
+ }
+
+ if(strtoupper($order_status_response->VendorName) == 'COMODO' || strtoupper($order_status_response->VendorName) == 'SECTIGO'){
+ $new_order->CSRUniqueValue = date('YmdHisa');
+ }
+
+ if($package->meta->thesslstore_vendor_name == 'DIGICERT'){
+ $new_order->PreOrganizationId = $order_status_response->PreOrganizationId;
}
//Place full order
$api_with_token = $this->getApi(null,null,'',$IsUsedForTokenSystem = true, $thesslstore_token);
$this->log($this->api_partner_code . "|ssl-full-renew-order", serialize($new_order), "input", true);
- $new_order_resp = $this->parseResponse($api_with_token->order_neworder($new_order),$ignore_error = true);
+ //waiting time
+ sleep(12);
+ if($package->meta->thesslstore_vendor_name == 'DIGICERT'){
+ $new_order_resp = $this->parseResponse($api_with_token->digicert_new_order($new_order),$ignore_error = true);
+ }
+ else{
+ $new_order_resp = $this->parseResponse($api_with_token->order_neworder($new_order),$ignore_error = true);
+ }
+
if(isset($new_order_resp->AuthResponse->isError) && $new_order_resp->AuthResponse->isError == false){
$send_invite_order_email = false;
}
@@ -2046,7 +2939,6 @@ public function renewService($package, $service, $parent_package=null, $parent_s
//send email to customer when only invite order is placed.
if($send_invite_order_email){
-
//get client data to prefiiled data
$this->sendInviteOrderEmail($service, $package, $service_meta);
}
@@ -2058,31 +2950,31 @@ public function renewService($package, $service, $parent_package=null, $parent_s
}
// Return service fields
- if(!empty($service_meta)){
-
- //added old meta like csr and fqdn etc.
- foreach($service->fields as $field){
- $already_added = false;
- foreach($service_meta as $meta){
- if($field->key == $meta['key']){
- $already_added = true;
- break;
- }
-
- }
- if($already_added == false) {
- $service_meta[] = array(
- 'key' => $field->key,
- 'value' => $field->value,
- 'encrypted' => $field->encrypted,
- 'serialized' => $field->serialized
- );
- }
- }
-
- return $service_meta;
- }
- return null;
+ if(!empty($service_meta)){
+
+ //added old meta like csr and fqdn etc.
+ foreach($service->fields as $field){
+ $already_added = false;
+ foreach($service_meta as $meta){
+ if($field->key == $meta['key']){
+ $already_added = true;
+ break;
+ }
+
+ }
+ if($already_added == false) {
+ $service_meta[] = array(
+ 'key' => $field->key,
+ 'value' => $field->value,
+ 'encrypted' => $field->encrypted,
+ 'serialized' => $field->serialized
+ );
+ }
+ }
+
+ return $service_meta;
+ }
+ return null;
}
/**
@@ -2100,37 +2992,63 @@ public function renewService($package, $service, $parent_package=null, $parent_s
* @see Module::getModule()
* @see Module::getModuleRow()
*/
- public function cancelService($package, $service, $parent_package=null, $parent_service=null) {
- if($service->status == 'active') {
+ public function cancelService($package, $service, $parent_package=null, $parent_service=null){
+ /*
+ * This method will called only if user has selected "Immediately" cancellation.
+ */
+ if (!isset($this->Record)){
+ Loader::loadComponents($this, ['Record']);
+ }
+ if($service->status == 'active'){
// Get the service fields
$service_fields = $this->serviceFieldsToObject($service->fields);
// Get the Order ID
- $orderID=$service_fields->thesslstore_order_id;
- //Raise Refund Request
- $api = $this->getApi();
- $refundReq = new order_refundrequest_request();
- $refundReq->RefundReason = 'Requested by User!';
- $refundReq->TheSSLStoreOrderID =$orderID;
+ $orderID = $service_fields->thesslstore_order_id;
- $this->log($this->api_partner_code . "|ssl-refund-request", serialize($refundReq), "input", true);
- $refundRes = $api->order_refundrequest($refundReq);
- if(!$refundRes->AuthResponse->Message[0])
- {
- $errorMessage=$refundRes->AuthResponse->Message;
- }
- else{
- $errorMessage=$refundRes->AuthResponse->Message[0];
- }
- if($refundRes != NULL && $refundRes->AuthResponse->isError == false){
- $this->log($this->api_partner_code."|ssl-refund-response", serialize($refundRes), "output", true);
- return null;
- }
- else {
- $this->log($this->api_partner_code."|ssl-refund-response", serialize($refundRes), "output", false);
- $this->Input->setErrors(array('invalid_action' => array('internal' => $errorMessage)));
- return;
+ //get last generated invoice id of current service
+ $last_invoice = $this->Record->select(['invoice_id'])->from("service_invoices")->where("service_id", "=", $service->id)->order(array("invoice_id"=>"desc"))->fetch();
+
+ //get invoice id for current order
+ $current_invoice = $this->Record->select(['invoice_id'])->from("sslstore_orders")->where("store_order_id", "=", $orderID)->fetch();
+
+ /*
+ * If the customer does not pay their renewal invoice and is submitted for cancellation it errors out when processing with the error message "ErrorCode:-9032|Message:Certificate cannot cancel after 30 days of activation."
+ * Below condition prevent above errors.
+ */
+ if($last_invoice->invoice_id == $current_invoice->invoice_id){
+
+ //Raise Refund Request
+ $api = $this->getApi();
+ $refundReq = new order_refundrequest_request();
+ $refundReq->RefundReason = 'Requested by User!';
+ $refundReq->TheSSLStoreOrderID = $orderID;
+
+ $this->log($this->api_partner_code . "|ssl-refund-request", serialize($refundReq), "input", true);
+ if($package->meta->thesslstore_vendor_name == 'DIGICERT'){
+ $refundRes = $api->digicert_refundrequest($refundReq);
+ }
+ else{
+ $refundRes = $api->order_refundrequest($refundReq);
+ }
+ if(!$refundRes->AuthResponse->Message[0]){
+ $errorMessage = $refundRes->AuthResponse->Message;
+ }
+ else{
+ $errorMessage = $refundRes->AuthResponse->Message[0];
+ }
+
+ if($refundRes != NULL && $refundRes->AuthResponse->isError == false){
+ $this->log($this->api_partner_code . "|ssl-refund-response", serialize($refundRes), "output", true);
+ return null;
+ }
+ else{
+ $this->log($this->api_partner_code . "|ssl-refund-response", serialize($refundRes), "output", false);
+ $this->Input->setErrors(array('invalid_action' => array('internal' => $errorMessage)));
+ return;
+ }
}
- }return null;
+ }
+ return null;
}
/**
@@ -2140,7 +3058,7 @@ public function cancelService($package, $service, $parent_package=null, $parent_
* @param stdClass $row A stdClass object representing a single reseller (optional, required when Module::getModuleRow() is unavailable)
* @return array A list of products
*/
- private function getProducts() {
+ public function getProducts() {
$api = $this->getApi();
@@ -2167,9 +3085,9 @@ public function getClientTabs($package) {
'tabClientCertDetails' => array('name' => Language::_("ThesslstoreModule.tab_CertDetails", true),'icon' => 'fa fa-bars'),
'tabClientGenerateCert' => array('name' => Language::_("ThesslstoreModule.tab_GenerateCert", true),'icon' => 'fa fa-cogs'),
'tabClientDownloadCertificate' =>array('name' => Language::_("ThesslstoreModule.tab_DownloadCertificate", true), 'icon' => 'fa fa-certificate'),
- 'tabClientDownloadAuthFile' => array('name' => Language::_("ThesslstoreModule.tab_DownloadAuthFile", true),'icon' => 'fa fa-file'),
+ 'tabClientDownloadAuthFile' => array('name' => Language::_("ThesslstoreModule.tab_DownloadAuthFile", true), 'href'=>'#', 'class' => 'hidden ssltab','icon' => 'fa fa-file'),
'tabClientChangeApproverEmail' => array('name' => Language::_("ThesslstoreModule.tab_ChangeApproverEmail", true),'icon' => 'fa fa-exchange'),
- 'tabClientResendApproverEmail' => array('name' => Language::_("ThesslstoreModule.tab_ResendApproverEmail",true),'icon' => 'fa fa-refresh'),
+ 'tabClientResendApproverEmail' => array('name' => Language::_("ThesslstoreModule.tab_ResendApproverEmail",true), 'href' => '#', 'class' => 'hidden','icon' => 'fa fa-refresh'),
'tabClientReissueCert' => array('name' => Language::_("ThesslstoreModule.tab_ReissueCert",true),'icon' => 'fa fa-repeat')
);
}
@@ -2198,7 +3116,6 @@ public function getAdminTabs($package) {
* @return string The string representing the contents of this tab
*/
public function tabClientCertDetails($package, $service, array $get=null, array $post=null, array $files=null) {
-
if($service->status == 'active') {
$this->view = new View("tab_client_cert_details", "default");
$this->view->base_uri = $this->base_uri;
@@ -2210,7 +3127,13 @@ public function tabClientCertDetails($package, $service, array $get=null, array
// Get the service fields
$service_fields = $this->serviceFieldsToObject($service->fields);
- $order_resp = $this->getSSLOrderStatus($service_fields->thesslstore_order_id);
+ $order_resp = $this->getSSLOrderStatus($service_fields->thesslstore_order_id, $package->meta->thesslstore_vendor_name);
+
+ //Update Order Info
+ $update_order_data_resp = $this->updateOrderData($order_resp, $service);
+
+
+ $auth_details = $this->getAuthDetails($order_resp);
if($order_resp) {
$vendor_name = $package->meta->thesslstore_vendor_name;
@@ -2218,10 +3141,12 @@ public function tabClientCertDetails($package, $service, array $get=null, array
$is_scan_product = $package->meta->thesslstore_is_scan_product;
//Certificate Details
- $certificate['order_status'] = $order_resp->OrderStatus->MajorStatus;
+ $certificate['order_status'] = strtoupper($order_resp->OrderStatus->MajorStatus);
$certificate['store_order_id'] = $service_fields->thesslstore_order_id;
+ $certificate['renew_from'] = (isset($service_fields->thesslstore_renew_from) ? $service_fields->thesslstore_renew_from : '' );
$certificate['vendor_order_id'] = $order_resp->VendorOrderID;
$certificate['vendor_status'] = $order_resp->OrderStatus->MinorStatus;
+ $certificate['vendor_name'] = $vendor_name;
$certificate['token'] = $order_resp->Token;
$certificate['ssl_start_date'] = $this->getFormattedDate($order_resp->CertificateStartDateInUTC);
$certificate['ssl_end_date'] = $this->getFormattedDate($order_resp->CertificateEndDateInUTC);
@@ -2252,35 +3177,34 @@ public function tabClientCertDetails($package, $service, array $get=null, array
$certificate['tech_email'] = $order_resp->TechnicalContact->Email;
$certificate['tech_phone'] = $order_resp->TechnicalContact->Phone;
+ if(strtoupper($order_resp->VendorName) == 'DIGICERT'){
+ $certificate['org_name'] = $order_resp->Organization;
+ $certificate['org_id'] = $order_resp->PreOrganizationId;
+ }
+
$certificate['generation_link'] = $this->base_uri . "services/manage/" . ($service->id) . "/tabClientGenerateCert/";
/* Provide central API link for CERTUM products*/
+ $this->view->set("link_target", '');
if ($vendor_name == 'CERTUM' || $is_scan_product == 'y' || $is_code_signing == 'y') {
$certificate['generation_link'] = $order_resp->TinyOrderLink;
- }
- //Display Replacement order alert message for symantec products
- $sslConfigCompleteDetails = '';
- if ($order_resp->VendorName == 'SYMANTEC' && $order_resp->OrderStatus->MajorStatus== 'Active') {
- $api = $this->getApi();
- $orderReplacementRequest = new order_replacement_request();
- $orderReplacementRequest->TheSSLStoreOrderID = $order_resp->TheSSLStoreOrderID;
- $orderReplacementResp=$api->order_replacement($orderReplacementRequest);
- if ($orderReplacementResp->AuthResponse->isError == false && $orderReplacementResp->Orders != NULL) {
- $sslConfigCompleteDetails = "Alert! Due to DigiCert’s acquisition of Symantec, you must ".$orderReplacementResp->Orders[0]->Action. " your certificate before ".$orderReplacementResp->Orders[0]->ReplaceByDate;
- }
+ $this->view->set("link_target", '_blank');
}
$this->view->set("service", $service);
$this->view->set("certificate", (object)$certificate);
- $this->view->set("replacementdetails", $sslConfigCompleteDetails);
+ $this->view->set("auth_details", $auth_details);
+ $this->view->set("get_approver_email_url", $this->base_uri . "services/manage/" .$service->id. "/tabClientResendApproverEmail/");
+ $this->view->set("vendor_name", strtoupper($order_resp->VendorName));
+ $this->view->set("token", $order_resp->Token);
+
return $this->view->fetch();
}
-
}
else {
$this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.invalid_service_status", true))));
return;
}
}
- private function validateGenerateCertStep1($package,$vars,$san_count)
+ private function validateGenerateCertStep1($package, $vars, $san_count, $need_to_create_org)
{
// Set rules
$rules = array(
@@ -2302,142 +3226,162 @@ private function validateGenerateCertStep1($package,$vars,$san_count)
'message' => Language::_("ThesslstoreModule.!error.thesslstore_webserver_type.empty", true)
)
),
- 'thesslstore_auth_method' => array(
+ /*'thesslstore_auth_method' => array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
'message' => Language::_("ThesslstoreModule.!error.thesslstore_auth_method.empty", true)
)
- ),
+ ),*/
'thesslstore_signature_algorithm' => array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
'message' => Language::_("ThesslstoreModule.!error.thesslstore_signature_algorithm.empty", true)
)
- ),
- 'thesslstore_admin_first_name' => array(
+ )
+ );
+ if($san_count > 0){
+ /*validate Additional SAN (Minimum 1 Additional SAN should be passed for SAN Enabled Product*/
+ $rules['thesslstore_additional_san'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_first_name.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_additional_san.empty", true)
)
- ),
- 'thesslstore_admin_last_name' => array(
+ );
+ }
+
+ //DigiCert
+ if($package->meta->thesslstore_vendor_name != 'DIGICERT'){
+ $rules['thesslstore_tech_first_name'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_last_name.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_tech_first_name.empty", true)
)
- ),
- 'thesslstore_admin_email' => array(
+ );
+ $rules['thesslstore_tech_last_name'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_email.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_tech_last_name.empty", true)
)
- ),
- 'thesslstore_admin_phone' => array(
+ );
+ $rules['thesslstore_tech_email'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_phone.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_tech_email.empty", true)
)
- ),
- 'thesslstore_org_name' => array(
+ );
+ $rules['thesslstore_tech_phone'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_org_name.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_tech_phone.empty", true)
)
- ),
- 'thesslstore_org_division' => array(
+ );
+ }
+
+ //existing organization
+ if($package->meta->thesslstore_vendor_name == 'DIGICERT' && $need_to_create_org == false){
+ $rules['thesslstore_org_id'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_org_division.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_org_id.empty", true)
)
- ),
- 'thesslstore_admin_address1' => array(
+ );
+ }
+
+ //new organisation or non DigiCert product
+ if($package->meta->thesslstore_vendor_name != 'DIGICERT' || ($package->meta->thesslstore_vendor_name == 'DIGICERT' && $need_to_create_org)){
+ $rules['thesslstore_admin_first_name'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_address1.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_first_name.empty", true)
)
- ),
- 'thesslstore_admin_city' => array(
+ );
+ $rules['thesslstore_admin_last_name'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_city.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_last_name.empty", true)
)
- ),
- 'thesslstore_admin_state' => array(
+ );
+ $rules['thesslstore_admin_email'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_state.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_email.empty", true)
)
- ),
- 'thesslstore_admin_country' => array(
+ );
+ $rules['thesslstore_admin_phone'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_country.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_phone.empty", true)
)
- ),
- 'thesslstore_admin_zip' => array(
+ );
+ $rules['thesslstore_org_name'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_zip.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_org_name.empty", true)
)
- ),
- 'thesslstore_tech_first_name' => array(
+ );
+ $rules['thesslstore_org_division'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_tech_first_name.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_org_division.empty", true)
)
- ),
- 'thesslstore_tech_last_name' => array(
+ );
+ $rules['thesslstore_admin_address1'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_tech_last_name.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_address1.empty", true)
)
- ),
- 'thesslstore_tech_email' => array(
+ );
+ $rules['thesslstore_admin_city'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_tech_email.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_city.empty", true)
)
- ),
- 'thesslstore_tech_phone' => array(
+ );
+ $rules['thesslstore_admin_state'] = array(
'empty' => array(
'rule' => "isEmpty",
'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_tech_phone.empty", true)
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_state.empty", true)
)
- ),
-
- );
- if($san_count > 0){
- /*validate Additional SAN (Minimum 1 Additional SAN should be passed for SAN Enabled Product*/
- $rules['thesslstore_additional_san'] = array(
- 'valid' => array(
- 'rule' => array(array($this, "validateAdditionalSAN")),
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_additional_san.empty", true)
+ );
+ $rules['thesslstore_admin_country'] = array(
+ 'empty' => array(
+ 'rule' => "isEmpty",
+ 'negate' => true,
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_country.empty", true)
)
);
+ $rules['thesslstore_admin_zip'] = array(
+ 'empty' => array(
+ 'rule' => "isEmpty",
+ 'negate' => true,
+ 'message' => Language::_("ThesslstoreModule.!error.thesslstore_admin_zip.empty", true)
+ )
+ );
+
}
$this->Input->setRules($rules);
return $this->Input->validates($vars);
}
- private function validateReissueCert($package,$vars,$san_count){
+ private function validateReissueCert($package, $vars, $san_count){
// Set rules
$rules = array(
'thesslstore_csr' => array(
@@ -2464,24 +3408,9 @@ private function validateReissueCert($package,$vars,$san_count){
'negate' => true,
'message' => Language::_("ThesslstoreModule.!error.thesslstore_signature_algorithm.empty", true)
)
- ),
- 'thesslstore_auth_method' => array(
- 'empty' => array(
- 'rule' => "isEmpty",
- 'negate' => true,
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_auth_method.empty", true)
- )
)
);
- if($san_count > 0){
- /*validate Additional SAN (Minimum 1 Additional SAN should be passed for SAN Enabled Product*/
- $rules['thesslstore_additional_san'] = array(
- 'valid' => array(
- 'rule' => array(array($this, "validateAdditionalSAN")),
- 'message' => Language::_("ThesslstoreModule.!error.thesslstore_additional_san.empty", true)
- )
- );
- }
+
$this->Input->setRules($rules);
return $this->Input->validates($vars);
@@ -2507,10 +3436,10 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
$thesslstore_order_id = $service_fields->thesslstore_order_id;
$product_code = $package->meta->thesslstore_product_code;
$vendor_name = $package->meta->thesslstore_vendor_name;
- $product_validation_type = $package->meta->thesslstore_validation_type;
$is_code_signing = $package->meta->thesslstore_is_code_signing;
$is_scan_product = $package->meta->thesslstore_is_scan_product;
- $order_resp = $this->getSSLOrderStatus($thesslstore_order_id);
+ $validation_type = $package->meta->thesslstore_validation_type;
+ $order_resp = $this->getSSLOrderStatus($thesslstore_order_id, $package->meta->thesslstore_vendor_name);
$use_central_api = false;
$cert_generation_link = "";
if ($vendor_name == 'CERTUM' || $is_code_signing == 'y' || $is_scan_product == 'y') {
@@ -2535,7 +3464,6 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
}
//Pre-filled data
- $auth_method = isset($post['thesslstore_auth_method']) ? $post['thesslstore_auth_method'] : 'EMAIL';
$admin_first_name = isset($post['thesslstore_admin_first_name']) ? $post['thesslstore_admin_first_name'] : $client_data->first_name;
$admin_last_name = isset($post['thesslstore_admin_last_name']) ? $post['thesslstore_admin_last_name'] : $client_data->last_name;
$admin_title = isset($post['thesslstore_admin_title']) ? $post['thesslstore_admin_title'] : '';
@@ -2551,13 +3479,38 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
$admin_country = isset($post['thesslstore_admin_country']) ? $post['thesslstore_admin_country'] : $client_data->country;
$admin_zip_code = isset($post['thesslstore_admin_zip']) ? $post['thesslstore_admin_zip'] : $client_data->zip;
+ //Retrieve the meta value for 'use_default_tech_details'
+ $useDefaultTechDetails = 'no';
+ $moduleID = $package->module_id;
+ $meta = $this->ModuleManager->getMeta($moduleID);
+ if(isset($meta->use_default_tech_details))
+ {
+ $useDefaultTechDetails = $meta->use_default_tech_details;
+ }
+
+ if($useDefaultTechDetails == 'yes'){
+ $post['thesslstore_tech_first_name'] = $meta->thesslstore_tech_first_name;
+ $post['thesslstore_tech_last_name'] = $meta->thesslstore_tech_last_name;
+ $post['thesslstore_tech_title'] = $meta->thesslstore_tech_title;
+ $post['thesslstore_tech_email'] = $meta->thesslstore_tech_email;
+ $post['thesslstore_tech_phone'] = $meta->thesslstore_tech_phone;
+ }
+
$tech_first_name = isset($post['thesslstore_tech_first_name']) ? $post['thesslstore_tech_first_name'] : $client_data->first_name;
$tech_last_name = isset($post['thesslstore_tech_last_name']) ? $post['thesslstore_tech_last_name'] : $client_data->last_name;
$tech_title = isset($post['thesslstore_tech_title']) ? $post['thesslstore_tech_title'] : '';
$tech_email = isset($post['thesslstore_tech_email']) ? $post['thesslstore_tech_email'] : $client_data->email;
$tech_phone = isset($post['thesslstore_tech_phone']) ? $post['thesslstore_tech_phone'] : $contact_number;
-
+ $additional_san_text_value = '';
+ if(isset($post['thesslstore_additional_san'])){
+ if(is_array($post['thesslstore_additional_san'])){
+ $additional_san_text_value = implode("\n", $post['thesslstore_additional_san']);
+ }
+ else{
+ $additional_san_text_value = $post['thesslstore_additional_san'];
+ }
+ }
$step = 1;
$posted_from_step = 0;
$posted = false;
@@ -2569,18 +3522,29 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
// Get the service fields
$san_count = $order_resp->SANCount;
- $approver_email_list = array();
+ $auth_domains = array();
+ $additional_sans = array();
//Authentication Method
$auth_methods = array();
- if ($vendor_name == 'COMODO' || $product_validation_type == 'DV') {
+ $auth_methods['HTTP'] = 'HTTP File';
+ if ($vendor_name == 'COMODO' || $vendor_name == 'SECTIGO')
+ $auth_methods['HTTPS'] = 'HTTPS File';
+ $auth_methods['DNS'] = 'DNS';
+ if ($vendor_name != 'COMODO' && $vendor_name != 'SECTIGO')
$auth_methods['EMAIL'] = 'E-Mail';
- $auth_methods['HTTP'] = 'HTTP File Based';
- if ($vendor_name == 'COMODO')
- $auth_methods['HTTPS'] = 'HTTPS File Based';
+ //Signature algorithm and get existing organisation list
+ $organisation_list = array();
+ if($vendor_name == 'DIGICERT'){
+ $signature_algorithms = array('sha256' => 'SHA-256', 'sha384' => 'SHA-384', 'sha512' => 'SHA-512');
+ $organisation_list = $this->getOrganizationList($service);
+ }
+ else{
+ $signature_algorithms = array('SHA2-256' => 'SHA-2', 'SHA1' => 'SHA-1');
}
+
if ($step == 1) {
$this->view = new View("tab_client_generate_cert_step1", "default");
$this->view->base_uri = $this->base_uri;
@@ -2591,45 +3555,66 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
// Validate the service-specific fields
if ($posted) {
- $this->validateGenerateCertStep1($package, $post, $san_count);
- if (!$this->Input->errors()) {
+ $need_to_create_org = false;
+ if($vendor_name == 'DIGICERT'){
+ if((isset($post['ssl_org_detail']) && $post['ssl_org_detail'] == 'new') || empty($post['thesslstore_org_id'])){
+ $need_to_create_org = true;
+ }
+ }
+
+ $this->validateGenerateCertStep1($package, $post, $san_count, $need_to_create_org);
+
+ //create organisation
+ if (!$this->Input->errors()){
+ if($need_to_create_org){
+ $org_id = $this->createOrganization($service, $package, $post);
+ if($org_id){
+ $post['thesslstore_org_id'] = $org_id;
+ }
+ }
+ }
+
+ if(!$this->Input->errors()){
$step = 2;
- if ($post['thesslstore_auth_method'] == 'EMAIL') {
- //get main domain name from the CSR
- $validate_csr_resp = $this->validateCSR($post['thesslstore_csr'], $product_code);
- $common_name = $validate_csr_resp->DomainName;
-
- //get Approver Email list
- $approver_email_list_resp = $this->getApproverEmailsList($product_code, $common_name);
- $approver_email_list[$common_name] = $approver_email_list_resp;
- /*
- * quicksslpremiummd has additional san but it allows only subdomain of main domain
- * as additional san and allows only main domain's approval email.
- */
- if (isset($post['thesslstore_additional_san']) && $vendor_name == 'COMODO' ) {
- foreach ($post['thesslstore_additional_san'] as $san) {
- if (trim($san) != '') {
- // $domains[] = $san;
-
- //get Approver Email list
- $approver_email_list_resp = $this->getApproverEmailsList($product_code, $san);
- $approver_email_list[$san] = $approver_email_list_resp;
- }
- }
+
+ //get main domain name from the CSR
+ $validate_csr_resp = $this->validateCSR($post['thesslstore_csr'], $product_code);
+ $common_name = $validate_csr_resp->DomainName;
+ $auth_domains[$common_name] = $common_name;
+ if(isset($post['thesslstore_additional_san'])){
+ $additional_sans = explode("\n", $post['thesslstore_additional_san']);
+ $additional_sans = array_map('trim', $additional_sans);
+ $additional_sans = array_filter($additional_sans);
+ }
+
+ /*
+ * quicksslpremiummd has additional san but it allows only subdomain of main domain
+ * as additional san and allows only main domain's approval email.
+ */
+ if ($vendor_name == 'COMODO' || $vendor_name == 'SECTIGO' || $vendor_name == 'DIGICERT'){
+ foreach($additional_sans as $san){
+ $auth_domains[$san] = $san;
}
}
+
}
}
if ($step == 1) {
-
-
- $this->view->set("thesslstore_webserver_types", $this->getWebserverTypes());
+ //Retrieve the value of 'use_default_tech_details' meta
+ $useDefaultTechDetails = 'no';
+ $moduleID = $package->module_id;
+ $meta = $this->ModuleManager->getMeta($moduleID,'use_default_tech_details');
+ if(isset($meta->use_default_tech_details))
+ {
+ $useDefaultTechDetails = $meta->use_default_tech_details;
+ }
+ $this->view->set("use_default_tech_details", $useDefaultTechDetails);
+ $this->view->set("thesslstore_additional_san", $additional_san_text_value);
+ $this->view->set("thesslstore_webserver_types", $this->getWebserverTypes($vendor_name));
$this->view->set("thesslstore_countries", $this->getCountryList());
- $this->view->set("thesslstore_signature_algorithms", array('SHA2-256' => 'SHA-2', 'SHA1' => 'SHA-1'));
- $this->view->set("thesslstore_auth_methods", $auth_methods);
+ $this->view->set("thesslstore_signature_algorithms", $signature_algorithms);
$this->view->set("vars", (object)$post);
- $this->view->set("auth_method", $auth_method);
//admin contact
$this->view->set("thesslstore_admin_first_name", $admin_first_name);
@@ -2655,6 +3640,9 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
$this->view->set("service", $service);
$this->view->set("san_count", $san_count);
+ $this->view->set("vendor_name", $vendor_name);
+ $this->view->set("validation_type", $validation_type);
+ $this->view->set("organisation_list", $organisation_list);
$this->view->set("service_id", $service->id);
$this->view->set("use_central_api", $use_central_api);
$this->view->set("cert_generation_link", $cert_generation_link);
@@ -2665,37 +3653,57 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
}
//Successfully passed step 1
- if ($step == 2) {
- if ($auth_method == 'EMAIL') {
- if ($posted_from_step == 1) {
-
- $this->view = new View("tab_client_generate_cert_step2", "default");
- $this->view->base_uri = $this->base_uri;
- $this->view->setDefaultView("components" . DS . "modules" . DS . "thesslstore_module" . DS);
+ if ($step == 2){
+ if ($posted_from_step == 1){
+
+ $alias_emails = array(
+ '' => 'none',
+ 'admin@' => 'admin@',
+ 'administrator@' => 'administrator@',
+ 'hostmaster@' => 'hostmaster@',
+ 'postmaster@' => 'postmaster@',
+ 'webmaster@' => 'webmaster@',
+ );
- Loader::loadHelpers($this, array("Form", "Html"));
+ $this->view = new View("tab_client_generate_cert_step2", "default");
+ $this->view->base_uri = $this->base_uri;
+ $this->view->setDefaultView("components" . DS . "modules" . DS . "thesslstore_module" . DS);
- $this->view->set("vars", (object)$post);
- $this->view->set("step", 2);
- $this->view->set("service_id", $service->id);
- $this->view->set("approver_email_list", $approver_email_list);
+ Loader::loadHelpers($this, array("Form", "Html"));
- return $this->view->fetch();
- } elseif ($posted_from_step == 2) {
- $success = $this->placeFullOrder($package, $service, $post, $order_resp);
- if ($success) {
- $step = 3;
- } else {
- $step = 1;
- }
+ $this->view->set("vars", (object)$post);
+ $this->view->set("step", 2);
+ $this->view->set("thesslstore_auth_methods", $auth_methods);
+ $this->view->set("additional_sans", $additional_sans);
+ $this->view->set("auth_domains", $auth_domains);
+ $this->view->set("sslstore_alias_emails", $alias_emails);
+ $this->view->set("service_id", $service->id);
+ $this->view->set("vendor_name", $vendor_name);
+ $this->view->set("product_code", $order_resp->ProductCode);
+ $this->view->set("get_approver_email_url", $this->base_uri . "services/manage/" .$service->id. "/tabClientResendApproverEmail/");
+ //create alias emails for domain
+ foreach($auth_domains as $dm){
+ //$base_domain = $this->getPrimaryDomain($dm);
+ $dm = str_replace("*.","", $dm);
+ $dm = str_replace("www.","", $dm);
+ $auth_domain_alias_emails[$dm]['admin@'] = 'admin@'.$dm;
+ $auth_domain_alias_emails[$dm]['administrator@'] = 'administrator@'.$dm;
+ $auth_domain_alias_emails[$dm]['hostmaster@'] = 'hostmaster@'.$dm;
+ $auth_domain_alias_emails[$dm]['postmaster@'] = 'postmaster@'.$dm;
+ $auth_domain_alias_emails[$dm]['webmaster@'] = 'webmaster@'.$dm;
}
+ $this->view->set("auth_domain_alias_emails", $auth_domain_alias_emails);
+ $this->view->set("is_symantec_order", ($order_resp->VendorName == 'GEOTRUST' || $order_resp->VendorName == 'THAWTE' || $order_resp->VendorName == 'SYMANTEC' || $order_resp->VendorName == 'RAPIDSSL') ? 'yes' : 'no');
-
- } elseif ($auth_method != 'EMAIL') {
+ return $this->view->fetch();
+ }
+ elseif ($posted_from_step == 2){
$success = $this->placeFullOrder($package, $service, $post, $order_resp);
- if ($success) {
+ sleep(3);
+ if($success){
$step = 3;
- } else {
+ }
+ else{
$step = 1;
}
}
@@ -2708,12 +3716,12 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
Loader::loadHelpers($this, array("Form", "Html"));
- $this->view->set("thesslstore_webserver_types", $this->getWebserverTypes());
+ $this->view->set("thesslstore_additional_san", $additional_san_text_value);
+ $this->view->set("thesslstore_webserver_types", $this->getWebserverTypes($vendor_name));
$this->view->set("thesslstore_countries", $this->getCountryList());
- $this->view->set("thesslstore_signature_algorithms", array('SHA2-256' => 'SHA-2', 'SHA1' => 'SHA-1'));
+ $this->view->set("thesslstore_signature_algorithms", $signature_algorithms);
$this->view->set("thesslstore_auth_methods", $auth_methods);
$this->view->set("vars", (object)$post);
- $this->view->set("auth_method", $auth_method);
//admin contact
$this->view->set("thesslstore_admin_first_name", $admin_first_name);
@@ -2740,6 +3748,9 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
$this->view->set("service", $service);
$this->view->set("san_count", $san_count);
+ $this->view->set("vendor_name", $vendor_name);
+ $this->view->set("validation_type", $validation_type);
+ $this->view->set("organisation_list", $organisation_list);
$this->view->set("service_id", $service->id);
$this->view->set("step", 1);
$this->view->set("use_central_api", $use_central_api);
@@ -2749,7 +3760,7 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
}
}
- if ($step == 3) {
+ if($step == 3){
$this->view = new View("tab_client_generate_cert_step3", "default");
$this->view->base_uri = $this->base_uri;
$this->view->setDefaultView("components" . DS . "modules" . DS . "thesslstore_module" . DS);
@@ -2757,22 +3768,16 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
Loader::loadHelpers($this, array("Html"));
$this->view->set("vars", (object)$post);
- $download_auth_file_link = $this->base_uri . "services/manage/" . ($service->id) . "/tabClientDownloadAuthFile/";
- $auth_file_name = '';
- $auth_file_content = '';
- if ($auth_method != 'EMAIL') {
- $order_status = $this->getSSLOrderStatus($thesslstore_order_id);
- $auth_file_name = $order_status->AuthFileName;
- $auth_file_content = $order_status->AuthFileContent;
- }
- $this->view->set("auth_file_name", $auth_file_name);
- $this->view->set("auth_file_content", $auth_file_content);
- $this->view->set("download_auth_file_link", $download_auth_file_link);
-
+ //call order status to get auth details
+ $order_status = $this->getSSLOrderStatus($thesslstore_order_id, $package->meta->thesslstore_vendor_name);
+ //get Auth Details from order status
+ $auth_details = $this->getAuthDetails($order_status);
+ $this->view->set("auth_details", $auth_details);
return $this->view->fetch();
}
- } else {
+ }
+ else{
$this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.generate_cert_invalid_certificate_status", true))));
return;
}
@@ -2781,7 +3786,6 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
$this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.invalid_service_status", true))));
return;
}
-
}
/**
@@ -2796,37 +3800,136 @@ public function tabClientGenerateCert($package, $service, array $get=null, array
*/
public function tabClientResendApproverEmail($package, $service, array $get=null, array $post=null, array $files=null) {
- if($service->status == 'active') {
- Loader::loadHelpers($this, array("Html"));
+ if($service->status == 'active'){
- $api = $this->getApi();
- // Get the service fields
- $service_fields = $this->serviceFieldsToObject($service->fields);
- $order_resp = $this->getSSLOrderStatus($service_fields->thesslstore_order_id);
- if($order_resp != NULL && $order_resp->AuthResponse->isError == false){
- $auth_file_name = $order_resp->AuthFileName;
- $auth_file_content = $order_resp->AuthFileContent;
+ if(isset($_POST['action']) && $_POST['action'] == 'getapproverlist'){
+ //This will return approver email list for ajax request called from cert generation second step
+ $api = $this->getApi();
- if (($order_resp->OrderStatus->MajorStatus == "Pending" || $order_resp->OrderStatus->MinorStatus == "PENDING_REISSUE") && $auth_file_name == '' && $auth_file_content == '') {
- $order_resend_req = new order_resend_request();
- $order_resend_req->TheSSLStoreOrderID = $service_fields->thesslstore_order_id;
- $order_resend_req->ResendEmailType = 'ApproverEmail';
+ $approver_list = array();
+ $is_error = false;
+ $error_message = '';
- $this->log($this->api_partner_code . "|resend-approver-email", serialize($order_resend_req), "input", true);
- $results = $this->parseResponse($api->order_resend($order_resend_req));
+ $order_approver_email_req = new order_approverlist_request();
+ $order_approver_email_req->ProductCode = $_POST['product_code'];
+ $order_approver_email_req->DomainName = $_POST['domain_name'];
- if ($results)
- return '
- ' . Language::_("ThesslstoreModule.success.resend_approver_email", true) . '
- ';
- } else {
- $this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.resend_invalid_status", true))));
- return;
+ $order_approver_email_resp = $api->order_approverlist($order_approver_email_req);
+
+ foreach($order_approver_email_resp->ApproverEmailList as $email){
+ if($email != 'support_preprod@geotrust.com' && $email != 'support@geotrust.com' && strpos($email,"@") != false){
+ $approver_list[] = $email;
+ }
+ }
+
+ if(empty($approver_list)){
+ $is_error = true;
+ $error_message = 'Emails Not Found';
+
+ $this->log($this->api_partner_code . "|get-approver-list", serialize($order_approver_email_req), "input", true);
+ $this->log($this->api_partner_code . "|get-approver-list", serialize($order_approver_email_resp), "output", true);
+ }
+
+ echo json_encode(array('email_list' => $approver_list, 'is_error' => $is_error, 'error_message' => $error_message));
+ exit;
+ return;
+
+ }
+ elseif(isset($_POST['action']) && $_POST['action'] == 'change_approver'){
+
+ $api = $this->getApi(null,null,'',$IsUsedForTokenSystem = true, $_POST['ssl_token']);
+
+ $is_error = false;
+ $message = Language::_("ThesslstoreModule.success.change_approver_email", true);
+
+ if($_POST['dcv_method'] == 'HTTP'){
+ $new_approver_method = ($_POST['vendor_name'] == 'COMODO' || $_POST['vendor_name'] == 'SECTIGO' ? 'HTTP_CSR_HASH' : 'FILE');
+ }
+ elseif($_POST['dcv_method'] == 'HTTPS'){
+ $new_approver_method = 'HTTPS_CSR_HASH';
+ }
+ elseif($_POST['dcv_method'] == 'DNS'){
+ $new_approver_method = ($_POST['vendor_name'] == 'COMODO' || $_POST['vendor_name'] == 'SECTIGO' ? 'CNAME_CSR_HASH' : 'DNS');
+ }
+ else{
+ $new_approver_method = 'EMAIL';
+ }
+
+ if($_POST['vendor_name'] == 'COMODO' || $_POST['vendor_name'] == 'SECTIGO' || $_POST['vendor_name'] == 'DIGICERT' || $_POST['dcv_method'] == 'HTTP' || $_POST['dcv_method'] == 'DNS' || ($new_approver_method == 'EMAIL' && $_POST['current_auth_method'] != 'EMAIL' )){
+ $change_approver_method_req = new order_change_approver_method_request();
+ if($new_approver_method == 'EMAIL' && $_POST['vendor_name'] != 'DIGICERT'){
+ $change_approver_method_req->ResendEmail = $_POST['dcv_method'];
+ }
+
+ $change_approver_method_req->TheSSLStoreOrderID = 0;
+ $change_approver_method_req->DomainNames = $_POST['domain_name'];
+ $change_approver_method_req->ApproverMethod = $new_approver_method;
+
+ if($_POST['vendor_name'] == 'DIGICERT'){
+ $change_approver_method_resp = $api->digicert_change_approver_method($change_approver_method_req);
+ }
+ else{
+ $change_approver_method_resp = $api->order_change_approver_method($change_approver_method_req);
+ }
+
+ if($change_approver_method_resp == NULL || $change_approver_method_resp->isError){
+ $is_error = true;
+ $message = isset($change_approver_method_resp->Message[0]) ? $change_approver_method_resp->Message[0] : Language::_("ThesslstoreModule.!error.api.internal", true);
+ $this->log($this->api_partner_code . "|change-approver-method", serialize($change_approver_method_req), "input", true);
+ $this->log($this->api_partner_code . "|change-approver-method", serialize($change_approver_method_resp), "output", true);
+ }
+ }
+ else{
+ //Call resend email for change symantec email to email
+ $resend_email_req = new order_resend_request();
+ $resend_email_req->TheSSLStoreOrderID = 0;
+ $resend_email_req->ResendEmailType = 'ApproverEmail';
+ $resend_email_req->ResendEmail = $_POST['dcv_method'];
+ $resend_email_resp = $api->order_resend($resend_email_req);
+ if($resend_email_resp == NULL || $resend_email_resp->isError){
+ $is_error = true;
+ $message = isset($resend_email_resp->Message[0]) ? $resend_email_resp->Message[0] : Language::_("ThesslstoreModule.!error.api.internal", true);
+ $this->log($this->api_partner_code . "|resend-approver-email", serialize($resend_email_req), "input", true);
+ $this->log($this->api_partner_code . "|resend-approver-email", serialize($resend_email_resp), "output", true);
+ }
+ }
+ echo json_encode(array('message' => str_ireplace("TheSSLStore","Store",$message), 'isError' => $is_error));
+ exit;
+ return;
+
+ }
+ elseif(isset($_POST['action']) && $_POST['action'] == 'resend_approver'){
+ $api = $this->getApi(null,null,'',$IsUsedForTokenSystem = true, $_POST['ssl_token']);
+
+ $is_error = false;
+ $message = Language::_("ThesslstoreModule.success.resend_approver_email", true);
+
+ $resend_email_req = new order_resend_request();
+ $resend_email_req->TheSSLStoreOrderID = 0;
+ $resend_email_req->ResendEmailType = 'ApproverEmail';
+ $resend_email_req->DomainNames = $_POST['domain_name'];
+ if($_POST['vendor_name'] == 'DIGICERT'){
+ $resend_email_resp = $api->digicert_order_resend($resend_email_req);
+ }
+ else{
+ $resend_email_resp = $api->order_resend($resend_email_req);
}
+ if($resend_email_resp == NULL || $resend_email_resp->isError){
+ $is_error = true;
+ $message = isset($resend_email_resp->Message[0]) ? $resend_email_resp->Message[0] : Language::_("ThesslstoreModule.!error.api.internal", true);
+ $this->log($this->api_partner_code . "|resend-approver-email", serialize($resend_email_req), "input", true);
+ $this->log($this->api_partner_code . "|resend-approver-email", serialize($resend_email_resp), "output", true);
+ }
+
+ echo json_encode(array('message' => str_ireplace("TheSSLStore","Store",$message), 'isError' => $is_error));
+ exit;
+ return;
+
}
else{
+ $this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.invalid_screen", true))));
return;
}
}
@@ -2859,8 +3962,6 @@ private function placeFullOrder($package,$service,$post,$order_status_resp){
$product_code = $package->meta->thesslstore_product_code;
$vendor_name = $package->meta->thesslstore_vendor_name;
- $thesslstore_order_id = $service_fields->thesslstore_order_id;
-
$csr = isset($vars->thesslstore_csr) ? $vars->thesslstore_csr : '';
$web_server_type = isset($vars->thesslstore_webserver_type) ? $vars->thesslstore_webserver_type : 'Other';
@@ -2874,7 +3975,6 @@ private function placeFullOrder($package,$service,$post,$order_status_resp){
}
}
- $auth_method = isset($vars->thesslstore_auth_method) ? $vars->thesslstore_auth_method : '';
$admin_first_name = isset($vars->thesslstore_admin_first_name) ? $vars->thesslstore_admin_first_name : '';
$admin_last_name = isset($vars->thesslstore_admin_last_name) ? $vars->thesslstore_admin_last_name : '';
$admin_title = isset($vars->thesslstore_admin_title) ? $vars->thesslstore_admin_title : '';
@@ -2888,14 +3988,47 @@ private function placeFullOrder($package,$service,$post,$order_status_resp){
$admin_state = isset($vars->thesslstore_admin_state) ? $vars->thesslstore_admin_state : '';
$admin_country = isset($vars->thesslstore_admin_country) ? $vars->thesslstore_admin_country : '';
$admin_zip = isset($vars->thesslstore_admin_zip) ? $vars->thesslstore_admin_zip : '';
- $tech_first_name = isset($vars->thesslstore_tech_first_name) ? $vars->thesslstore_tech_first_name : '';
- $tech_last_name = isset($vars->thesslstore_tech_last_name) ? $vars->thesslstore_tech_last_name : '';
- $tech_title = isset($vars->thesslstore_tech_title) ? $vars->thesslstore_tech_title : '';
- $tech_email = isset($vars->thesslstore_tech_email) ? $vars->thesslstore_tech_email : '';
- $tech_phone = isset($vars->thesslstore_tech_phone) ? $vars->thesslstore_tech_phone : '';
- $approver_email = isset($vars->thesslstore_approver_emails) ? implode(',',$vars->thesslstore_approver_emails) : '';
+ //Retrieve the meta value for 'use_default_tech_details'
+ $useDefaultTechDetails = 'no';
+ $moduleID = $package->module_id;
+ $meta = $this->ModuleManager->getMeta($moduleID);
+ if(isset($meta->use_default_tech_details))
+ {
+ $useDefaultTechDetails = $meta->use_default_tech_details;
+ }
+
+ if($useDefaultTechDetails != 'yes'){
+ $tech_first_name = isset($vars->thesslstore_tech_first_name) ? $vars->thesslstore_tech_first_name : '';
+ $tech_last_name = isset($vars->thesslstore_tech_last_name) ? $vars->thesslstore_tech_last_name : '';
+ $tech_title = isset($vars->thesslstore_tech_title) ? $vars->thesslstore_tech_title : '';
+ $tech_email = isset($vars->thesslstore_tech_email) ? $vars->thesslstore_tech_email : '';
+ $tech_phone = isset($vars->thesslstore_tech_phone) ? $vars->thesslstore_tech_phone : '';
+ $tech_org_name = isset($vars->thesslstore_org_name) ? $vars->thesslstore_org_name : '';
+ $tech_address1 = isset($vars->thesslstore_admin_address1) ? $vars->thesslstore_admin_address1 : '';
+ $tech_address2 = isset($vars->thesslstore_admin_address2) ? $vars->thesslstore_admin_address2 : '';
+ $tech_city = isset($vars->thesslstore_admin_city) ? $vars->thesslstore_admin_city : '';
+ $tech_state = isset($vars->thesslstore_admin_state) ? $vars->thesslstore_admin_state : '';
+ $tech_country = isset($vars->thesslstore_admin_country) ? $vars->thesslstore_admin_country : '';
+ $tech_zip = isset($vars->thesslstore_admin_zip) ? $vars->thesslstore_admin_zip : '';
+ }
+ else{
+ $tech_first_name = $meta->thesslstore_tech_first_name;
+ $tech_last_name = $meta->thesslstore_tech_last_name;
+ $tech_title = $meta->thesslstore_tech_title;
+ $tech_email = $meta->thesslstore_tech_email;
+ $tech_phone = $meta->thesslstore_tech_phone;
+ $tech_org_name = $meta->thesslstore_tech_org_name;
+ $tech_address1 = $meta->thesslstore_tech_address;
+ $tech_address2 = '';
+ $tech_city = $meta->thesslstore_tech_city;
+ $tech_state = $meta->thesslstore_tech_state;
+ $tech_country = $meta->thesslstore_tech_country;
+ $tech_zip = $meta->thesslstore_tech_zipcode;
+ }
+ $org_id = isset($vars->thesslstore_org_id) ? $vars->thesslstore_org_id : 0;
+ //$approver_methods = array();
$sans = array();
if(isset($vars->thesslstore_additional_san)){
@@ -2909,8 +4042,6 @@ private function placeFullOrder($package,$service,$post,$order_status_resp){
$validate_csr_resp = $this->validateCSR($csr, $product_code);
$domain_name = $validate_csr_resp->DomainName;
- $clean_domain_name = str_replace(array('www.','*.'),"",$domain_name);
-
$contact = new contact();
$contact->AddressLine1 = html_entity_decode($admin_address1);
@@ -2919,7 +4050,6 @@ private function placeFullOrder($package,$service,$post,$order_status_resp){
$contact->Region = html_entity_decode($admin_state);
$contact->Country = html_entity_decode($admin_country);
$contact->Email = html_entity_decode($admin_email);
- $contact->Fax = '';
$contact->FirstName = html_entity_decode($admin_first_name);
$contact->LastName = html_entity_decode($admin_last_name);
$contact->OrganizationName = html_entity_decode($org_name);
@@ -2928,18 +4058,17 @@ private function placeFullOrder($package,$service,$post,$order_status_resp){
$contact->Title = html_entity_decode($admin_title);
$tech_contact = new contact();
- $tech_contact->AddressLine1 = '';
- $tech_contact->AddressLine2 = '';
- $tech_contact->City = '';
- $tech_contact->Region = '';
- $tech_contact->Country = '';
+ $tech_contact->AddressLine1 = html_entity_decode($tech_address1);
+ $tech_contact->AddressLine2 = html_entity_decode($tech_address2);
+ $tech_contact->City = html_entity_decode($tech_city);
+ $tech_contact->Region = html_entity_decode($tech_state);
+ $tech_contact->Country = html_entity_decode($tech_country);
$tech_contact->Email = html_entity_decode($tech_email);
- $tech_contact->Fax = '';
$tech_contact->FirstName = html_entity_decode($tech_first_name);
$tech_contact->LastName = html_entity_decode($tech_last_name);
- $tech_contact->OrganizationName = '';
+ $tech_contact->OrganizationName = html_entity_decode($tech_org_name);
$tech_contact->Phone = html_entity_decode($tech_phone);
- $tech_contact->PostalCode = '';
+ $tech_contact->PostalCode = html_entity_decode($tech_zip);
$tech_contact->Title = html_entity_decode($tech_title);
$new_order = new order_neworder_request();
@@ -2948,8 +4077,7 @@ private function placeFullOrder($package,$service,$post,$order_status_resp){
$new_order->AddInstallationSupport = false;
$new_order->AdminContact = $contact;
$new_order->CSR = $csr;
- $new_order->DomainName = '';
- $new_order->CustomOrderID = uniqid('BlestaFullOrder-');
+ $new_order->DomainName = $validate_csr_resp->DomainName;
$new_order->RelatedTheSSLStoreOrderID = '';
$new_order->DNSNames = $sans;
$new_order->EmailLanguageCode = 'EN';
@@ -2972,6 +4100,9 @@ private function placeFullOrder($package,$service,$post,$order_status_resp){
$new_order->OrganizationInfo->OrganizationAddress->Phone = html_entity_decode($admin_phone);
$new_order->OrganizationInfo->OrganizationAddress->PostalCode = html_entity_decode($admin_zip);
$new_order->OrganizationInfo->OrganizationAddress->Region = html_entity_decode($admin_state);
+
+ $new_order->PreOrganizationId = $org_id;
+
$new_order->ProductCode = $product_code;
$new_order->ReserveSANCount = $san_count;
$new_order->ServerCount = $server_count;
@@ -2984,48 +4115,102 @@ private function placeFullOrder($package,$service,$post,$order_status_resp){
$new_order->isTrialOrder = false;
$new_order->SignatureHashAlgorithm = $signature_algorithm;
- if($auth_method == 'HTTP' || $auth_method == 'HTTPS') {
- $approver_list = $this->getApproverEmailsList($product_code, $domain_name);
- $approver_email = $approver_list[0];
- foreach($approver_list as $apEmail){
- if(strpos($apEmail, 'admin@') === 0 || strpos($apEmail, 'administrator@') === 0){
- $approver_email = $apEmail;
- break;
- }
- }
- }
- if($auth_method == 'HTTP'){
- $new_order->FileAuthDVIndicator = true;
- $new_order->HTTPSFileAuthDVIndicator = false;
- $new_order->ApproverEmail = $approver_email;
- if($vendor_name == 'COMODO'){
- $new_order->CSRUniqueValue = date('YmdHisa');
- }
+ //Pass additional days for new order, based on the admin side settings
+ $additionalDays = 0;
+ $moduleID = $package->module_id;
+ $meta = $this->ModuleManager->getMeta($moduleID,'additional_days_for_neworder');
+ if(isset($meta->additional_days_for_neworder))
+ {
+ $additionalDays = $meta->additional_days_for_neworder;
}
- elseif($auth_method == 'HTTPS'){
- $new_order->FileAuthDVIndicator = false;
- $new_order->HTTPSFileAuthDVIndicator = true;
- $new_order->ApproverEmail = $approver_email;
- if($vendor_name == 'COMODO'){
- $new_order->CSRUniqueValue = date('YmdHisa');
- }
+ if($order_status_resp->ProductCode == 'freessl' || $additionalDays <=0){
+ $new_order->isRenewalOrder = false;
}
else{
+ $new_order->isRenewalOrder = true;
+ $new_order->RenewalDays = $additionalDays;
+ }
+
+ if(strtoupper($order_status_resp->VendorName) != 'DIGICERT'){
+
$new_order->FileAuthDVIndicator = false;
$new_order->HTTPSFileAuthDVIndicator = false;
- $new_order->ApproverEmail = $approver_email;
+ $new_order->CNAMEAuthDVIndicator = false;
+ $approver_methods = array();
+ if(is_array($vars->ssl_auth_methods)){
+ if((strtoupper($order_status_resp->VendorName) == 'COMODO' || strtoupper($order_status_resp->VendorName) == 'SECTIGO') && $order_status_resp->SANCount > 0){
+ //For comodo multi-domain product
+ foreach($vars->ssl_auth_methods as $domain => $method){
+ if($method == 'HTTP'){
+ $approver_methods[] = 'HTTP_CSR_HASH';
+ }
+ elseif($method == 'HTTPS'){
+ $approver_methods[] = 'HTTPS_CSR_HASH';
+ }
+ elseif($method == 'DNS'){
+ $approver_methods[] = 'CNAME_CSR_HASH';
+ }
+ else{
+ $approver_methods[] = $method;
+ }
+ }
+ }
+ else{
+ //For comodo single domain and other vendors
+ foreach($vars->ssl_auth_methods as $domain => $method){
+
+ if($method == 'HTTP'){
+ $new_order->FileAuthDVIndicator = true;
+ if(isset($vars->ssl_approver_email)){
+ $approver_methods[] = $vars->ssl_approver_email;
+ }
+ }
+ elseif($method == 'HTTPS'){
+ $new_order->HTTPSFileAuthDVIndicator = true;
+ if(isset($vars->ssl_approver_email)){
+ $approver_methods[] = $vars->ssl_approver_email;
+ }
+ }
+ elseif($method == 'DNS'){
+ $new_order->CNAMEAuthDVIndicator = true;
+ if(isset($vars->ssl_approver_email)){
+ $approver_methods[] = $vars->ssl_approver_email;
+ }
+ }
+ elseif($method == 'EMAIL'){
+ $approver_methods[] = $vars->ssl_approver_email;
+ }
+ else{
+ $approver_methods[] = $method;
+ }
+ }
+ }
+ }
+ $new_order->ApproverEmail = implode(',', $approver_methods);
}
+
+
$api = $this->getApi(null,null,'',$IsUsedForTokenSystem = true,$token);
+ $this->log($this->api_partner_code . "|ssl-new-order", json_encode($new_order), "input", true);
+ if($vendor_name == 'DIGICERT'){
+ $results = $this->parseResponse($api->digicert_new_order($new_order));
+ }
+ else{
+ $results = $this->parseResponse($api->order_neworder($new_order));
+ }
- $this->log($this->api_partner_code . "|ssl-new-order", serialize($new_order), "input", true);
- $results = $this->parseResponse($api->order_neworder($new_order));
if($results != NULL && $results->AuthResponse->isError == false){
- //call order status after placed full order to get common name
- $order_status = $this->getSSLOrderStatus($thesslstore_order_id);
- $fqdn_name = $order_status->CommonName;
+
+ //call set DCV method for digicert
+ if($vendor_name == 'DIGICERT'){
+ foreach($vars->ssl_auth_methods as $domain => $method){
+ $method = ($method == 'HTTP' ? 'FILE' : $method);
+ $this->setApproverMethod($domain, $org_id, $order_status_resp->TheSSLStoreOrderID, $method);
+ }
+ }
//store service fields
Loader::loadModels($this, array("Services"));
@@ -3048,14 +4233,14 @@ private function placeFullOrder($package,$service,$post,$order_status_resp){
if(isset($service_fields->thesslstore_fqdn)){
$this->Services->editField($service->id, array(
'key' => "thesslstore_fqdn",
- 'value' => $fqdn_name,
+ 'value' => $domain_name,
'encrypted' => 0
));
}
else {
$this->Services->addField($service->id, array(
'key' => "thesslstore_fqdn",
- 'value' => $fqdn_name,
+ 'value' => $domain_name,
'encrypted' => 0
));
}
@@ -3084,9 +4269,9 @@ public function tabClientReissueCert($package, $service, array $get=null, array
// Get the service fields
$service_fields = $this->serviceFieldsToObject($service->fields);
- $order_resp = $this->getSSLOrderStatus($service_fields->thesslstore_order_id);
+ $order_resp = $this->getSSLOrderStatus($service_fields->thesslstore_order_id, $package->meta->thesslstore_vendor_name);
if($order_resp != NULL && $order_resp->AuthResponse->isError == false){
- if ($order_resp->OrderStatus->MajorStatus == 'Active' && $order_resp->OrderStatus->MinorStatus != 'PENDING_REISSUE') {
+ if(strtoupper($order_resp->OrderStatus->MajorStatus) == 'ACTIVE' && strtoupper($order_resp->OrderStatus->MinorStatus) != 'PENDING_REISSUE'){
$this->view = new View("tab_client_reissue_cert", "default");
$this->view->base_uri = $this->base_uri;
@@ -3100,12 +4285,11 @@ public function tabClientReissueCert($package, $service, array $get=null, array
$is_code_signing = $package->meta->thesslstore_is_code_signing;
$is_scan_product = $package->meta->thesslstore_is_scan_product;
$product_code = $package->meta->thesslstore_product_code;
- $approver_email_list = array();
- $selected_emails = array();
+
$step = isset($post['thesslstore_reissue_step']) ? $post['thesslstore_reissue_step'] : 1;
- if ($vendor_name == 'CERTUM' || $is_code_signing == 'y' || $is_scan_product == 'y') {
+ if($vendor_name == 'CERTUM' || $is_code_signing == 'y' || $is_scan_product == 'y'){
//Generate central api link for CERTUM and Code signing products
$use_central_api = true;
@@ -3127,118 +4311,139 @@ public function tabClientReissueCert($package, $service, array $get=null, array
}
- } else {
+ }
+ else{
$thesslstore_csr = (isset($service_fields->thesslstore_csr) ? $service_fields->thesslstore_csr : '');
+ $san_count = $order_resp->SANCount;
+ $additional_san_text_value = str_replace(",","\n", $order_resp->DNSNames);
+ if(isset($post['thesslstore_additional_san'])){
+ if(is_array($post['thesslstore_additional_san'])){
+ //$additional_san_text_value = implode("\n", $post['thesslstore_additional_san']);
+ }
+ else{
+ $additional_san_text_value = $post['thesslstore_additional_san'];
+ }
+ }
$thesslstore_webserver_type = $order_resp->WebServerType;
$thesslstore_signature_algorithm = $order_resp->SignatureHashAlgorithm;
- $auth_file_name = $order_resp->AuthFileName;
- $auth_file_content = $order_resp->AuthFileContent;
- if ($vendor_name == 'COMODO') {
- if ($thesslstore_signature_algorithm == 'PREFER_SHA2') {
+
+ if($vendor_name == 'COMODO'){
+ if($thesslstore_signature_algorithm == 'PREFER_SHA2'){
$thesslstore_signature_algorithm = 'SHA2-256';
- } elseif ($thesslstore_signature_algorithm == 'PREFER_SHA1') {
+ }elseif ($thesslstore_signature_algorithm == 'PREFER_SHA1'){
$thesslstore_signature_algorithm == 'SHA1';
}
}
- $san_count = $order_resp->SANCount;
- $thesslstore_additional_san = explode(",", $order_resp->DNSNames);
- $thesslstore_auth_method = 'EMAIL';
- if ($order_resp->AuthFileName != '') {
- $thesslstore_auth_method = 'HTTP';
- }
- //to display selected approver email
- $emails = explode(",", $order_resp->ApproverEmail);
- $domains = explode(",", $order_resp->DNSNames);
- //for common name
- if (isset($emails[0])) {
- $selected_emails[$order_resp->CommonName] = $emails[0];
- }
- //for additional san
- $i = 1;
- foreach ($domains as $dm) {
- if (isset($emails[$i])) {
- $selected_emails[$dm] = $emails[$i];
- }
- $i++;
- }
+ if(isset($post['thesslstore_reissue_submit'])){
- if (isset($post['thesslstore_reissue_submit'])) {
$thesslstore_csr = $post['thesslstore_csr'];
$thesslstore_webserver_type = $post['thesslstore_webserver_type'];
$thesslstore_signature_algorithm = $post['thesslstore_signature_algorithm'];
- $thesslstore_additional_san = isset($post['thesslstore_additional_san']) ? $post['thesslstore_additional_san'] : array();
- $thesslstore_auth_method = $post['thesslstore_auth_method'];
$this->validateReissueCert($package, $post, $san_count);
if (!$this->Input->errors()) {
- //get approver email list for email based authentication
- if ($step == 1) {
- //Symantec not allowed change approver email or auth type in reissue
- if ($thesslstore_auth_method == 'EMAIL' && $vendor_name == 'COMODO') {
- $approver_email_list_resp = $this->getApproverEmailsList($product_code, $order_resp->CommonName);
- $approver_email_list[$order_resp->CommonName] = $approver_email_list_resp;
-
- if (isset($post['thesslstore_additional_san']) && $vendor_name == 'COMODO') {
- foreach ($post['thesslstore_additional_san'] as $san) {
- if (trim($san) != '') {
-
- //get Approver Email list
- $approver_email_list_resp = $this->getApproverEmailsList($product_code, $san);
- $approver_email_list[$san] = $approver_email_list_resp;
- }
- }
- }
- $step = 2;
- } else {
- $success = $this->reIssueCertificate($package, $service, $post, $order_resp);
- //if any error then diplay step 1 with error
- if (!$success) {
- $step = 1;
- } else {
- $step = 3; //display step 3 when successfully reissue
- $new_order_resp = $this->getSSLOrderStatus($service_fields->thesslstore_order_id);
- $auth_file_name = $new_order_resp->AuthFileName;
- $auth_file_content = $new_order_resp->AuthFileContent;
+
+ if($step == 1){
+ $auth_domains = array();
+ $additional_sans = array();
+
+ //Authentication Method
+ $auth_methods = array();
+ $auth_methods['HTTP'] = 'HTTP File';
+ if ($vendor_name == 'COMODO' || $vendor_name == 'SECTIGO')
+ $auth_methods['HTTPS'] = 'HTTPS File';
+ $auth_methods['DNS'] = 'DNS';
+ if ($vendor_name != 'COMODO' && $vendor_name != 'SECTIGO')
+ $auth_methods['EMAIL'] = 'E-Mail';
+
+ $alias_emails = array(
+ '' => 'none',
+ 'admin@' => 'admin@',
+ 'administrator@' => 'administrator@',
+ 'hostmaster@' => 'hostmaster@',
+ 'postmaster@' => 'postmaster@',
+ 'webmaster@' => 'webmaster@',
+ );
+
+ //get main domain name from the CSR
+ $validate_csr_resp = $this->validateCSR($post['thesslstore_csr'], $product_code);
+ $common_name = $validate_csr_resp->DomainName;
+ $auth_domains[$common_name] = $common_name;
+ if(isset($post['thesslstore_additional_san'])){
+ $additional_sans = explode("\n", $post['thesslstore_additional_san']);
+ $additional_sans = array_map('trim', $additional_sans);
+ $additional_sans = array_filter($additional_sans);
+ }
+
+ if ($vendor_name == 'COMODO' || $vendor_name == 'SECTIGO' || $vendor_name == 'DIGICERT'){
+ foreach($additional_sans as $san){
+ $auth_domains[$san] = $san;
}
}
- } elseif ($step == 2) {
+
+ //create alias emails for domain
+ foreach($auth_domains as $dm){
+ //$base_domain = $this->getPrimaryDomain($dm);
+ $dm = str_replace("*.","", $dm);
+ $dm = str_replace("www.","", $dm);
+ $auth_domain_alias_emails[$dm]['admin@'] = 'admin@'.$dm;
+ $auth_domain_alias_emails[$dm]['administrator@'] = 'administrator@'.$dm;
+ $auth_domain_alias_emails[$dm]['hostmaster@'] = 'hostmaster@'.$dm;
+ $auth_domain_alias_emails[$dm]['postmaster@'] = 'postmaster@'.$dm;
+ $auth_domain_alias_emails[$dm]['webmaster@'] = 'webmaster@'.$dm;
+ }
+
+
+
+ $this->view->set("thesslstore_auth_methods", $auth_methods);
+ $this->view->set("additional_sans", $additional_sans);
+ $this->view->set("auth_domains", $auth_domains);
+ $this->view->set("sslstore_alias_emails", $alias_emails);
+ $this->view->set("auth_domain_alias_emails", $auth_domain_alias_emails);
+ $this->view->set("product_code", $product_code);
+ $this->view->set("get_approver_email_url", $this->base_uri . "services/manage/" .$service->id. "/tabClientResendApproverEmail/");
+ $step = 2;
+ }
+ elseif($step == 2){
$success = $this->reIssueCertificate($package, $service, $post, $order_resp);
//if any error then diplay step 1 with error
- if (!$success) {
+ if(!$success){
$step = 1;
- } else {
- $step = 3; //display step 3 when successfully reissue
- $new_order_resp = $this->getSSLOrderStatus($service_fields->thesslstore_order_id);
- $auth_file_name = $new_order_resp->AuthFileName;
- $auth_file_content = $new_order_resp->AuthFileContent;
+ }
+ else{
+ $step = 3;
+ //call order status to get auth details
+ $new_order_status = $this->getSSLOrderStatus($service_fields->thesslstore_order_id, $package->meta->thesslstore_vendor_name);
+ //get Auth Details from order status
+ $auth_details = $this->getAuthDetails($new_order_status);
+ $this->view->set("auth_details", $auth_details);
}
}
- } else {
+ }
+ else{
//When any error display step1
$step = 1;
}
}
-
+ if($vendor_name == 'DIGICERT'){
+ $signature_algorithms = array('sha256' => 'SHA-256', 'sha384' => 'SHA-384', 'sha512' => 'SHA-512');
+ }
+ else{
+ $signature_algorithms = array('SHA2-256' => 'SHA-2', 'SHA1' => 'SHA-1');
+ }
$this->view->set("service_id", $service->id);
$this->view->set("step", $step);
$this->view->set("thesslstore_csr", $thesslstore_csr);
- $this->view->set("thesslstore_webserver_types", $this->getWebserverTypes());
+ $this->view->set("thesslstore_webserver_types", $this->getWebserverTypes($vendor_name));
$this->view->set("thesslstore_webserver_type", $thesslstore_webserver_type);
- $this->view->set("thesslstore_signature_algorithms", array('SHA2-256' => 'SHA-2', 'SHA1' => 'SHA-1'));
+ $this->view->set("thesslstore_signature_algorithms",$signature_algorithms);
$this->view->set("thesslstore_signature_algorithm", $thesslstore_signature_algorithm);
$this->view->set("san_count", $san_count);
- $this->view->set("thesslstore_additional_san", $thesslstore_additional_san);
+ $this->view->set("thesslstore_additional_san", $additional_san_text_value);
$this->view->set("vendor_name", $vendor_name);
- $this->view->set("thesslstore_auth_method", $thesslstore_auth_method);
$this->view->set("use_central_api", $use_central_api);
- $this->view->set("approver_email_list", $approver_email_list);
- $this->view->set("auth_file_name", $auth_file_name);
- $this->view->set("auth_file_content", $auth_file_content);
- $this->view->set("selected_emails", $selected_emails);
- $download_auth_file_link = $this->base_uri . "services/manage/" . ($service->id) . "/tabClientDownloadAuthFile/";
- $this->view->set("download_auth_file_link", $download_auth_file_link);
return $this->view->fetch();
}
@@ -3265,14 +4470,10 @@ public function tabClientReissueCert($package, $service, array $get=null, array
* @param stdClass $order_status_resp A stdClass object
* @return boolean true|false based on success
*/
- private function reIssueCertificate($package,$service,$post,$order_status_resp){
+ private function reIssueCertificate($package, $service, $post, $order_status_resp){
$vars = (object)$post;
$service_fields = $this->serviceFieldsToObject($service->fields);
$api = $this->getApi();
- /*$file_based_auth = false;
- if($order_status_resp->AuthFileName != '' && $order_status_resp->AuthFileContent != ''){
- $file_based_auth = true;
- }*/
$vendor_name = $package->meta->thesslstore_vendor_name;
$signature_algorithm = $vars->thesslstore_signature_algorithm;
$additional_san = isset($vars->thesslstore_additional_san) ? $vars->thesslstore_additional_san : array();
@@ -3309,48 +4510,101 @@ private function reIssueCertificate($package,$service,$post,$order_status_resp){
}
}
-
-
-
$order_reissue_req = new order_reissue_request();
$order_reissue_req->CSR = $csr;
$order_reissue_req->TheSSLStoreOrderID = $order_status_resp->TheSSLStoreOrderID;
$order_reissue_req->WebServerType = $vars->thesslstore_webserver_type;
$order_reissue_req->isWildCard = false;
$order_reissue_req->PreferEnrollmentLink = false;
- $order_reissue_req->FileAuthDVIndicator = false;
- if($vars->thesslstore_auth_method == 'HTTP') {
- $order_reissue_req->FileAuthDVIndicator = true;
- if($vendor_name == 'COMODO'){
- $order_reissue_req->CSRUniqueValue = date('YmdHisa');
- }
- }
- $order_reissue_req->HTTPSFileAuthDVIndicator = false;
- if($vars->thesslstore_auth_method == 'HTTPS'){
- $order_reissue_req->HTTPSFileAuthDVIndicator = true;
- if($vendor_name == 'COMODO'){
- $order_reissue_req->CSRUniqueValue = date('YmdHisa');
- }
- }
- $order_reissue_req->CNAMEAuthDVIndicator = false;
- $order_reissue_req->ApproverEmails = $order_status_resp->ApproverEmail;
- //Symantec not allowed to change Auth method as well as authentication email in Reissue
- if($vendor_name == 'COMODO' && $vars->thesslstore_auth_method == 'EMAIL'){
- $order_reissue_req->ApproverEmails = implode(",", $vars->thesslstore_approver_emails);
- }
- $order_reissue_req->SignatureHashAlgorithm = $signature_algorithm;
- $order_reissue_req->AddSAN = $add_san_old_new_pair;
- $order_reissue_req->DeleteSAN = $delete_san_old_new_pair;
- $order_reissue_req->ReissueEmail = $order_status_resp->AdminContact->Email;
-
- $this->log($this->api_partner_code . "|ssl-reissue", serialize($order_reissue_req), "input", true);
- $results = $this->parseResponse($api->order_reissue($order_reissue_req));
-
- //Update CSR
-
- if($results != NULL && $results->AuthResponse->isError == false){
- //store service fields
+ if(strtoupper($vendor_name) != 'DIGICERT'){
+ $order_reissue_req->FileAuthDVIndicator = false;
+ $order_reissue_req->HTTPSFileAuthDVIndicator = false;
+ $order_reissue_req->CNAMEAuthDVIndicator = false;
+ $approver_methods = array();
+ if(is_array($vars->ssl_auth_methods)){
+ if((strtoupper($order_status_resp->VendorName) == 'COMODO' || strtoupper($order_status_resp->VendorName) == 'SECTIGO') && $order_status_resp->SANCount > 0){
+ //For comodo multi-domain product
+ foreach($vars->ssl_auth_methods as $domain => $method){
+ if($method == 'HTTP'){
+ $approver_methods[] = 'HTTP_CSR_HASH';
+ }
+ elseif($method == 'HTTPS'){
+ $approver_methods[] = 'HTTPS_CSR_HASH';
+ }
+ elseif($method == 'DNS'){
+ $approver_methods[] = 'CNAME_CSR_HASH';
+ }
+ else{
+ $approver_methods[] = $method;
+ }
+ }
+ }
+ else{
+ //For comodo single domain and other vendors
+ foreach($vars->ssl_auth_methods as $domain => $method){
+
+ if($method == 'HTTP'){
+ $order_reissue_req->FileAuthDVIndicator = true;
+ if(isset($vars->ssl_approver_email)){
+ $approver_methods[] = $vars->ssl_approver_email;
+ }
+ }
+ elseif($method == 'HTTPS'){
+ $order_reissue_req->HTTPSFileAuthDVIndicator = true;
+ if(isset($vars->ssl_approver_email)){
+ $approver_methods[] = $vars->ssl_approver_email;
+ }
+ }
+ elseif($method == 'DNS'){
+ $order_reissue_req->CNAMEAuthDVIndicator = true;
+ if(isset($vars->ssl_approver_email)){
+ $approver_methods[] = $vars->ssl_approver_email;
+ }
+ }
+ elseif($method == 'EMAIL'){
+ $approver_methods[] = $vars->ssl_approver_email;
+ }
+ else{
+ $approver_methods[] = $method;
+ }
+ }
+ }
+ }
+ $order_reissue_req->ApproverEmail = implode(',', $approver_methods);
+ }
+
+
+
+ $order_reissue_req->SignatureHashAlgorithm = $signature_algorithm;
+ $order_reissue_req->AddSAN = $add_san_old_new_pair;
+ $order_reissue_req->DeleteSAN = $delete_san_old_new_pair;
+ $order_reissue_req->ReissueEmail = $order_status_resp->AdminContact->Email;
+ if($vendor_name == 'COMODO'){
+ $order_reissue_req->CSRUniqueValue = date('YmdHisa');
+ }
+
+ $this->log($this->api_partner_code . "|ssl-reissue", serialize($order_reissue_req), "input", true);
+ if($vendor_name == 'DIGICERT'){
+ $results = $this->parseResponse($api->digicert_order_reissue($order_reissue_req));
+ }
+ else{
+ $results = $this->parseResponse($api->order_reissue($order_reissue_req));
+ }
+
+ //Update CSR
+ if($results != NULL && $results->AuthResponse->isError == false){
+ sleep(3);
+ //call set DCV method for digicert
+ if($vendor_name == 'DIGICERT'){
+ foreach($vars->ssl_auth_methods as $domain => $method){
+ $method = ($method == 'HTTP' ? 'FILE' : $method);
+ $this->setApproverMethod($domain, $order_status_resp->PreOrganizationId, $order_status_resp->TheSSLStoreOrderID, $method);
+ }
+ }
+
+
+ //store service fields
Loader::loadModels($this, array("Services"));
//store CSR
if(isset($service_fields->thesslstore_csr)) {
@@ -3379,14 +4633,21 @@ private function reIssueCertificate($package,$service,$post,$order_status_resp){
* @param string $order_id TheSSLStore Order ID
* @return stdClass $response A response of order request
*/
- private function getSSLOrderStatus($order_id){
+ private function getSSLOrderStatus($order_id, $vendor_name = ''){
$api = $this->getApi();
$order_status_req = new order_status_request();
$order_status_req->TheSSLStoreOrderID = $order_id;
+ if(strtoupper($vendor_name) == 'DIGICERT'){
+ $response = $api->digicert_order_status($order_status_req);
+ }
+ else{
+ $response = $api->order_status($order_status_req);
+ }
+
$this->log($this->api_partner_code . "|ssl-order-status", serialize($order_status_req), "input", true);
- $results = $this->parseResponse($api->order_status($order_status_req));
+ $results = $this->parseResponse($response);
return $results;
}
@@ -3417,22 +4678,6 @@ public function validateCSR($csr, $product_code, $valid = false){
return $results;
}
- /**
- * validate Additional SAN fields for Certificate generation Process.
- *
- * @param string $csr
- * @param string $product_code SSLStore Product code
- * @param boolean $valid Is function is used for validation in Certificate generation process
- * @return stdClass $response A response of order request
- */
- public function validateAdditionalSAN($additional_san){
- foreach($additional_san as $san){
- if(trim($san) != '')
- return true;
- }
- return false;
- }
-
/**
* Return formatted date as per blesta datetime configuration.
*
@@ -3457,6 +4702,35 @@ private function getFormattedDate($utc_date){
return $utc_date;
}
+ /**
+ * Create Custom Order ID
+ *
+ * @param string $$serviceID
+ * @return $tssCustomOrderID
+ */
+ private function customOrderId($serviceID){
+ //get Blesta order number
+ try{
+ $blestaOrdersData = $this->Record->select(['orders.order_number','orders.id'])
+ ->from('orders')
+ ->innerJoin('order_services', 'order_services.order_id', '=', 'orders.id', false)
+ ->where('order_services.service_id', '=', $serviceID)->fetch();
+ }
+ catch(Exception $e){
+ $this->log('Database operation: Make Entry in ssl_orders', $e->getMessage(),'output', false);
+ }
+ $tssCustomOrderID = $blestaOrdersData->order_number;
+ //check this order has multiple service if yes then append service id
+ $noOfService = $this->Record->select()
+ ->from('order_services')
+ ->where('order_id', '=', $blestaOrdersData->id)->numResults();
+ if($noOfService > 1){
+ $tssCustomOrderID = $tssCustomOrderID."-".$serviceID;
+ }
+
+ return $tssCustomOrderID;
+ }
+
/**
* Management Action tab generic function for Admin
*
@@ -3470,59 +4744,35 @@ private function getFormattedDate($utc_date){
public function tabAdminManagementAction($package, $service, array $get=null, array $post=null, array $files=null) {
if($service->status == 'active')
{
- $this->view = new View("tab_admin_management_action", "default");
+ $this->view = new View("tab_admin_management_action", "default");
- $this->view->base_uri = $this->base_uri;
- $this->view->setDefaultView("components" . DS . "modules" . DS . "thesslstore_module" . DS);
+ $this->view->base_uri = $this->base_uri;
+ $this->view->setDefaultView("components" . DS . "modules" . DS . "thesslstore_module" . DS);
- // Load the helpers required for this view
- Loader::loadHelpers($this, array("Form", "Html", "Widget"));
+ // Load the helpers required for this view
+ Loader::loadHelpers($this, array("Form", "Html", "Widget"));
// Get the service fields
$service_fields = $this->serviceFieldsToObject($service->fields);
- $orderID=$service_fields->thesslstore_order_id;
+ $renewFrom = (isset($service_fields->thesslstore_renew_from) ? $service_fields->thesslstore_renew_from : '' );
// Gether order info using the order status request
- $order_resp = $this->getSSLOrderStatus($orderID);
- //Major Status Initial
- if($order_resp->OrderStatus->MajorStatus!='Initial')
- {
- $fileName = $order_resp->AuthFileName;
- $fileContent = $order_resp->AuthFileContent;
-
- $this->view->set("serviceID", $service->id);
- $this->view->set("clientID", $service->client_id);
- $this->view->set("orderMajorStatus", $order_resp->OrderStatus->MajorStatus);
- $this->view->set("orderMinorStatus", $order_resp->OrderStatus->MinorStatus);
- $this->view->set("fileName", $fileName);
- $this->view->set("fileContent", $fileContent);
- $this->view->set("VendorName", $order_resp->VendorName);
-
- /* Retrieve the module row for change approver option */
- $module_rows = $this->getModuleRows();
- foreach ($module_rows as $row) {
- if (isset($row->meta->hide_changeapprover_option)) {
- $hide_changeapprover_option = $row->meta->hide_changeapprover_option;
- }
- }
- $this->view->set("hide_changeapprover_option", $hide_changeapprover_option);
-
- return $this->view->fetch();
- }
- else
- {
- return '
-
- '.Language::_("ThesslstoreModule.!error.initial_order_status", true).'
-
- ';
- }
+ $order_resp = $this->getSSLOrderStatus($service_fields->thesslstore_order_id, $package->meta->thesslstore_vendor_name);
+
+ $this->view->set("serviceID", $service->id);
+ $this->view->set("clientID", $service->client_id);
+ $this->view->set("orderMajorStatus", $order_resp->OrderStatus->MajorStatus);
+ $this->view->set("storeOrderId", $order_resp->TheSSLStoreOrderID);
+ $this->view->set("token", $order_resp->Token);
+ $this->view->set("renewFrom", $renewFrom);
+ return $this->view->fetch();
}
else
{
- return '
-
- '.Language::_("ThesslstoreModule.!error.invalid_service_status", true).'
-
- ';
+ return '
+
+
+ '.Language::_("ThesslstoreModule.!error.invalid_service_status", true).'
+
+ ';
}
}
@@ -3538,198 +4788,95 @@ public function tabAdminManagementAction($package, $service, array $get=null, ar
*/
public function tabClientChangeApproverEmail($package, $service, array $get=null, array $post=null, array $files=null)
{
- $this->view = new View("tab_client_change_approver_email", "default");
- return $this->tabChangeApproverEmailInternal($package, $service, $get, $post, $files);
- }
-
- /**
- * Change Approver email tab generic function for Admin
- *
- * @param stdClass $package A stdClass object representing the current package
- * @param stdClass $service A stdClass object representing the current service
- * @param array $get Any GET parameters
- * @param array $post Any POST parameters
- * @param array $files Any FILES parameters
- * @return array The array of the approver email list
- */
- public function tabAdminChangeApproverEmail($package, $service, array $get=null, array $post=null, array $files=null)
- {
- $this->view = new View("tab_admin_change_approver_email", "default");
- return $this->tabChangeApproverEmailInternal($package, $service, $get, $post, $files);
- }
-
- /**
- * Change Approver email tab generic function Internal
- *
- * @param stdClass $package A stdClass object representing the current package
- * @param stdClass $service A stdClass object representing the current service
- * @param array $get Any GET parameters
- * @param array $post Any POST parameters
- * @param array $files Any FILES parameters
- * @return array The array of the approver email list
- */
- public function tabChangeApproverEmailInternal($package, $service, array $get=null, array $post=null, array $files=null) {
- if($service->status == 'active') {
+ if($service->status == 'active'){
// Get the service fields
$service_fields = $this->serviceFieldsToObject($service->fields);
- $orderID=$service_fields->thesslstore_order_id;
- // Gether order info using the order status request
- $order_resp = $this->getSSLOrderStatus($orderID);
- $fileName=$order_resp->AuthFileName;
- $fileContent=$order_resp->AuthFileContent;
- $VendorName=$order_resp->VendorName;
- /* Retrieve the module row for change approver option */
- $module_rows = $this->getModuleRows();
- foreach ($module_rows as $row) {
- if (isset($row->meta->hide_changeapprover_option)) {
- $hide_changeapprover_option = $row->meta->hide_changeapprover_option;
+
+ $order_resp = $this->getSSLOrderStatus($service_fields->thesslstore_order_id, $package->meta->thesslstore_vendor_name);
+
+ if(strtoupper($order_resp->OrderStatus->MajorStatus) == 'PENDING' || strtoupper($order_resp->OrderStatus->MinorStatus) == 'PENDING_REISSUE'){
+ $this->view = new View("tab_client_change_approver_email", "default");
+ $this->view->base_uri = $this->base_uri;
+ $this->view->setDefaultView("components" . DS . "modules" . DS . "thesslstore_module" . DS);
+ // Load the helpers required for this view
+ Loader::loadHelpers($this, array("Form", "Html", "Widget"));
+
+ //Authentication Method
+ $auth_methods = array();
+ $auth_methods['HTTP'] = 'HTTP File';
+ if(strtoupper($order_resp->VendorName) == 'COMODO' || strtoupper($order_resp->VendorName) == 'SECTIGO'){
+ $auth_methods['HTTPS'] = 'HTTPS File';
+ }
+ $auth_methods['DNS'] = 'DNS';
+ if(strtoupper($order_resp->VendorName) == 'DIGICERT'){
+ $auth_methods['EMAIL'] = 'E-Mail';
}
- }
- if(($order_resp->OrderStatus->MajorStatus=='Pending' || $order_resp->OrderStatus->MinorStatus=='PENDING_REISSUE')&& $fileContent=='' && $fileName=='')
- {
- if($VendorName!='SYMANTEC' || ($VendorName=='SYMANTEC' && $hide_changeapprover_option != "YES" ))
- {
- $this->view->base_uri = $this->base_uri;
- $this->view->setDefaultView("components" . DS . "modules" . DS . "thesslstore_module" . DS);
- // Load the helpers required for this view
- Loader::loadHelpers($this, array("Form", "Html", "Widget"));
- $productCode = $package->meta->thesslstore_product_code;
- // Get the service fields
- $service_fields = $this->serviceFieldsToObject($service->fields);
- $orderID = $service_fields->thesslstore_order_id;
- // Call the changeapproveremail function when the save button press
- if (isset($_POST["save"])) {
- $domainsArray = $_POST['domains'];
- $emailArray = $_POST['email'];
- $approverEmailArray = $_POST['approverEmail'];
- $this->changeApproverEmail($approverEmailArray, $domainsArray, $emailArray, $orderID);
- if (!$this->errors()) {
- //Redirect to certificate details page on success
- header('Location:' . $this->base_uri . "services/manage/" . ($service->id) . "/tabClientCertDetails/?success=change_mail");
- exit();
+ $auth_domains = array();
+ $auth_domain_alias_emails = array();
+ $base_domains = array();
+ $base_domain_alias_emails = array();
+ $auth_details = $this->getAuthDetails($order_resp);
+ foreach($auth_details as $domain => $auth_detail){
+ if($auth_detail['dcv_status'] != 'Validated'){
+ if($auth_detail['method'] == 'FILE'){
+ $auth_domains[$domain] = 'HTTP';
+ if($auth_detail['is_https']){
+ $auth_domains[$domain] = 'HTTPS';
+ }
+ } elseif($auth_detail['method'] == 'CNAME'){
+ $auth_domains[$domain] = 'DNS';
+ } elseif($auth_detail['method'] == 'EMAIL' && strtoupper($order_resp->VendorName) != 'DIGICERT'){
+ $auth_domains[$domain] = $auth_detail['email'];
+ } else{
+ $auth_domains[$domain] = $auth_detail['method'];
}
+ //create alias email for domain
+ $domain = str_replace("*.","", $domain);
+ $domain = str_replace("www.","", $domain);
+ $auth_domain_alias_emails[$domain]['admin@'] = 'admin@' . $domain;
+ $auth_domain_alias_emails[$domain]['administrator@'] = 'administrator@' . $domain;
+ $auth_domain_alias_emails[$domain]['hostmaster@'] = 'hostmaster@' . $domain;
+ $auth_domain_alias_emails[$domain]['postmaster@'] = 'postmaster@' . $domain;
+ $auth_domain_alias_emails[$domain]['webmaster@'] = 'webmaster@' . $domain;
+
+ $base_domain = $this->getPrimaryDomain($domain);
+ $base_domain = str_replace("*.","", $base_domain);
+ $base_domain = str_replace("www.","", $base_domain);
+ if($base_domain != $domain){
+ $base_domains[$domain] = $base_domain;
+ $base_domain_alias_emails[$base_domain]['admin@'] = 'admin@' . $base_domain;
+ $base_domain_alias_emails[$base_domain]['administrator@'] = 'administrator@' . $base_domain;
+ $base_domain_alias_emails[$base_domain]['hostmaster@'] = 'hostmaster@' . $base_domain;
+ $base_domain_alias_emails[$base_domain]['postmaster@'] = 'postmaster@' . $base_domain;
+ $base_domain_alias_emails[$base_domain]['webmaster@'] = 'webmaster@' . $base_domain;
+ }
}
- // Gether order info using the order status request
- $order_resp = $this->getSSLOrderStatus($orderID);
- $domainName = $order_resp->CommonName;
- $approverEmail = $order_resp->ApproverEmail;
- $approverEmailArray = explode(',', $approverEmail);
- $approverEmail = $approverEmailArray[0];
- $getApproverEmailsList = $this->getApproverEmailsList($productCode, $domainName);
- $approverEmailsListArray = array_filter(array_diff($getApproverEmailsList, array('support_preprod@geotrust.com', 'support@geotrust.com')));
- $this->view->set("domainName", $domainName);
- $this->view->set("approverEmail", $approverEmail);
- $this->view->set("approverEmailsListArray", (object)$approverEmailsListArray);
-
- // Check for the dnsNames for MD products
- $dnsNames = $order_resp->DNSNames;
- $dnsNamesArray = explode(',', $dnsNames);
- if ($productCode == 'quicksslpremiummd' || ($dnsNamesArray[0] == '' && $dnsNamesArray[0] == NULL)) {
- $dnsCount = 0;
- } else {
- $dnsCount = count($dnsNamesArray);
- }
- $domainNames = array();
- $approverEmails = array();
- $approverEmailsListArrays = array();
- for ($i = 0; $i < $dnsCount; $i++) {
- $j = $i + 1;
- $domainName = $dnsNamesArray[$i];
- $domainNames[] = $dnsNamesArray[$i];
- $getApproverEmailsLists = $this->getApproverEmailsList($productCode, $domainName);
- $approverEmailsListArrays[] = array_filter(array_diff($getApproverEmailsLists, array('support_preprod@geotrust.com', 'support@geotrust.com')));
- $approverEmails[] = $approverEmailArray[$j];
- }
- $this->view->set("domainNames", $domainNames);
- $this->view->set("approverEmails", $approverEmails);
- $this->view->set("approverEmailsListArrays", $approverEmailsListArrays);
-
- return $this->view->fetch();
- }
- else
- {
- $this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.change_approver_email_not_available_for_product", true))));
- return;
}
+ $this->view->set("service", $service);
+ $this->view->set("thesslstore_auth_methods",$auth_methods);
+ $this->view->set("auth_domains", $auth_domains);
+ $this->view->set("auth_domain_alias_emails", $auth_domain_alias_emails);
+ $this->view->set("base_domains", $base_domains);
+ $this->view->set("base_domain_alias_emails", $base_domain_alias_emails);
+ $this->view->set("product_code", $order_resp->ProductCode);
+ $this->view->set("vendor_name", strtoupper($order_resp->VendorName));
+ $this->view->set("token", $order_resp->Token);
+ $this->view->set("get_approver_email_url", $this->base_uri . "services/manage/" .$service->id. "/tabClientResendApproverEmail/");
+ return $this->view->fetch();
}
- else
- {
+ else{
$this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.change_approver_email_not_available_for_order", true))));
return;
}
-
}
- else {
+ else{
$this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.invalid_service_status", true))));
return;
}
}
- /**
- * Returns array of valid approver E-Mails List for domain
- *
- * @param string $productCode The ProductCode
- * @param string $domainName The domain
- * @return array E-Mails that are valid approvers for the domain
- */
- private function getApproverEmailsList($productCode,$domainName) {
- if (empty($domainName))
- return array();
-
- $api = $this->getApi();
-
- $orderApproverListReq = new order_approverlist_request();
- $orderApproverListReq->ProductCode = $productCode;
- $orderApproverListReq->DomainName = $domainName;
-
-
- $this->log("ssl-domain-emails-list", serialize($orderApproverListReq), "input", true);
- $thesslstore_approver_emails = $this->parseResponse($api->order_approverlist($orderApproverListReq));
-
- $emails = array();
- if ($thesslstore_approver_emails && !empty($thesslstore_approver_emails->ApproverEmailList)) {
- foreach ($thesslstore_approver_emails->ApproverEmailList as $email)
- if(!empty($email))
- $emails[$email] = $email;
- }
- $emails = array_filter(array_diff($emails, array('support_preprod@geotrust.com','support@geotrust.com')));
- return $emails;
- }
-
- /**
- * Change the approver emails of respective domain
- *
- * @param array $approverEmailArray The array of the approveremails
- * @param array $domainsArray The array of the domains including the DNS names
- * @param array $emailArray The array of the approveremail list of each domain
- * @return success Change the approver email of the respective domain.
- */
- private function changeApproverEmail($approverEmailArray,$domainsArray,$emailArray,$orderID) {
- $api = $this->getApi();
- $emailscount=count($emailArray);
-
- for($i=0;$i<$emailscount;$i++)
- {
- $approveremails=$emailArray[$i];
- $domainname=$domainsArray[$i];
- if ($approveremails==$approverEmailArray[$i])
- {
- //Nothing to do here
- }
- else
- {
- $order_changeapproveremail_request = new order_changeapproveremail_request();
- $order_changeapproveremail_request->ResendEmail = $approveremails;
- $order_changeapproveremail_request->TheSSLStoreOrderID = $orderID;
- $order_changeapproveremail_request->DomainNames = $domainname;
- $this->log("ssl-domain-order-changeapproveremail", serialize($order_changeapproveremail_request), "input", true);
- $result = $this->parseResponse($api->order_changeapproveremail($order_changeapproveremail_request));
- }
- }
- }
-
/**
* Download AuthFile tab generic function
*
@@ -3740,43 +4887,23 @@ private function changeApproverEmail($approverEmailArray,$domainsArray,$emailArr
* @param array $files Any FILES parameters
* @return Forcessfully download the auth file.
*/
- public function tabClientDownloadAuthFile($package, $service, array $get=null, array $post=null, array $files=null) {
- if($service->status == 'active') {
- // Get the service fields
- $service_fields = $this->serviceFieldsToObject($service->fields);
- $orderID=$service_fields->thesslstore_order_id;
- // Gether order info using the order status request
- $order_resp = $this->getSSLOrderStatus($orderID);
- $fileName=$order_resp->AuthFileName;
- $fileContent=$order_resp->AuthFileContent;
- if(($order_resp->OrderStatus->MajorStatus=='Pending' || $order_resp->OrderStatus->MinorStatus=='PENDING_REISSUE'))
- {
- if(!$fileName && !$fileContent)
- {
- $this->log($this->api_partner_code."|OrderID-".$orderID . "|ssl-download-authfile", Language::_("ThesslstoreModule.!error.download_authfile_invalid_status", true), "output", false);
- $this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.download_authfile_not_available", true))));
- return;
- exit;
- }
- else
- {
- ob_end_clean();
- header('Content-type:application/octet-stream');
- header('Content-Disposition:attachment; filename=' . $fileName);
- echo $fileContent;
- $this->log($this->api_partner_code."|OrderID-".$orderID . "|ssl-download-authfile", "Auth File Download Successfully", "output", true);
- exit;
- }
-
+ public function tabClientDownloadAuthFile($package, $service, array $get=null, array $post=null, array $files=null){
+ if($service->status == 'active'){
+ if(isset($_POST['file_name']) && isset($_POST['file_content'])){
+ ob_end_clean();
+ header('Content-type:application/octet-stream');
+ header('Content-Disposition:attachment; filename=' . $_POST['file_name']);
+ echo $_POST['file_content'];
+ exit;
}
- else
- {
- $this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.download_authfile_invalid_state", true))));
+ else{
+ $this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.invalid_screen", true))));
return;
+ exit;
}
return 'success';
}
- else {
+ else{
$this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.invalid_service_status", true))));
return;
}
@@ -3794,38 +4921,38 @@ public function tabClientDownloadAuthFile($package, $service, array $get=null, a
*/
public function tabClientDownloadCertificate($package, $service, array $get=null, array $post=null, array $files=null)
{
- if($service->status == 'active') {
+ if($service->status == 'active'){
// Get the service fields
$service_fields = $this->serviceFieldsToObject($service->fields);
- $orderID = $service_fields->thesslstore_order_id;
-
$api = $this->getApi();
$downloadReq = new order_download_request();
- $downloadReq->TheSSLStoreOrderID = $orderID;
- $downloadResp = $api->order_download_zip($downloadReq);
- // Gether order info using the order status request
- $order_resp = $this->getSSLOrderStatus($orderID);
- if ($order_resp->OrderStatus->MajorStatus == 'Active')
- {
- if (!$downloadResp->AuthResponse->isError) {
+ $downloadReq->TheSSLStoreOrderID = $service_fields->thesslstore_order_id;
+ if($package->meta->thesslstore_vendor_name == 'DIGICERT'){
+ $downloadResp = $api->digicert_download_zip($downloadReq);
+ }
+ else{
+ $downloadResp = $api->order_download_zip($downloadReq);
+ }
+
+ if(!$downloadResp->AuthResponse->isError){
+ if(strtoupper($downloadResp->CertificateStatus) == 'ACTIVE'){
$certdecoded = base64_decode($downloadResp->Zip);
$filename = $downloadReq->TheSSLStoreOrderID . '.zip';
ob_end_clean();
header('Content-type:application/octet-stream');
header('Content-Disposition:attachment; filename=' . $filename);
echo $certdecoded;
- $this->log($this->api_partner_code . "|OrderID-" . $orderID . "|ssl-download-certificate", "Certificate Download Successfully", "output", true);
exit;
- } else {
- $errors = $downloadResp->AuthResponse->Message;
- $this->log($this->api_partner_code . "|OrderID-" . $orderID . "|ssl-download-certificate", $errors, "output", false);
- $this->Input->setErrors(array('invalid_action' => array('internal' => $errors)));
+ }
+ else{
+ $this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.download_cert_invalid_state", true))));
return;
}
}
- else
- {
- $this->Input->setErrors(array('invalid_action' => array('internal' => Language::_("ThesslstoreModule.!error.download_cert_invalid_state", true))));
+ else{
+ $this->log($this->api_partner_code . "|download-certificate", json_encode($downloadReq), "input", true);
+ $this->log($this->api_partner_code . "|download-certificate", json_encode($downloadResp), "output", false);
+ $this->Input->setErrors(array('invalid_action' => array('internal' => $downloadResp->AuthResponse->Message[0])));
return;
}
return 'success';
@@ -3976,56 +5103,299 @@ private function sendInviteOrderEmail($service, $package, $service_meta) {
$this->Emails->send("service_creation", $package->company_id, $language_code, $client->email, $tags, null, null, null, array('to_client_id' => $client->id));
}
+ /**
+ * Create a new organization for digicert product
+ *
+ * @param stdClass $service An object representing the service created
+ * @param stdClass $package An object representing the package associated with the service
+ * @param array $post Any POST parameters
+ * @return organization id if success otherwise false.
+ */
+
+ private function createOrganization($service, $package, $post){
+
+ $api = $this->getApi();
+ if (!isset($this->Record)) {
+ Loader::loadComponents($this, ['Record']);
+ }
+ $create_org_req = new digicert_create_organization_request();
+ $create_org_req->Name = $post['thesslstore_org_name'];
+ $create_org_req->AssumedName = '';
+ $create_org_req->Address = $post['thesslstore_admin_address1'];
+ $create_org_req->Address2 = $post['thesslstore_admin_address2'];
+ $create_org_req->Zip = $post['thesslstore_admin_zip'];
+ $create_org_req->City = $post['thesslstore_admin_city'];
+ $create_org_req->State = $post['thesslstore_admin_state'];
+ $create_org_req->Country = $post['thesslstore_admin_country'];
+ $create_org_req->Organization_Phone = $post['thesslstore_admin_phone'];
+ $create_org_req->OrganizationContact->Firstname = $post['thesslstore_admin_first_name'];
+ $create_org_req->OrganizationContact->Lastname = $post['thesslstore_admin_last_name'];
+ $create_org_req->OrganizationContact->Email = $post['thesslstore_admin_email'];
+ $create_org_req->OrganizationContact->JobTitle = $post['thesslstore_admin_title'];
+ $create_org_req->OrganizationContact->Phone = $post['thesslstore_admin_phone'];
+
+ // if($package->meta->thesslstore_validation_type == 'EV'){
+ $create_org_req->ValidationsTypes = 'EV';
+ $create_org_req->ApproversContact->Firstname = $post['thesslstore_tech_first_name'];
+ $create_org_req->ApproversContact->Lastname = $post['thesslstore_tech_last_name'];
+ $create_org_req->ApproversContact->Email = $post['thesslstore_tech_email'];
+ $create_org_req->ApproversContact->JobTitle = $post['thesslstore_tech_title'];
+ $create_org_req->ApproversContact->Phone = $post['thesslstore_tech_phone'];
+ // }
+ $create_org_resp = $this->parseResponse($api->digicert_create_organization($create_org_req));
+
+ if($create_org_resp == NULL || $create_org_resp->AuthResponse->isError) {
+ return false;
+ }
+ else{
+ $this->Record->insert("sslstore_organisations",
+ array('user_id' => $service->client_id,
+ 'org_id' => $create_org_resp->OrganizationId,
+ 'vendor_org_id' => $create_org_resp->VendorOrganizationId,
+ 'org_name' => $post['thesslstore_org_name'],
+ 'is_sandbox' => $this->is_sandbox_mode,
+ 'created' => date('Y-m-d H:i:s')
+ )
+ );
+ }
+ return $create_org_resp->OrganizationId;
+ }
+ /**
+ * Return organization list for DigiCert product
+ *
+ * @param stdClass $service An object representing the service created
+ * @return array organization list.
+ */
+
+ private function getOrganizationList($service){
+ if (!isset($this->Record)) {
+ Loader::loadComponents($this, ['Record']);
+ }
+ $organisation_list = array();
+ $organisation_lists = $this->Record->select(array("org_id","org_name"))->from("sslstore_organisations")->where("user_id", "=", $service->client_id)->where("is_sandbox", "=", $this->is_sandbox_mode)->fetchAll();
+ foreach($organisation_lists as $row){
+ $organisation_list[$row->org_id] = $row->org_name;
+ }
+
+ return $organisation_list;
+ }
+
+ /**
+ * set Domain approver for DigiCert product
+ *
+ * @param string $domain_name
+ * @param string $org_id
+ * @param string $store_order_id
+ * @param string $method
+ * @return stdClass $domain_info.
+ */
+
+ private function setApproverMethod($domain_name, $org_id, $store_order_id, $method){
+ $api = $this->getApi();
+ $set_approver_method_req = new digicert_set_approver_method_request();
+ $set_approver_method_req->DomainName = $domain_name;
+ $set_approver_method_req->PreOrganizationId = $org_id;
+ $set_approver_method_req->TheSSLStoreOrderID = $store_order_id;
+ $set_approver_method_req->ApproverMethod = $method;
+ $set_approver_method_req->ValidationsTypes = array('OV','EV');
+
+ $this->log($this->api_partner_code . "|digicert-set-approver", json_encode($set_approver_method_req), "input", true);
+ return $this->parseResponse($api->digicert_set_approver_method($set_approver_method_req), true);
+ }
+
+
+ /*
+ * Return domain vetting status for pending orders
+ *
+ * @param stdClass $order_resp
+ * @return array Auth details.
+ */
+ private function getAuthDetails($order_resp){
+
+ $auth_details = array();
+ if(strtoupper($order_resp->OrderStatus->MajorStatus) == 'PENDING' || strtoupper($order_resp->OrderStatus->MinorStatus) == 'PENDING_REISSUE'){
+ if(isset($order_resp->OrderStatus->DomainAuthVettingStatus) && is_array($order_resp->OrderStatus->DomainAuthVettingStatus)){
+ foreach($order_resp->OrderStatus->DomainAuthVettingStatus as $domain_status){
+ if(strtoupper($order_resp->VendorName) != 'SYMANTEC' || (strtoupper($order_resp->VendorName) == 'SYMANTEC' && $order_resp->CommonName == $domain_status->domain)){
+ $auth_details[$domain_status->domain]['dcv_status'] = (strtoupper($domain_status->dcvStatus) == 'VALIDATED' || strtoupper($domain_status->dcvStatus) == 'COMPLETE' || strtoupper($domain_status->dcvStatus) == 'VALID' ? 'Validated' : 'Not Validated');
+
+ //call digicert get domain info to get latest domain status
+ if(strtoupper($order_resp->VendorName) == 'DIGICERT' && $auth_details[$domain_status->domain]['dcv_status'] == 'Not Validated'){
+ if(empty($domain_status->domain_id)){
+ //set approver method if doesn't set
+ $this->setApproverMethod($domain_status->domain, $order_resp->PreOrganizationId, $order_resp->TheSSLStoreOrderID, 'EMAIL' );
+ }
+
+ $domain_info = $this->getDomainInfo($domain_status->domain, $order_resp->TheSSLStoreOrderID);
+ if($domain_info != NULL && $domain_info->AuthResponse->isError == false){
+ $domain_status = $domain_info->dcvDetails;
+ }
+ }
+
+ if(strtoupper($domain_status->dcvMethod) == 'HTTP_CSR_HASH' || strtoupper($domain_status->dcvMethod) == 'HTTPS_CSR_HASH' || strtoupper($domain_status->dcvMethod) == 'FILE'){
+ $auth_details[$domain_status->domain]['method'] = 'FILE';
+ $protocol = 'http';
+ $auth_details[$domain_status->domain]['is_https'] = false;
+ if($domain_status->dcvMethod == 'HTTPS_CSR_HASH'){
+ $protocol = 'https';
+ $auth_details[$domain_status->domain]['is_https'] = true;
+ }
+ $file_name = explode("/", $domain_status->FileName);
+ $auth_details[$domain_status->domain]['file_name'] = array_pop($file_name);
+ $auth_details[$domain_status->domain]['file_url'] = $protocol . "://" . str_replace('*.', '', $domain_status->domain) . "/.well-known/pki-validation/" . $auth_details[$domain_status->domain]['file_name'];
+ $auth_details[$domain_status->domain]['file_content'] = $domain_status->FileContents;
+ }
+ elseif(strtoupper($domain_status->dcvMethod) == 'CNAME_CSR_HASH'){
+ $auth_details[$domain_status->domain]['method'] = 'CNAME';
+ $auth_details[$domain_status->domain]['alias'] = $domain_status->DNSName;
+ $auth_details[$domain_status->domain]['point_to'] = $domain_status->DNSEntry;
+ }
+ elseif(strtoupper($domain_status->dcvMethod) == 'DNS'){
+ $auth_details[$domain_status->domain]['method'] = 'DNS';
+ $auth_details[$domain_status->domain]['point_to'] = $domain_status->DNSEntry;
+ }
+ else{
+ $auth_details[$domain_status->domain]['method'] = 'EMAIL';
+ if(strtoupper($order_resp->VendorName) == 'DIGICERT'){
+ $auth_details[$domain_status->domain]['email'] = 'WHOIS EMAILS';
+ }
+ else{
+ $auth_details[$domain_status->domain]['email'] = $domain_status->dcvMethod;
+ }
+ }
+ }
+ }
+ }
+ }
+ return $auth_details;
+ }
+ /*
+ * Return domain vetting status for DigiCert product
+ * @param $domain_name
+ * @patam $store_order_id
+ * @return stdClass getDomainInfo
+ */
+ private function getDomainInfo($domain_name, $store_order_id){
+ $api = $this->getApi();
+ $get_domain_info_req = new digicert_get_domain_request();
+ $get_domain_info_req->DomainName = $domain_name;
+ $get_domain_info_req->TheSSLStoreOrderID = $store_order_id;
+
+ $get_domain_info_resp = $api->digicert_get_domain_info($get_domain_info_req);
+
+
+ if($get_domain_info_resp == NULL || $get_domain_info_resp->AuthResponse->isError){
+ $this->log($this->api_partner_code . "|digicert-get-domain-info", json_encode($get_domain_info_req), "input", true);
+ $this->log($this->api_partner_code . "|digicert-get-domain-info", json_encode($get_domain_info_req), "output", true);
+ }
+ return $get_domain_info_resp;
+ }
/*
* Return Web Server List
*/
- private function getWebserverTypes() {
- return array(
- "" => Language::_("ThesslstoreModule.please_select", true),
- "aol" => "AOL",
- "apacheapachessl" => "Apache + ApacheSSL",
- "apachessl" => "Apache + MOD SSL",
- "apacheopenssl" => "Apache + OpenSSL",
- "apacheraven" => "Apache + Raven",
- "apachessleay" => "Apache + SSLeay",
- "apache2" => "Apache 2",
- "c2net" => "C2Net Stronghold",
- "cisco3000" => "Cisco 3000 Series VPN Concentrator",
- "citrix" => "Citrix",
- "cobaltseries" => "Cobalt Series",
- "covalentserver" => "Covalent Server Software",
- "cpanel" => "Cpanel",
- "ensim" => "Ensim",
- "hsphere" => "Hsphere",
- "Iplanet" => "iPlanet Server 4.1",
- "Ibmhttp" => "IBM HTTP",
- "Ibminternet" => "IBM Internet Connection Server",
- "ipswitch" => "Ipswitch",
- "tomcat" => "Jakart-Tomcat",
- "javawebserver" => "Java Web Server (Javasoft / Sun)",
- "Domino" => "Lotus Domino 4.6+",
- "Dominogo4625" => "Lotus Domino Go 4.6.2.51",
- "Dominogo4626" => "Lotus Domino Go 4.6.2.6+",
- "iis4" => "Microsoft IIS 4.0",
- "iis5" => "Microsoft IIS 5.0",
- "iis" => "Microsoft Internet Information Server",
- "Netscape" => "Netscape Enterprise/FastTrack",
- "NetscapeFastTrack" => "Netscape FastTrack",
- "website" => "O'Reilly WebSite Professional",
- "oracle" => "Oracle",
- "plesk" => "Plesk",
- "quid" => "Quid Pro Quo",
- "r3ssl" => "R3 SSL Server",
- "reven" => "Raven SSL",
- "redhat" => "RedHat Linux",
- "sapwebserver" => "SAP Web Application Server",
- "WebLogic" => "WebLogic – all versions",
- "webstar" => "WebStar",
- "webten" => "WebTen (from Tenon)",
- "zeusv3" => "Zeus v3+",
- "other" => "Other"
- );
+ private function getWebserverTypes($vendor_name){
+
+ if($vendor_name == 'DIGICERT'){
+ return array(
+ "" => Language::_("ThesslstoreModule.please_select", true),
+ "apachessl" => "Apache + MOD SSL",
+ "Barracuda" => "Barracuda",
+ "BEA Weblogic 8 & 9" => "BEA Weblogic 8 & 9",
+ "cisco3000" => "Cisco 3000 Series VPN Concentrator",
+ "citrix" => "Citrix",
+ "Citrix Access Essentials" => "Citrix Access Essentials",
+ "Citrix Access Gateway 4.x" => "Citrix Access Gateway 4.x",
+ "Citrix Access Gateway 5.x and higher" => "Citrix Access Gateway 5.x and higher",
+ "cpanel" => "Cpanel",
+ "F5 Big-IP" => "F5 Big-IP",
+ "F5 FirePass" => "F5 FirePass",
+ "Ibmhttp" => "IBM HTTP",
+ "tomcat" => "Jakart-Tomcat",
+ "javawebserver" => "Java Web Server (Javasoft / Sun)",
+ "Juniper" => "Juniper",
+ "Lighttpd" => "Lighttpd",
+ "Domino" => "Lotus Domino 4.6+",
+ "Mac OS X Server" => "Mac OS X Server",
+ "Microsoft Exchange Server 2003" => "Microsoft Exchange Server 2003",
+ "Microsoft Exchange Server 2007" => "Microsoft Exchange Server 2007",
+ "Microsoft Exchange Server 2010" => "Microsoft Exchange Server 2010",
+ "Microsoft Exchange Server 2013" => "Microsoft Exchange Server 2013",
+ "Microsoft Exchange Server 2016" => "Microsoft Exchange Server 2016",
+ "Microsoft Forefront Unified Access Gateway" => "Microsoft Forefront Unified Access Gateway",
+ "iis4" => "Microsoft IIS 4.0",
+ "iis5" => "Microsoft IIS 5.0",
+ "Microsoft IIS 8" => "Microsoft IIS 8",
+ "Microsoft IIS 10" => "Microsoft IIS 10",
+ "iis" => "Microsoft Internet Information Server",
+ "Microsoft Live Communications Server 2005" => "Microsoft Live Communications Server 2005",
+ "Microsoft Lync Server 2010" => "Microsoft Lync Server 2010",
+ "Microsoft Lync Server 2013" => "Microsoft Lync Server 2013",
+ "Microsoft OCS R2" => "Microsoft OCS R2",
+ "Microsoft Office Communications Server 2007" => "Microsoft Office Communications Server 2007",
+ "Microsoft Small Business Server 2008 & 2011" => "Microsoft Small Business Server 2008 & 2011",
+ "Netscape" => "Netscape Enterprise/FastTrack",
+ "NetscapeFastTrack" => "Netscape FastTrack",
+ "nginx" => "Nginx",
+ "Novell iChain" => "Novell iChain",
+ "Novell NetWare" => "Novell NetWare",
+ "oracle" => "Oracle",
+ "Qmail" => "Qmail",
+ "SunOne" => "SunOne",
+ "WebLogic" => "WebLogic – all versions",
+ "webstar" => "WebStar",
+ "zeusv3" => "Zeus v3+",
+ "other" => "Other"
+ );
+ }
+ else{
+
+ return array(
+ "" => Language::_("ThesslstoreModule.please_select", true),
+ "aol" => "AOL",
+ "apacheapachessl" => "Apache + ApacheSSL",
+ "apachessl" => "Apache + MOD SSL",
+ "apacheopenssl" => "Apache + OpenSSL",
+ "apacheraven" => "Apache + Raven",
+ "apachessleay" => "Apache + SSLeay",
+ "apache2" => "Apache 2",
+ "c2net" => "C2Net Stronghold",
+ "cisco3000" => "Cisco 3000 Series VPN Concentrator",
+ "citrix" => "Citrix",
+ "cobaltseries" => "Cobalt Series",
+ "covalentserver" => "Covalent Server Software",
+ "cpanel" => "Cpanel",
+ "ensim" => "Ensim",
+ "hsphere" => "Hsphere",
+ "Iplanet" => "iPlanet Server 4.1",
+ "Ibmhttp" => "IBM HTTP",
+ "Ibminternet" => "IBM Internet Connection Server",
+ "ipswitch" => "Ipswitch",
+ "tomcat" => "Jakart-Tomcat",
+ "javawebserver" => "Java Web Server (Javasoft / Sun)",
+ "Domino" => "Lotus Domino 4.6+",
+ "Dominogo4625" => "Lotus Domino Go 4.6.2.51",
+ "Dominogo4626" => "Lotus Domino Go 4.6.2.6+",
+ "iis4" => "Microsoft IIS 4.0",
+ "iis5" => "Microsoft IIS 5.0",
+ "iis" => "Microsoft Internet Information Server",
+ "Netscape" => "Netscape Enterprise/FastTrack",
+ "NetscapeFastTrack" => "Netscape FastTrack",
+ "website" => "O'Reilly WebSite Professional",
+ "oracle" => "Oracle",
+ "plesk" => "Plesk",
+ "quid" => "Quid Pro Quo",
+ "r3ssl" => "R3 SSL Server",
+ "reven" => "Raven SSL",
+ "redhat" => "RedHat Linux",
+ "sapwebserver" => "SAP Web Application Server",
+ "WebLogic" => "WebLogic – all versions",
+ "webstar" => "WebStar",
+ "webten" => "WebTen (from Tenon)",
+ "zeusv3" => "Zeus v3+",
+ "other" => "Other"
+ );
+ }
}
/* Return Country List*/
@@ -4140,4 +5510,75 @@ private function parseResponse($response, $ignore_error = false) {
return $response;
}
+
+ /*
+ * Return primary domain name
+ */
+ private function getPrimaryDomain($domain_name){
+ if ( !preg_match("/^http/", $domain_name) )
+ $domain_name = 'http://' . $domain_name;
+ if ( $domain_name[strlen($domain_name)-1] != '/' )
+ $domain_name .= '/';
+ $pieces = parse_url($domain_name);
+ $domain = isset($pieces['host']) ? $pieces['host'] : '';
+ if ( preg_match('/(?P[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs) ) {
+ $res = preg_replace('/^www\./', '', $regs['domain'] );
+ return $res;
+ }
+ return $domain_name;
+ }
}
+
+if(isset($_POST['action']) && $_POST['action'] == 'getResellerPrice'){
+ $tssObject = new ThesslstoreModule();
+ $apiCurrencyRate = $_POST['apiCurrencyRate'];
+ //get selected currency rate
+
+ /* Retrieve the company ID */
+ $companyID=Configure::get("Blesta.company_id");
+
+ // Load the Loader to fetch supported Currencies
+ Loader::loadModels($tssObject, array("Currencies"));
+
+ $getSelectedCurrency = $tssObject->Currencies-> get($_POST['selectedCurrencyId'],$companyID);
+
+ Loader::load(dirname(__FILE__) . DS . "api" . DS . "thesslstoreApi.php");
+
+
+ $pricing = array();
+ //Get products
+ $products = $tssObject->getProducts();
+ /*------------------ Currency Converter Function ---------------------------*/
+ function thesslstore_currecncy_converter($productprice, $currency_rate, $api_currency_rate){
+
+ $final_price = (($productprice * $currency_rate)/$api_currency_rate);
+
+ return number_format($final_price, 2, '.', '');
+ }
+
+ if($products != NULL && $getSelectedCurrency != NULL){
+ foreach($products as $product){
+ if($product->ProductCode == 'freessl'){
+ $pricing[$product->ProductCode . '_1'] = thesslstore_currecncy_converter(0, $getSelectedCurrency->exchange_rate, $apiCurrencyRate);
+ }
+ else {
+ foreach ($product->PricingInfo as $pinfo) {
+ $pricing[$product->ProductCode . '_' . $pinfo->NumberOfMonths] = thesslstore_currecncy_converter($pinfo->Price, $getSelectedCurrency->exchange_rate, $apiCurrencyRate);
+ if (($product->MaxSan - $product->MinSan - 1) > 0) {
+ $pricing[$product->ProductCode . '_' . $pinfo->NumberOfMonths . '_san'] = thesslstore_currecncy_converter($pinfo->PricePerAdditionalSAN, $getSelectedCurrency->exchange_rate, $apiCurrencyRate);
+ }
+ if ($product->isNoOfServerFree == false && $product->isCodeSigning == false && $product->isScanProduct == false) {
+ $pricing[$product->ProductCode . '_' . $pinfo->NumberOfMonths . '_server'] = thesslstore_currecncy_converter($pinfo->PricePerAdditionalServer, $getSelectedCurrency->exchange_rate, $apiCurrencyRate);
+ }
+ }
+ }
+ }
+ }
+
+ echo json_encode(array(
+ "prefix" => $getSelectedCurrency->prefix,
+ "suffix" => $getSelectedCurrency->suffix,
+ "pricing" => $pricing
+ )
+ );die();
+}
\ No newline at end of file
diff --git a/views/default/add_credential.pdt b/views/default/add_credential.pdt
index 976a340..49f0144 100644
--- a/views/default/add_credential.pdt
+++ b/views/default/add_credential.pdt
@@ -57,12 +57,6 @@
$this->Form->label($this->_("ThesslstoreModule.row_meta.api_mode", true), "api_mode");
$this->Form->fieldSelect("api_mode",array('TEST'=>'TEST','LIVE'=>'LIVE') , $this->Html->ifSet($vars->api_mode), array('id' => "api_mode"));
?>
-
-
- Form->label($this->_("ThesslstoreModule.row_meta.hide_changeapprover_option", true), "hide_changeapprover_option");
- $this->Form->fieldCheckbox("hide_changeapprover_option", "YES", (isset($vars->hide_changeapprover_option) && $vars->hide_changeapprover_option == "YES"), array('id' => "hide_changeapprover_option"));
- ?>
diff --git a/views/default/additional_settings.pdt b/views/default/additional_settings.pdt
new file mode 100644
index 0000000..c37d6fd
--- /dev/null
+++ b/views/default/additional_settings.pdt
@@ -0,0 +1,234 @@
+
+
+
+ ×
+ _("ThesslstoreModule.additional_settings.update_success");?>
+
+
+
+ Widget->clear();
+ $this->Widget->create($this->_("ThesslstoreModule.additional_settings.box_title", true));
+ ?>
+
+ Form->create();
+ $this->Form->fieldHidden( 'module_row_id', $this->Html->ifSet($techVars->module_row_id) )
+ ?>
+
+ _("ThesslstoreModule.additional_settings.tech_info");?>
+
+
+
+ -
+ Form->fieldCheckbox("use_default_tech_details", "yes",$this->Html->ifSet($vars->use_default_tech_details) == "yes", array('id' => 'use_default_tech_details') );
+ $this->Form->label( $this->_("ThesslstoreModule.row_meta.default_tech_details", true), 'use_default_tech_details',array('class' => "inline") );
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.default_tech_job_title", true), "thesslstore_tech_job_title");
+ $this->Form->fieldText("thesslstore_tech_job_title", $this->Html->ifSet($vars->thesslstore_tech_job_title), array('id' => "thesslstore_tech_job_title"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.default_tech_first_name", true), "thesslstore_tech_first_name");
+ $this->Form->fieldText("thesslstore_tech_first_name", $this->Html->ifSet($vars->thesslstore_tech_first_name), array('id' => "thesslstore_tech_first_name"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.default_tech_last_name", true), "thesslstore_tech_last_name");
+ $this->Form->fieldText("thesslstore_tech_last_name", $this->Html->ifSet($vars->thesslstore_tech_last_name), array('id' => "thesslstore_tech_last_name"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.default_tech_organization_name", true), "thesslstore_tech_org_name");
+ $this->Form->fieldText("thesslstore_tech_org_name", $this->Html->ifSet($vars->thesslstore_tech_org_name), array('id' => "thesslstore_tech_org_name"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.default_tech_address", true), "thesslstore_tech_address");
+ $this->Form->fieldText("thesslstore_tech_address", $this->Html->ifSet($vars->thesslstore_tech_address), array('id' => "thesslstore_tech_address"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.default_tech_phone_number", true), "thesslstore_tech_phone");
+ $this->Form->fieldText("thesslstore_tech_phone", $this->Html->ifSet($vars->thesslstore_tech_phone), array('id' => "thesslstore_tech_phone"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.default_tech_email_address", true), "thesslstore_tech_email");
+ $this->Form->fieldText("thesslstore_tech_email", $this->Html->ifSet($vars->thesslstore_tech_email), array('id' => "thesslstore_tech_email"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.default_tech_city", true), "thesslstore_tech_city");
+ $this->Form->fieldText("thesslstore_tech_city", $this->Html->ifSet($vars->thesslstore_tech_city), array('id' => "thesslstore_tech_city"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.default_tech_state", true), "thesslstore_tech_state");
+ $this->Form->fieldText("thesslstore_tech_state", $this->Html->ifSet($vars->thesslstore_tech_state), array('id' => "thesslstore_tech_state"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.default_tech_country", true), "thesslstore_tech_country");
+ $this->Form->fieldSelect("thesslstore_tech_country", $this->Html->ifSet($thesslstore_countries), $this->Html->ifSet($vars->thesslstore_tech_country), array('id' => "thesslstore_tech_country"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.default_tech_zip_code", true), "thesslstore_tech_zipcode");
+ $this->Form->fieldText("thesslstore_tech_zipcode", $this->Html->ifSet($vars->thesslstore_tech_zipcode), array('id' => "thesslstore_tech_zipcode"));
+ ?>
+
+
+
+
+ _("ThesslstoreModule.additional_settings.other_settings");?>
+
+
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.additionaldays_for_new_order", true), "additional_days_for_neworder");
+ $this->Form->fieldText("additional_days_for_neworder", $this->Html->ifSet($vars->additional_days_for_neworder), array('id' => "additional_days_for_neworder"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.additionaldays_for_renew_order", true), "additional_days_for_reneworder");
+ $this->Form->fieldText("additional_days_for_reneworder", $this->Html->ifSet($vars->additional_days_for_reneworder), array('id' => "additional_days_for_reneworder"));
+ ?>
+
+
+
+
+ Form->end();
+ ?>
+
+ Widget->end();
+ ?>
+
+
\ No newline at end of file
diff --git a/views/default/client_service_info.pdt b/views/default/client_service_info.pdt
index f6fb6e2..e05ce3d 100644
--- a/views/default/client_service_info.pdt
+++ b/views/default/client_service_info.pdt
@@ -1,20 +1,20 @@
-
-
-
-
- _("ThesslstoreModule.tab_client_cert_details.store_order_id");?>
- _("ThesslstoreModule.tab_client_cert_details.vendor_order_id");?>
- _("ThesslstoreModule.tab_client_cert_details.order_status");?>
- _("ThesslstoreModule.tab_client_cert_details.vendor_status");?>
-
-
-
-
- Html->_($store_order_id);?>
- Html->_($vendor_order_id);?>
- Html->_($major_status);?>
- Html->_($minor_status);?>
-
-
-
+
+
+
+
+ _("ThesslstoreModule.tab_client_cert_details.store_order_id");?>
+ _("ThesslstoreModule.tab_client_cert_details.vendor_order_id");?>
+ _("ThesslstoreModule.tab_client_cert_details.order_status");?>
+ _("ThesslstoreModule.tab_client_cert_details.vendor_status");?>
+
+
+
+
+ Html->_($store_order_id);?>
+ Html->_($vendor_order_id);?>
+ Html->_($major_status);?>
+ Html->_($minor_status);?>
+
+
+
\ No newline at end of file
diff --git a/views/default/images/icon_loading.gif b/views/default/images/icon_loading.gif
new file mode 100644
index 0000000..712bfb2
Binary files /dev/null and b/views/default/images/icon_loading.gif differ
diff --git a/views/default/import_orders.pdt b/views/default/import_orders.pdt
new file mode 100644
index 0000000..d8e113b
--- /dev/null
+++ b/views/default/import_orders.pdt
@@ -0,0 +1,242 @@
+
+
+
+ ×
+
+
+
+
+
+ ×
+
+
+
+
+
+
+ ×
+ _("ThesslstoreModule.!success.import_order_success");?>
+
+
+ Html->ifSet($message);
+
+ $this->Widget->clear();
+ $this->Widget->create($this->_("ThesslstoreModule.add_row.box_title", true));
+
+ $this->Form->create($uri = null, $attributes = array('id' => "frmImport"));
+ ?>
+
+
+ _("ThesslstoreModule.add_row.import_orders");?>
+
+ clients=='false')
+ {
+ ?>
+ _("ThesslstoreModule.!error.empty_client");?>
+
+
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.store_order_id", true), "store_order_id");
+ $this->Form->fieldText("store_order_id", $this->Html->ifSet($vars->store_order_id), array('id' => "store_order_id"));
+ ?>
+
+ -
+ Form->fieldRadio("order_type", "new_order", true, array('id' => "import_order_type_new") );
+ $this->Form->label($this->_("ThesslstoreModule.row_meta.import_order_type_new", true), "import_order_type_new", array('class' => "inline"));
+ ?>
+
+ -
+ Form->fieldRadio("order_type", "existing_order", false, array('id' => "import_order_type_existing") );
+ $this->Form->label($this->_("ThesslstoreModule.row_meta.import_order_type_existing", true), "import_order_type_existing", array('class' => "inline"));
+ ?>
+
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.client_label", true), "client");
+ $this->Form->fieldSelect("client",$vars->clients,'', array('id' => "client"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.invoice_method_label", true),"" ,array() );
+
+ $this->Form->fieldRadio("invoice_method", "create", true, array('id' => "invoice_method_create") );
+ $this->Form->label($this->_("ThesslstoreModule.row_meta.invoice_method_create", true), "invoice_method_create", array('class' => "inline"));
+
+ $this->Form->fieldRadio("invoice_method", "append", false, array('id' => "invoice_method_append") );
+ $this->Form->label($this->_("ThesslstoreModule.row_meta.invoice_method_append", true), "invoice_method_append", array('class' => "inline"));
+ $this->Form->fieldSelect("invoice",$vars->invoices,'', array('id' => "invoice_id"));
+
+ $this->Form->fieldRadio("invoice_method", "none", false, array('id' => "invoice_method_none") );
+ $this->Form->label($this->_("ThesslstoreModule.row_meta.invoice_method_none", true), "invoice_method_none", array('class' => "inline"));
+ ?>
+
+ -
+ Form->fieldCheckbox("send_email", "yes",$this->Html->ifSet($vars->send_email) == "yes", array('id' => 'send_email') );
+ $this->Form->label( $this->_("ThesslstoreModule.row_meta.send_email_label", true), 'send_email',array('class' => "inline") );
+ ?>
+
+
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.service_id_label", true), "service_id");
+ $this->Form->fieldSelect("service_id",$vars->services,'', array('id' => "service_id"));
+ ?>
+
+
+
+
+
+
+
+
+
+Form->end();
+ ?>
+
+
+
+
+ Client#
+ Store Order ID
+ Package Name
+ Product Code
+ Term
+ Date Added
+ Date Renews
+ Options
+
+
+ importOrderData as $order)
+ {
+ if($odd == true){
+ $odd_row = 'odd_row';
+ $odd = false;
+ }
+ elseif($odd == false){
+ $odd_row = '';
+ $odd = true;
+ }
+ ?>
+
+ client_id; ?>
+ store_order_id; ?>
+ package_name; ?>
+ product_code; ?>
+ term.' '.$order->period; ?>
+ date_added; ?>
+ date_renews; ?>
+ Manage
+
+
+
+
+
+
+
+
+
+Widget->end();
+ ?>
+
+
+
diff --git a/views/default/import_packages.pdt b/views/default/import_packages.pdt
index 817aa4c..a27da4c 100644
--- a/views/default/import_packages.pdt
+++ b/views/default/import_packages.pdt
@@ -1,75 +1,315 @@
-
-
-
- ×
- _("ThesslstoreModule.!success.import_package_success");?>
-
-
-
-
-
- ×
- _("ThesslstoreModule.!error.import_package_error");?>
-
-
- Html->ifSet($message);
-
- $this->Widget->clear();
- $this->Widget->create($this->_("ThesslstoreModule.add_row.box_title", true));
-
- $this->Form->create();
- ?>
-
-
- _("ThesslstoreModule.add_row.import_packages");?>
-
- packageGroupsArray=='false')
- {
- ?>
- _("ThesslstoreModule.!error.empty_package_group");?>
+
+
+
+ ×
+ _("ThesslstoreModule.!success.import_package_success");?>
+
+
+
+
+
+ ×
+ _("ThesslstoreModule.!error.import_package_error");?>
+
+
+Html->ifSet($message);
+
+ $this->Widget->clear();
+ $this->Widget->create($this->_("ThesslstoreModule.add_row.box_title", true));
+
+ $this->Form->create($uri = null, $attributes = array('id' => "frmImport"));
+ ?>
+
+
+ _("ThesslstoreModule.add_row.import_packages");?>
+
+ packageGroupsArray=='false')
+ {
+ ?>
+ _("ThesslstoreModule.!error.empty_package_group");?>
+ currenciesArray=='false')
+ {
+ ?>
+ _("ThesslstoreModule.!error.empty_currency_array");?>
+
+
+
+ -
+ Form->fieldRadio("import_package_mode", "with_percentage", true, array('id' => "import_package_mode_percentage") );
+ $this->Form->label($this->_("ThesslstoreModule.row_meta.import_package_with_percentage", true), "import_package_mode_percentage", array('class' => "inline"));
+ ?>
+
+ -
+ Form->fieldRadio("import_package_mode", "with_price", false, array('id' => "import_package_mode_price") );
+ $this->Form->label($this->_("ThesslstoreModule.row_meta.import_package_with_price", true), "import_package_mode_price", array('class' => "inline"));
+ ?>
+
+ -
Form->label($this->_("ThesslstoreModule.row_meta.product_group", true), "product_group");
+ $this->Form->fieldSelect("product_group",$vars->packageGroups, $this->Html->ifSet($vars->product_group), array('id' => "product_group"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.currency_code", true), "currency_code");
+ $this->Form->fieldSelect("currency_code",$vars->currencies, $this->Html->ifSet($vars->defaultCurrency), array('id' => "currency_code"));
+ ?>
+
+ -
+ Form->label($this->_("ThesslstoreModule.row_meta.profit_margin", true), "profit_margin");
+ $this->Form->fieldText("profit_margin", $this->Html->ifSet($vars->profit_margin), array('id' => "profit_margin"));
+ ?>
+ _("ThesslstoreModule.row_meta.profit_margin_info");?>
+
+
+ Note:-The price of all the products will be setup base on the "Base Conv. Rate" of the selected Currency Code and apiCurrencyCode; ?> Currency Code. So please make sure that you have set up the correct "Base Conv. Rate" for each currency. (The default price of all the products from TheSSLStore API is in apiCurrencyCode; ?>.)
+
+
+
+
+
+
+
+
+
+
+ No
+ name="prd_select_all" id="prd_select_all" value="yes">
+ Product Name
+ Brand Name
+ Validation Type
+
+
+ products as $product)
{
- ?>
-
-
- -
- Form->label($this->_("ThesslstoreModule.row_meta.product_group", true), "product_group");
- $this->Form->fieldSelect("product_group",$vars->packageGroups, $this->Html->ifSet($vars->product_group), array('id' => "product_group"));
- ?>
-
- -
+ if($odd == true){
+ $odd_row = 'odd_row';
+ $odd = false;
+ }
+ elseif($odd == false){
+ $odd_row = '';
+ $odd = true;
+ }
+ $checked = '';
+ $billingCycleLabels = array(1 => 'Monthly', 3 => 'Quarterly', 6 => 'Semi-Annually', 12 => 'Annually', 24 => 'Biennially', 36=> 'Triennially');
+ $isSupportedBillingCycle = false;
+ foreach($product->PricingInfo as $pricing_info){
+ if(isset($billingCycleLabels[$pricing_info->NumberOfMonths])){
+ $isSupportedBillingCycle = true;
+ }
+ }
+ if(empty($posted_products) || in_array($product->ProductCode, $posted_products)){
+ $checked = 'checked="checked"';
+ }
+ if($isSupportedBillingCycle) {
+ $i++;
+ ?>
+
+
+
+ ProductCode, $vars->existingProducts)){?>
+ Edit
+
+ ProductCode ?>"
+ type="checkbox" name="products[]"
+ value="ProductCode; ?>">
+
Form->label($this->_("ThesslstoreModule.row_meta.profit_margin", true), "profit_margin");
- $this->Form->fieldText("profit_margin", $this->Html->ifSet($vars->profit_margin), array('id' => "profit_margin"));
- ?>
-
- -
- % Margin will apply to the price of all the products. You can change it later on from the price setup menu.
-
-
-
-
-
-
- Form->end();
- ?>
-
- Widget->end();
- ?>
\ No newline at end of file
+ }
+ ?>
+
+ ProductName . ' (' . $product->ProductCode . ')';
+ if(!in_array($product->ProductCode, $vars->existingProducts)){
+ ?>
+
+
+
+ Months
+ Price
+ Additional SAN
+ Additional Server
+
+
+ ProductCode == 'freessl'){
+ echo '';
+ echo '1 ';
+ echo ' ';
+ echo(($product->MaxSan - $product->MinSan - 1) > 0 ? ' ' : '- ');
+ echo(($product->isNoOfServerFree == false && $product->isCodeSigning == false && $product->isScanProduct == false) ? ' ' : '- ');
+ echo ' ';
+ } else{
+ $odd_new = false;
+ foreach($product->PricingInfo as $pricing_info){
+ if($odd_new == true){
+ $odd_row_new = 'odd_row';
+ $odd_new = false;
+ }
+ elseif($odd_new == false){
+ $odd_row_new = '';
+ $odd_new = true;
+ }
+ if(isset($billingCycleLabels[$pricing_info->NumberOfMonths])){
+ echo '';
+ echo '' . $pricing_info->NumberOfMonths . ' ';
+ echo ' ';
+ echo((strtoupper($product->VendorName) != 'CWATCH' && ($product->MaxSan - $product->MinSan - 1) > 0) ? ' ' : '- ');
+ echo((strtoupper($product->VendorName) != 'CWATCH' && $product->isNoOfServerFree == false && $product->isCodeSigning == false && $product->isScanProduct == false) ? ' ' : '- ');
+ echo ' ';
+ }
+ }
+ }
+ ?>
+
+
+
+ VendorName == 'CPAC' || $product->VendorName == 'WEB INSPECTOR') ? 'COMODO' : $product->VendorName; ?>
+ isDVProduct) ? 'DV' : (($product->isOVProduct) ? 'OV' : (($product->isEVProduct) ? 'EV' : '-'))); ?>
+
+
+
+
+
+
+
+
+Form->end();
+ ?>
+
+Widget->end();
+ ?>
+
+
+
diff --git a/views/default/reseller_price.pdt b/views/default/reseller_price.pdt
index eee866c..20c7551 100644
--- a/views/default/reseller_price.pdt
+++ b/views/default/reseller_price.pdt
@@ -1,142 +1,142 @@
-Widget->clear();
- $this->Widget->create($this->_("ThesslstoreModule.reseller_price.box_title", true));
- ?>
-
-
-
-
-
Note: Below is your "Html->_($api_mode); ?>" Account Pricing in "USD".
-
-
-
-
-
-
- Package Name
- Product Code
- Currency Code
- 1 Year
- 2 Year
- 3 Year
-
- $pricing){
- if($odd == true){
- $class = "class='odd_row'";
- $odd = false;
- }
- elseif($odd == false){
- $class = '';
- $odd = true;
- }
- ?>
- >
- Html->_($pricing['name']); ?>
- Html->_($pcode); ?>
- USD
-
- Html->_($pricing['1year_price']);
- else
- echo "N/A";
- ?>
-
-
- Html->_($pricing['2year_price']);
- else
- echo "N/A";
- ?>
-
-
- Html->_($pricing['3year_price']);
- else
- echo "N/A";
- ?>
-
-
-
-
- >
- + Additional SAN
- -
- USD
-
- Html->_($pricing['1year_san_price']);
- else
- echo "N/A";
- ?>
-
-
- Html->_($pricing['2year_san_price']);
- else
- echo "N/A";
- ?>
-
-
- Html->_($pricing['3year_san_price']);
- else
- echo "N/A";
- ?>
-
-
-
- >
- + Additional Server
- -
- USD
-
- Html->_($pricing['1year_server_price']);
- else
- echo "N/A";
- ?>
-
-
- Html->_($pricing['2year_server_price']);
- else
- echo "N/A";
- ?>
-
-
- Html->_($pricing['3year_server_price']);
- else
- echo "N/A";
- ?>
-
-
-
-
-
-
-
- Widget->end();
+Widget->clear();
+ $this->Widget->create($this->_("ThesslstoreModule.reseller_price.box_title", true));
+ ?>
+
+
+
+
+
Note: Below is your "Html->_($api_mode); ?>" Account Pricing in "USD".
+
+
+
+
+
+
+ Package Name
+ Product Code
+ Currency Code
+ 1 Year
+ 2 Year
+ 3 Year
+
+ $pricing){
+ if($odd == true){
+ $class = "class='odd_row'";
+ $odd = false;
+ }
+ elseif($odd == false){
+ $class = '';
+ $odd = true;
+ }
+ ?>
+ >
+ Html->_($pricing['name']); ?>
+ Html->_($pcode); ?>
+ USD
+
+ Html->_($pricing['1year_price']);
+ else
+ echo "N/A";
+ ?>
+
+
+ Html->_($pricing['2year_price']);
+ else
+ echo "N/A";
+ ?>
+
+
+ Html->_($pricing['3year_price']);
+ else
+ echo "N/A";
+ ?>
+
+
+
+
+ >
+ + Additional SAN
+ -
+ USD
+
+ Html->_($pricing['1year_san_price']);
+ else
+ echo "N/A";
+ ?>
+
+
+ Html->_($pricing['2year_san_price']);
+ else
+ echo "N/A";
+ ?>
+
+
+ Html->_($pricing['3year_san_price']);
+ else
+ echo "N/A";
+ ?>
+
+
+
+ >
+ + Additional Server
+ -
+ USD
+
+ Html->_($pricing['1year_server_price']);
+ else
+ echo "N/A";
+ ?>
+
+
+ Html->_($pricing['2year_server_price']);
+ else
+ echo "N/A";
+ ?>
+
+
+ Html->_($pricing['3year_server_price']);
+ else
+ echo "N/A";
+ ?>
+
+
+
+
+
+
+
+ Widget->end();
?>
\ No newline at end of file
diff --git a/views/default/setup_price.pdt b/views/default/setup_price.pdt
index 81e89b6..eb72737 100644
--- a/views/default/setup_price.pdt
+++ b/views/default/setup_price.pdt
@@ -23,33 +23,75 @@
$this->Widget->create($this->_("ThesslstoreModule.add_row.box_title", true));
?>
- Form->create();
- ?>
+
_("ThesslstoreModule.add_row.setup_price");?>
+ isApiCurrencySet=='false')
+ {
+ ?>
+ First of all please Add/Configure the apiCurrencyCode; ?> currency. To do that please Go to Currencies > Active Currencies.
+
+ Form->create(array("action" => $update_currency_link));
+ ?>
+
+ _("ThesslstoreModule.setup_price.info");?>
+
+
-
Form->fieldCheckbox("thesslstore_apply_margin", "yes",$this->Html->ifSet($vars->thesslstore_apply_margin) == "yes", array('id' => 'thesslstore_apply_margin') );
- $this->Form->label( $this->_("ThesslstoreModule.setup_price.apply_margin", true), 'thesslstore_apply_margin',array('class' => "inline") );
- ?>
-
- -
- "thesslstore_margin_percentage");
- if($this->Html->ifSet($vars->thesslstore_apply_margin) != "yes")
- $margin_attr['disabled'] = "disabled";
- $this->Form->label($this->_("ThesslstoreModule.setup_price.margin_percentage", true), "thesslstore_margin_percentage",array('class' => "thesslstore_margin_percentage"));
- $this->Form->fieldText("thesslstore_margin_percentage", $this->Html->ifSet($vars->thesslstore_margin_percentage), $margin_attr);
+ $this->Form->label($this->_("ThesslstoreModule.row_meta.currency_code", true), "currency_code");
+ $this->Form->fieldSelect("currency_code",$vars->currencies, $this->Html->ifSet($vars->defaultCurrency), array('id' => "currency_code"));
?>
+ _("ThesslstoreModule.setup_price.currency_submit_btn");?>
+
+
+ Note:-The price of all the products will be setup base on the "Base Conv. Rate" of the selected Currency Code and apiCurrencyCode; ?> Currency Code. So please make sure that you have set up the correct "Base Conv. Rate" for each currency. (The default price of all the products from TheSSLStore API is in apiCurrencyCode; ?>.)
+
+ Form->end();
+ ?>
+
+
+ Form->create(array("action" => $setup_price_link));
+ ?>
+
+
+
+ -
+ Form->fieldCheckbox("thesslstore_apply_margin", "yes",$this->Html->ifSet($vars->thesslstore_apply_margin) == "yes", array('id' => 'thesslstore_apply_margin') );
+ $this->Form->label( $this->_("ThesslstoreModule.setup_price.apply_margin", true), 'thesslstore_apply_margin',array('class' => "inline") );
+ ?>
+
+ -
+ "thesslstore_margin_percentage");
+ if($this->Html->ifSet($vars->thesslstore_apply_margin) != "yes")
+ $margin_attr['disabled'] = "disabled";
+ $this->Form->label($this->_("ThesslstoreModule.setup_price.margin_percentage", true), "thesslstore_margin_percentage",array('class' => "thesslstore_margin_percentage"));
+ $this->Form->fieldText("thesslstore_margin_percentage", $this->Html->ifSet($vars->thesslstore_margin_percentage), $margin_attr);
+ ?>
+
+
+
@@ -64,6 +106,14 @@
3 Year
+ _("ThesslstoreModule.setup_price.error");?>
+ $data){
if($odd == true){
@@ -82,7 +132,7 @@
Html->ifSet($data['group_name']); ?>
Html->ifSet($data['name']); ?>
Html->ifSet($data['product_code']); ?>
- USD
+ Html->ifSet($vars->defaultCurrency) ?>
+ Additional SAN
-
- USD
+ Html->ifSet($vars->defaultCurrency) ?>
+ Additional Server
-
- USD
+ Html->ifSet($vars->defaultCurrency) ?>
@@ -184,8 +235,12 @@
-
+
@@ -223,4 +278,18 @@
);
});
+
+ function ddlValidate() {
+ if ($('input#thesslstore_margin_percentage').is(":enabled") == true)
+ {
+ var profit_margin = document.getElementById("thesslstore_margin_percentage").value;
+ if (profit_margin == '' || isNaN(profit_margin) ) {
+ alert("Please enter a valid Profit Margin");
+ document.getElementById("thesslstore_margin_percentage").focus();
+ event.preventDefault();
+ return false;
+ }
+ }
+ return true;
+ }
\ No newline at end of file
diff --git a/views/default/tab_admin_management_action.pdt b/views/default/tab_admin_management_action.pdt
index faf75e7..e039f5f 100644
--- a/views/default/tab_admin_management_action.pdt
+++ b/views/default/tab_admin_management_action.pdt
@@ -1,48 +1,22 @@
-
- Form->create($this->base_uri . "clients/servicetab/" . $this->Html->ifSet($clientID) . "/" . $this->Html->ifSet($serviceID) . "/tabClientDownloadAuthFile/");
- ?>
-
- Form->end();
- } ?>
-
- Form->create($this->base_uri . "clients/servicetab/" . $this->Html->ifSet($clientID) . "/" . $this->Html->ifSet($serviceID) . "/tabClientDownloadCertificate/");
- ?>
-
- Form->end();
- } ?>
-
- Form->create($this->base_uri . "clients/servicetab/" . $this->Html->ifSet($clientID) . "/" . $this->Html->ifSet($serviceID) . "/tabAdminChangeApproverEmail/");
- ?>
-
- Form->end();
- }
- } ?>
-
- Form->create($this->base_uri . "clients/servicetab/" . $this->Html->ifSet($clientID) . "/" . $this->Html->ifSet($serviceID) . "/tabClientResendApproverEmail/");
- ?>
-
- Form->end();
- } ?>
-
+
+ _("ThesslstoreModule.tab_CertDetails");?>
+
+
+
+ - _("ThesslstoreModule.tab_client_cert_details.order_status");?> : Html->_($orderMajorStatus); ?>
-
+
- _("ThesslstoreModule.tab_client_cert_details.store_order_id");?> : Html->_($storeOrderId); ?>
-
+
- _("ThesslstoreModule.tab_client_cert_details.token");?> : Html->_($token); ?>
-
+
- _("ThesslstoreModule.tab_client_cert_details.renew_from");?> : Html->_($renewFrom); ?>
-
+
+
+ Form->create($this->base_uri . "clients/servicetab/" . $this->Html->ifSet($clientID) . "/" . $this->Html->ifSet($serviceID) . "/tabClientDownloadCertificate/");
+ ?>
+
+ Form->end();
+ } ?>
+
diff --git a/views/default/tab_client_cert_details.pdt b/views/default/tab_client_cert_details.pdt
index 0bc229c..717c69c 100644
--- a/views/default/tab_client_cert_details.pdt
+++ b/views/default/tab_client_cert_details.pdt
@@ -1,219 +1,372 @@
-
-
-
-
-
- _("ThesslstoreModule.success.change_approver_email"); ?>
-
-
-
-
-
- _("ThesslstoreModule.tab_client_cert_details"); ?>
- order_status == 'Initial'){?>
-
-
-
-
-
-
- Html->_($certificate->order_status); ?>
- _("ThesslstoreModule.tab_GenerateCert"); ?>
-
-
-
-
-
-
-
- Html->_($certificate->store_order_id); ?>
-
-
-
-
-
-
- Html->_($certificate->token); ?>
-
-
-
-
-
-
-
-
- Html->_($certificate->order_status); ?>
-
-
-
-
-
-
- Html->_($service->package->name); ?>
-
-
-
-
-
-
- Html->_($certificate->store_order_id); ?>
-
-
-
-
-
-
- Html->_($certificate->vendor_order_id); ?>
-
-
-
-
-
-
- Html->_($certificate->vendor_status); ?>
-
-
-
-
-
-
-
-
-
- Html->_($certificate->token); ?>
-
-
-
-
-
-
- Html->_($certificate->ssl_start_date); ?>
-
-
-
-
-
-
- Html->_($certificate->ssl_end_date); ?>
-
-
-
-
-
-
- Html->_($certificate->domains); ?>
- Html->_($certificate->additional_domains);?>
-
- verification_type == 'email'){ ?>
-
-
-
-
- Html->_($certificate->verification_email); ?>
-
-
- siteseal_url != 'NA'){ ?>
-
-
-
-
-
-
-
- _("ThesslstoreModule.tab_client_cert_details.admin_details"); ?>
-
-
-
-
-
-
- Html->_($certificate->admin_title); ?>
-
-
-
-
-
-
- Html->_($certificate->admin_first_name); ?>
-
-
-
-
-
-
- Html->_($certificate->admin_last_name); ?>
-
-
-
-
-
-
- Html->_($certificate->admin_email); ?>
-
-
-
-
-
-
- Html->_($certificate->admin_phone); ?>
-
-
-
- _("ThesslstoreModule.tab_client_cert_details.tech_details"); ?>
-
-
-
-
-
-
- Html->_($certificate->tech_title); ?>
-
-
-
-
-
-
- Html->_($certificate->tech_first_name); ?>
-
-
-
-
-
-
- Html->_($certificate->tech_last_name); ?>
-
-
-
-
-
-
- Html->_($certificate->tech_email); ?>
-
-
-
-
-
-
- Html->_($certificate->tech_phone); ?>
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+ _("ThesslstoreModule.success.change_approver_email"); ?>
+
+
+
+
+
+ _("ThesslstoreModule.tab_client_cert_details"); ?>
+ order_status == 'INITIAL'){
+ ?>
+
+
+
+
+
+
+ Html->_($certificate->order_status); ?>
+ _("ThesslstoreModule.tab_GenerateCert"); ?>
+
+
+
+
+
+
+
+
+ Html->_($certificate->store_order_id);
+ if($certificate->renew_from != ''){
+ ?>
+ (_("ThesslstoreModule.tab_client_cert_details.renew_from") ?>: Html->_($certificate->renew_from); ?> )
+
+
+
+
+
+
+
+
+ Html->_($certificate->token); ?>
+
+
+
+
+
+
+
+
+ Html->_($certificate->order_status); ?>
+
+
+
+
+
+
+ Html->_($service->package->name); ?>
+
+
+
+
+
+
+ Html->_($certificate->store_order_id);
+ if($certificate->renew_from != ''){
+ ?>
+ (_("ThesslstoreModule.tab_client_cert_details.renew_from") ?>: Html->_($certificate->renew_from); ?> )
+
+
+
+
+
+
+
+
+ Html->_($certificate->vendor_order_id); ?>
+
+
+
+
+
+
+ Html->_($certificate->vendor_status); ?>
+
+
+ vendor_name == 'DIGICERT'){
+ ?>
+
+
+
+
+ Html->_($certificate->org_name); ?> (#Html->_($certificate->org_id); ?>)
+
+
+
+
+
+
+
+ Html->_($certificate->token); ?>
+
+
+
+
+
+
+ Html->_($certificate->ssl_start_date); ?>
+
+
+
+
+
+
+ Html->_($certificate->ssl_end_date); ?>
+
+
+
+
+
+
+ Html->_($certificate->domains); ?>
+ Html->_($certificate->additional_domains);?>
+
+ vendor_name == 'SYMANTEC' || $certificate->vendor_name == 'RAPIDSSL' || $certificate->vendor_name == 'GEOTRUST' || $certificate->vendor_name == 'THAWTE'){
+ ?>
+
+
+
+
+ Html->_($certificate->verification_email); ?>
+
+
+ siteseal_url != 'NA'){
+ ?>
+
+
+
+
+
+
+
+ _("ThesslstoreModule.tab_client_cert_details.admin_details"); ?>
+
+
+
+
+
+
+ Html->_($certificate->admin_title); ?>
+
+
+
+
+
+
+ Html->_($certificate->admin_first_name); ?>
+
+
+
+
+
+
+ Html->_($certificate->admin_last_name); ?>
+
+
+
+
+
+
+ Html->_($certificate->admin_email); ?>
+
+
+
+
+
+
+ Html->_($certificate->admin_phone); ?>
+
+
+ vendor_name != 'DIGICERT'){
+ ?>
+ _("ThesslstoreModule.tab_client_cert_details.tech_details"); ?>
+
+
+
+
+
+
+ Html->_($certificate->tech_title); ?>
+
+
+
+
+
+
+ Html->_($certificate->tech_first_name); ?>
+
+
+
+
+
+
+ Html->_($certificate->tech_last_name); ?>
+
+
+
+
+
+
+ Html->_($certificate->tech_email); ?>
+
+
+
+
+
+
+ Html->_($certificate->tech_phone); ?>
+
+
+ order_status == 'PENDING' || $certificate->order_status == 'PENDING_REISSUE') && !empty($auth_details)){
+ ?>
+ _("ThesslstoreModule.tab_client_cert_details.auth_details"); ?>
+
+
+
+
+ $auth_detail){
+ ?>
+
+ Html->_($domain_name); ?>
+ Html->_($auth_detail['method']); ?>
+
+ Html->_($auth_detail['dcv_status']); ?>
+ Form->create($this->base_uri . "services/manage/" . $this->Html->ifSet($service->id) . "/tabClientDownloadAuthFile/",array('class'=> 'pull-right'));
+ $this->Form->fieldHidden("file_name", $auth_detail['file_name']);
+ $this->Form->fieldHidden("file_content", $auth_detail['file_content']);
+ ?>
+
+ Form->end();
+ }
+ if($auth_detail['method'] == 'EMAIL' && $auth_detail['dcv_status']!= 'Validated'){
+ ?>
+
+
+
+
+
+
+ File Name:
+ Html->_($auth_detail['file_url']); ?>
+
+
+ File Content:
+
+
+
+
+ Host/Alias:
+ Html->_($auth_detail['alias']); ?>
+
+
+ value:
+ Html->_($auth_detail['point_to']); ?>
+
+
+
+ value:
+ Html->_($auth_detail['point_to']); ?>
+
+
+
+ Email:
+ Html->_($auth_detail['email']); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/views/default/tab_client_change_approver_email.pdt b/views/default/tab_client_change_approver_email.pdt
index f33f56c..73f1d0f 100644
--- a/views/default/tab_client_change_approver_email.pdt
+++ b/views/default/tab_client_change_approver_email.pdt
@@ -1,67 +1,219 @@
-Form->create();
-?>
-
- _("ThesslstoreModule.tab_select_approver_email"); ?>
-
-
-
-
- Form-> fieldHidden("domains[0]", $domainName );
- $this->Form-> fieldHidden("approverEmail[0]", $approverEmail);
- foreach($approverEmailsListArray as $value=>$key){
- ?>
- -
- Form->fieldRadio("email[0]", $key, $checked, array('id' => $domainName.$key) );
- $this->Form->label($key,$domainName.$key,array('class' => "inline"));
- ?>
-
-
-
-
-
-
-
-
- Form-> fieldHidden("domains[$j]", $domainNames[$i] );
- $this->Form-> fieldHidden("approverEmail[$j]", $approverEmails[$i]);
- foreach($approverEmailsListArrays[$i] as $values=>$keys){
- ?>
- -
- Form->fieldRadio("email[$j]", $keys, $checked, array('id' => $domainNames[$i].$keys) );
- $this->Form->label($keys,$domainNames[$i].$keys,array('class' => "inline"));
- ?>
-
-
-
-
-
-
-
-
-Form->end();
-?>
\ No newline at end of file
+Form->create();
+?>
+
+
+
+ $auth_method){
+ if($auth_method != 'HTTP' && $auth_method != 'HTTPS' && $auth_method != 'DNS'){
+ $current_method = 'EMAIL';
+ }
+ else{
+ $current_method = $auth_method;
+ }
+ ?>
+
+
+ Form->label($auth_domain.'*', "ssl_auth_methods[".$auth_domain."]");
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Form->end();
+?>
+
\ No newline at end of file
diff --git a/views/default/tab_client_generate_cert_step1.pdt b/views/default/tab_client_generate_cert_step1.pdt
index f47f892..ddab45f 100644
--- a/views/default/tab_client_generate_cert_step1.pdt
+++ b/views/default/tab_client_generate_cert_step1.pdt
@@ -1,218 +1,262 @@
-
-
-
-
- _("ThesslstoreModule.tab_GenerateCert");?>
- _("ThesslstoreModule.tab_GenerateCert"); ?>
-
-
- Form->create($this->base_uri . "services/manage/" . $this->Html->ifSet($service_id) . "/tabClientGenerateCert/");
- $this->Form->fieldHidden("thesslstore_gen_step", $step);
- ?>
-
-
- _("ThesslstoreModule.tab_generate_cert.heading_server");?>
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_csr", true).'*', "thesslstore_csr");
- $this->Form->fieldTextArea("thesslstore_csr", $this->Html->ifSet($vars->thesslstore_csr), array('id' => "thesslstore_csr", 'class'=>"form-control", 'rows'=>8));
- ?>
-
-
-
- 0){
- for($i=1; $i <= $san_count; $i++){?>
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_additional_san", true).$i, "thesslstore_additional_san".$i);
- $this->Form->fieldText("thesslstore_additional_san[]", $this->Html->ifSet($vars->thesslstore_additional_san[$i - 1]), array('id' => "thesslstore_additional_san".$i, 'class'=>"form-control"));
- ?>
-
-
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_webserver_type", true).'*', "thesslstore_webserver_type");
- $this->Form->fieldSelect("thesslstore_webserver_type", $this->Html->ifSet($thesslstore_webserver_types), $this->Html->ifSet($vars->thesslstore_webserver_type), array('id' => "thesslstore_webserver_type", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_signature_algorithm", true).'*', "thesslstore_signature_algorithm");
- $this->Form->fieldSelect("thesslstore_signature_algorithm", $this->Html->ifSet($thesslstore_signature_algorithms), $this->Html->ifSet($vars->thesslstore_signature_algorithm), array('id' => "thesslstore_signature_algorithm", 'class'=>"form-control"));
- ?>
-
-
- _("ThesslstoreModule.tab_generate_cert.heading_auth_method");?>*
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_auth_method", true), "thesslstore_auth_method");
- foreach($thesslstore_auth_methods as $value => $name){
- $checked = false;
- if($this->Html->ifSet($auth_method) == $value)
- $checked = true;
- $this->Form->fieldRadio("thesslstore_auth_method", $value, $checked, array('id' => "auth_".$value) );
- $this->Form->label($name, "auth_".$value);
- }
- ?>
-
- Form->fieldHidden("thesslstore_auth_method", "EMAIL");
- }
- ?>
- _("ThesslstoreModule.tab_generate_cert.heading_admin");?>
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_admin_first_name", true).'*', "thesslstore_admin_first_name");
- $this->Form->fieldText("thesslstore_admin_first_name", $this->Html->ifSet($thesslstore_admin_first_name), array('id' => "thesslstore_admin_first_name", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_admin_last_name", true).'*', "thesslstore_admin_last_name");
- $this->Form->fieldText("thesslstore_admin_last_name", $this->Html->ifSet($thesslstore_admin_last_name), array('id' => "thesslstore_admin_last_name", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_admin_title", true), "thesslstore_admin_title");
- $this->Form->fieldText("thesslstore_admin_title", $this->Html->ifSet($thesslstore_admin_title), array('id' => "thesslstore_admin_title", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_admin_email", true).'*', "thesslstore_admin_email");
- $this->Form->fieldText("thesslstore_admin_email", $this->Html->ifSet($thesslstore_admin_email), array('id' => "thesslstore_admin_email", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_admin_phone", true).'*', "thesslstore_admin_phone");
- $this->Form->fieldText("thesslstore_admin_phone", $this->Html->ifSet($thesslstore_admin_phone), array('id' => "thesslstore_admin_phone", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_org_name", true).'*', "thesslstore_org_name");
- $this->Form->fieldText("thesslstore_org_name", $this->Html->ifSet($thesslstore_org_name), array('id' => "thesslstore_org_name", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_org_division", true).'*', "thesslstore_org_division");
- $this->Form->fieldText("thesslstore_org_division", $this->Html->ifSet($thesslstore_org_division), array('id' => "thesslstore_org_division", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_admin_address1", true).'*', "thesslstore_admin_address1");
- $this->Form->fieldText("thesslstore_admin_address1", $this->Html->ifSet($thesslstore_admin_address1), array('id' => "thesslstore_admin_address1", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_admin_address2", true), "thesslstore_admin_address2");
- $this->Form->fieldText("thesslstore_admin_address2", $this->Html->ifSet($thesslstore_admin_address2), array('id' => "thesslstore_admin_address2", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_admin_city", true).'*', "thesslstore_admin_city");
- $this->Form->fieldText("thesslstore_admin_city", $this->Html->ifSet($thesslstore_admin_city), array('id' => "thesslstore_admin_city", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_admin_state", true).'*', "thesslstore_admin_state");
- $this->Form->fieldText("thesslstore_admin_state", $this->Html->ifSet($thesslstore_admin_state), array('id' => "thesslstore_admin_state", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_admin_country", true).'*', "thesslstore_admin_country");
- $this->Form->fieldSelect("thesslstore_admin_country", $this->Html->ifSet($thesslstore_countries), $this->Html->ifSet($thesslstore_admin_country), array('id' => "thesslstore_admin_country", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_admin_zip", true).'*', "thesslstore_admin_zip");
- $this->Form->fieldText("thesslstore_admin_zip", $this->Html->ifSet($thesslstore_admin_zip), array('id' => "thesslstore_admin_zip", 'class'=>"form-control"));
- ?>
-
-
- _("ThesslstoreModule.tab_generate_cert.heading_tech");?>
-
- Form->fieldCheckbox("thesslstore_same_as_admin","true", $this->Html->ifSet($vars->thesslstore_same_as_admin), array('id' => "thesslstore_same_as_admin") );
- $this->Form->label($this->_("ThesslstoreModule.service_field.thesslstore_same_as_admin", true), "thesslstore_same_as_admin");
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_tech_first_name", true).'*', "thesslstore_tech_first_name");
- $this->Form->fieldText("thesslstore_tech_first_name", $this->Html->ifSet($thesslstore_tech_first_name), array('id' => "thesslstore_tech_first_name", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_tech_last_name", true).'*', "thesslstore_tech_last_name");
- $this->Form->fieldText("thesslstore_tech_last_name", $this->Html->ifSet($thesslstore_tech_last_name), array('id' => "thesslstore_tech_last_name", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_tech_title", true), "thesslstore_tech_title");
- $this->Form->fieldText("thesslstore_tech_title", $this->Html->ifSet($thesslstore_tech_title), array('id' => "thesslstore_tech_title", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_tech_email", true).'*', "thesslstore_tech_email");
- $this->Form->fieldText("thesslstore_tech_email", $this->Html->ifSet($thesslstore_tech_email), array('id' => "thesslstore_tech_email", 'class'=>"form-control"));
- ?>
-
-
- Form->label($this->_("ThesslstoreModule.service_field.thesslstore_tech_phone", true).'*', "thesslstore_tech_phone");
- $this->Form->fieldText("thesslstore_tech_phone", $this->Html->ifSet($thesslstore_tech_phone), array('id' => "thesslstore_tech_phone", 'class'=>"form-control"));
- ?>
-
-
-
-
- Form->end();
- }
- ?>
-
\ No newline at end of file
diff --git a/views/default/tab_client_generate_cert_step2.pdt b/views/default/tab_client_generate_cert_step2.pdt
index dfd6e52..2098134 100644
--- a/views/default/tab_client_generate_cert_step2.pdt
+++ b/views/default/tab_client_generate_cert_step2.pdt
@@ -1,66 +1,231 @@
-Form->create($this->base_uri . "services/manage/" . $this->Html->ifSet($service_id) . "/tabClientGenerateCert/");
-
- $this->Form->fieldHidden("thesslstore_gen_step", $step);
- $this->Form->fieldHidden("thesslstore_csr", $vars->thesslstore_csr);
- $this->Form->fieldHidden("thesslstore_webserver_type", $vars->thesslstore_webserver_type);
- $this->Form->fieldHidden("thesslstore_signature_algorithm", $vars->thesslstore_signature_algorithm);
- $this->Form->fieldHidden("thesslstore_auth_method", $vars->thesslstore_auth_method);
- $this->Form->fieldHidden("thesslstore_admin_first_name", $vars->thesslstore_admin_first_name);
- $this->Form->fieldHidden("thesslstore_admin_last_name", $vars->thesslstore_admin_last_name);
- $this->Form->fieldHidden("thesslstore_admin_title", $vars->thesslstore_admin_title);
- $this->Form->fieldHidden("thesslstore_admin_email", $vars->thesslstore_admin_email);
- $this->Form->fieldHidden("thesslstore_admin_phone", $vars->thesslstore_admin_phone);
- $this->Form->fieldHidden("thesslstore_org_name", $vars->thesslstore_org_name);
- $this->Form->fieldHidden("thesslstore_org_division", $vars->thesslstore_org_division);
- $this->Form->fieldHidden("thesslstore_admin_address1", $vars->thesslstore_admin_address1);
- $this->Form->fieldHidden("thesslstore_admin_address2", $vars->thesslstore_admin_address2);
- $this->Form->fieldHidden("thesslstore_admin_city", $vars->thesslstore_admin_city);
- $this->Form->fieldHidden("thesslstore_admin_state", $vars->thesslstore_admin_state);
- $this->Form->fieldHidden("thesslstore_admin_country", $vars->thesslstore_admin_country);
- $this->Form->fieldHidden("thesslstore_admin_zip", $vars->thesslstore_admin_zip);
- $this->Form->fieldHidden("thesslstore_tech_first_name", $vars->thesslstore_tech_first_name);
- $this->Form->fieldHidden("thesslstore_tech_last_name", $vars->thesslstore_tech_last_name);
- $this->Form->fieldHidden("thesslstore_tech_title", $vars->thesslstore_tech_title);
- $this->Form->fieldHidden("thesslstore_tech_email", $vars->thesslstore_tech_email);
- $this->Form->fieldHidden("thesslstore_tech_phone", $vars->thesslstore_tech_phone);
-
- //Additional SAN
- if(isset($vars->thesslstore_additional_san)){
- foreach($vars->thesslstore_additional_san as $additional_san){
- $this->Form->fieldHidden("thesslstore_additional_san[]", $additional_san);
- }
- }
-
-?>
-
-
- _("ThesslstoreModule.tab_generate_cert.heading_approver_email");?>
- $email_list){
- ?>
-
- Form->label($dm.'*', "for_".$dm);
- $this->Form->fieldSelect("thesslstore_approver_emails[]", $this->Html->ifSet($email_list), $this->Html->ifSet($vars->thesslstore_webserver_type), array('id' => "for_".$dm, 'class'=>"form-control"));
- ?>
-
-
-
-
-
-
-Form->end();
-?>
-
-
-
+Form->create($this->base_uri . "services/manage/" . $this->Html->ifSet($service_id) . "/tabClientGenerateCert/");
+
+ $this->Form->fieldHidden("thesslstore_gen_step", $step);
+ $this->Form->fieldHidden("thesslstore_csr", $vars->thesslstore_csr);
+ $this->Form->fieldHidden("thesslstore_webserver_type", $vars->thesslstore_webserver_type);
+ $this->Form->fieldHidden("thesslstore_signature_algorithm", $vars->thesslstore_signature_algorithm);
+ if($vendor_name == 'DIGICERT'){
+ $this->Form->fieldHidden("thesslstore_org_id", $vars->thesslstore_org_id);
+ }
+ else{
+ $this->Form->fieldHidden("thesslstore_admin_first_name", $vars->thesslstore_admin_first_name);
+ $this->Form->fieldHidden("thesslstore_admin_last_name", $vars->thesslstore_admin_last_name);
+ $this->Form->fieldHidden("thesslstore_admin_title", $vars->thesslstore_admin_title);
+ $this->Form->fieldHidden("thesslstore_admin_email", $vars->thesslstore_admin_email);
+ $this->Form->fieldHidden("thesslstore_admin_phone", $vars->thesslstore_admin_phone);
+ $this->Form->fieldHidden("thesslstore_org_name", $vars->thesslstore_org_name);
+ $this->Form->fieldHidden("thesslstore_org_division", $vars->thesslstore_org_division);
+ $this->Form->fieldHidden("thesslstore_admin_address1", $vars->thesslstore_admin_address1);
+ $this->Form->fieldHidden("thesslstore_admin_address2", $vars->thesslstore_admin_address2);
+ $this->Form->fieldHidden("thesslstore_admin_city", $vars->thesslstore_admin_city);
+ $this->Form->fieldHidden("thesslstore_admin_state", $vars->thesslstore_admin_state);
+ $this->Form->fieldHidden("thesslstore_admin_country", $vars->thesslstore_admin_country);
+ $this->Form->fieldHidden("thesslstore_admin_zip", $vars->thesslstore_admin_zip);
+ $this->Form->fieldHidden("thesslstore_tech_first_name", $vars->thesslstore_tech_first_name);
+ $this->Form->fieldHidden("thesslstore_tech_last_name", $vars->thesslstore_tech_last_name);
+ $this->Form->fieldHidden("thesslstore_tech_title", $vars->thesslstore_tech_title);
+ $this->Form->fieldHidden("thesslstore_tech_email", $vars->thesslstore_tech_email);
+ $this->Form->fieldHidden("thesslstore_tech_phone", $vars->thesslstore_tech_phone);
+ }
+
+ //Additional SAN
+ if(isset($additional_sans)){
+ foreach($additional_sans as $additional_san){
+ $this->Form->fieldHidden("thesslstore_additional_san[]", $additional_san);
+ }
+ }
+
+?>
+
+
+
+ _("ThesslstoreModule.tab_generate_cert.heading_auth_method");?>*
+ 1){ ?>
+
+ $name){
+ $checked = ($value == "HTTP" ? "checked" : "");
+ $this->Form->fieldRadio("ssl_auth_method_all", $value, $checked, array('id' => "auth_all_".$value) );
+ $this->Form->label($name." For All Domains", "auth_all_".$value);
+ }
+ if($vendor_name == 'COMODO' || $vendor_name == 'SECTIGO'){
+ $this->Form->fieldRadio("ssl_auth_method_all", "EMAIL", $checked, array('id' => "auth_all_EMAIL") );
+ $this->Form->label("EMAIL For All Domains", "auth_all_EMAIL");
+ }
+ ?>
+
+
+
+
+
+
+ Form->label($auth_domain.'*', "for_".$auth_domain);
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Form->end();
+?>
+
+
+
diff --git a/views/default/tab_client_generate_cert_step3.pdt b/views/default/tab_client_generate_cert_step3.pdt
index 329f496..4ca71df 100644
--- a/views/default/tab_client_generate_cert_step3.pdt
+++ b/views/default/tab_client_generate_cert_step3.pdt
@@ -1,32 +1,71 @@
_("ThesslstoreModule.tab_generate_cert.heading_step3");?>
-
-
- Your SSL certificate generation process has now been completed and sent to the
- Certificate Authority for validation . You should receive an email from them shortly to approve it .
-
-
-
- For File Based Authentication, Please create a folder structure "/.well-known/pki-validation/" under root directory and create file using following details or download the Authentication file by clicking the "Download Auth File" button and place it in the "/.well-known/pki-validation/" of the HTTP server, like so: http://www.example.com/.well-known/pki-validation/Html->_($auth_file_name); ?> It may take some time for file to be automatically validated and cert to be issued by Certificate Authority.
-
-
- File Name: Html->_($auth_file_name); ?>
-
-
- File Content: Html->_($auth_file_content); ?>
-
-
-
- _("ThesslstoreModule.tab_DownloadAuthFile");?>
-
-
-
+
+ _("ThesslstoreModule.tab_client_cert_details.cert_completed_details"); ?>
+
+
+
+
+ _("ThesslstoreModule.tab_client_cert_details.auth_details"); ?>
+
+
+ $auth_detail){
+ ?>
+
+ Html->_($domain_name); ?>
+ Html->_($auth_detail['method']); ?>
+ Html->_($auth_detail['dcv_status']); ?>
+
+
+
+ File Name:
+ Html->_($auth_detail['file_url']); ?>
+
+
+ File Content:
+
+
+
+
+ Host/Alias:
+ Html->_($auth_detail['alias']); ?>
+
+
+ value:
+ Html->_($auth_detail['point_to']); ?>
+
+
+
+ value:
+ Html->_($auth_detail['point_to']); ?>
+
+
+
+ Email:
+ Html->_($auth_detail['email']); ?>
+
+
+
+
+
+
-
@@ -172,5 +322,4 @@ if ($use_central_api != true ) {
-
+?>
\ No newline at end of file