OpenCart 🇺🇦

Схема

public mixed recurringCancel ( )

Аргументы

Аргумент Возможный тип Описание
У метода нет аргументов

Описание

Метод пока еще не документирован.

Исходный код

//cancel an active profile

$this->load->model('account/recurring');
$this->load->model('payment/pp_express');
$this->language->load('account/recurring');

$profile = $this->model_account_recurring->getProfile($this->request->get['recurring_id']);

if ($profile && !empty($profile['profile_reference'])) {

	$result = $this->model_payment_pp_express->recurringCancel($profile['profile_reference']);

	if (isset($result['PROFILEID'])) {
		$this->db->query("INSERT INTO `" . DB_PREFIX . "order_recurring_transaction` SET `order_recurring_id` = '" . (int)$profile['order_recurring_id'] . "', `created` = NOW(), `type` = '5'");
		$this->db->query("UPDATE `" . DB_PREFIX . "order_recurring` SET `status` = 4 WHERE `order_recurring_id` = '" . (int)$profile['order_recurring_id'] . "' LIMIT 1");

		$this->session->data['success'] = $this->language->get('success_cancelled');
	} else {
		$this->session->data['error'] = sprintf($this->language->get('error_not_cancelled'), $result['L_LONGMESSAGE0']);
	}
} else {
	$this->session->data['error'] = $this->language->get('error_not_found');
}

$this->redirect($this->url->link('account/recurring/info', 'recurring_id=' . $this->request->get['recurring_id'], 'SSL'));