Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion thesslstore_module.php
Original file line number Diff line number Diff line change
Expand Up @@ -1865,6 +1865,19 @@ public function renewService($package, $service, $parent_package=null, $parent_s

$order_status_response = $this->getSSLOrderStatus($old_thesslstore_order_id);

if($order_status_response->OrderStatus->MajorStatus != 'Active') {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the renewService addition does not seem to work as it should

$this->log("RenewService Cron | $old_thesslstore_order_id", serialize($order_status_response), "output", false);
$this->Input->setErrors(array('api' => array('internal' => 'Previous certificate was not activated')));
return;
}
else if (empty($order_status_response->CertificateEndDateInUTC)) {
// if not active it might not be EV
// Check end date
$this->log("RenewService Cron | $old_thesslstore_order_id", serialize($order_status_response), "output", false);
$this->Input->setErrors(array('api' => array('internal' => 'Previous certificate was not activated')));
return;
}

//Placed Invite order first
$api = $this->getApi();

Expand Down Expand Up @@ -2121,7 +2134,17 @@ public function cancelService($package, $service, $parent_package=null, $parent_

$this->log($this->api_partner_code . "|ssl-refund-request", serialize($refundReq), "input", true);
$refundRes = $api->order_refundrequest($refundReq);
if(!$refundRes->AuthResponse->Message[0])

$max_to_refund_date = date('Y-m-d',strtotime('+30 days',strtotime($refundRes->PurchaseDate)));
$current_day = date('Y-m-d');

// if we past the return window ignore errors
// so blesta correctly marks this services cancelled
if ($current_day > $max_to_refund_date) {
return;
}

if(!isset($refundRes->AuthResponse->Message[0]))
{
$errorMessage=$refundRes->AuthResponse->Message;
}
Expand Down