Схема
protected mixed
validate (
)
Аргументы
| Аргумент |
Возможный тип |
Описание |
|
У метода нет аргументов
|
Описание
Метод пока еще не документирован.
Исходный код
$this->load->model('localisation/currency');
if (!$this->user->hasPermission('modify', 'payment/amazon_checkout')) {
$this->errors[] = $this->language->get('error_permission');
}
if (empty($this->request->post['amazon_checkout_merchant_id'])) {
$this->errors[] = $this->language->get('error_empty_merchant_id');
}
if (empty($this->request->post['amazon_checkout_access_key'])) {
$this->errors[] = $this->language->get('error_empty_access_key');
}
if (empty($this->request->post['amazon_checkout_access_secret'])) {
$this->errors[] = $this->language->get('error_empty_access_secret');
}
switch ($this->request->post['amazon_checkout_marketplace']) {
case 'uk':
$currency_code = 'GBP';
break;
case 'de':
$currency_code = 'EUR';
break;
}
$currency = $this->model_localisation_currency->getCurrency($this->currency->getId($currency_code));
if (empty($currency) || $currency['status'] != '1') {
$this->errors[] = sprintf($this->language->get('error_curreny'), $currency_code);
}
return empty($this->errors);