Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<?php
class ControllerExtensionPaymentDuitkuPop extends Controller {
namespace Opencart\Admin\Controller\Extension\DuitkuPop\Payment;
class DuitkuPop extends \Opencart\System\Engine\Controller {

private $error = array();

public function index() {
$this->load->language('extension/payment/duitku_pop');
public function index(): void {
$this->load->language('extension/duitku_pop/payment/duitku_pop');

$this->load->language('cache/cleaner');
//$this->load->language('cache/cleaner');
$this->document->setTitle($this->language->get('heading_title'));

$this->load->model('setting/setting');
Expand Down Expand Up @@ -81,11 +82,11 @@ public function index() {

$data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('extension/payment/duitku_pop', 'user_token=' . $this->session->data['user_token'], true),
'href' => $this->url->link('extension/duitku_pop/payment/duitku_pop', 'user_token=' . $this->session->data['user_token'], true),
// 'separator' => ' :: '
);

$data['action'] = $this->url->link('extension/payment/duitku_pop', 'user_token=' . $this->session->data['user_token'], true);
$data['action'] = $this->url->link('extension/duitku_pop/payment/duitku_pop', 'user_token=' . $this->session->data['user_token'], true);

$data['cancel'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment', true);

Expand Down Expand Up @@ -132,6 +133,10 @@ public function index() {
$data['header'] = $this->load->controller('common/header');
$data['footer'] = $this->load->controller('common/footer');

$data['save'] = $this->url->link('extension/duitku_pop/payment/duitku_pop' . $this->separator() . 'save', 'user_token=' . $this->session->data['user_token']);
$data['back'] = $this->url->link('marketplace/extension', 'user_token=' . $this->session->data['user_token'] . '&type=payment');



if(!$this->currency->has('IDR'))
{
Expand All @@ -141,13 +146,13 @@ public function index() {
{
$data['curr'] = false;
}
$this->response->setOutput($this->load->view('extension/payment/duitku_pop',$data));
$this->response->setOutput($this->load->view('extension/duitku_pop/payment/duitku_pop',$data));

}

protected function validate() {

if (!$this->user->hasPermission('modify', 'extension/payment/duitku_pop')) {
if (!$this->user->hasPermission('modify', 'extension/duitku_pop/payment/duitku_pop')) {
$this->error['warning'] = $this->language->get('error_permission');
}

Expand All @@ -165,15 +170,28 @@ protected function validate() {
$this->error['merchant_code'] = $this->language->get('error_merchant_code');
}

if (!$this->request->post['payment_duitku_pop_endpoint']) {
$this->error['endpoint'] = $this->language->get('error_endpoint');
}
if (!$this->request->post['payment_duitku_pop_expiry_period'] OR $this->request->post['payment_duitku_pop_expiry_period'] < 0 OR $this->request->post['payment_duitku_pop_expiry_period'] > 1440 ) {
$this->error['expired_period'] = $this->language->get('error_expired_period');
}

// if (!$this->request->post['payment_duitku_pop_endpoint']) {
// $this->error['endpoint'] = $this->language->get('error_endpoint');
// }

if (!$this->error) {
return true;
} else {
return false;
}
}

private function separator():string
{
if (VERSION >= '4.0.2.0') {
return '.';
}

return '|';
}
}
?>
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?php
// Heading
$_['heading_title'] = 'Duitku Payment';
$_['heading_title'] = 'Duitku Payment POP';

// Text
$_['text_payment'] = 'Payment';
$_['text_success'] = 'Success: You have modified Duitku account details!';
$_['text_duitku_pop'] = '<img src="view/image/payment/duitku_thumb.png" width="auto" height = "25" alt="Duitku Payment" title="Duitku" />';
$_['text_duitku_pop'] = '<img src="../extension/duitku_pop/admin/view/image/payment/duitku_thumb.png" width="auto" height = "25" alt="Duitku Payment" title="Duitku" />';
$_['text_live'] = 'Production';
$_['text_successful'] = 'Always Successful';
$_['text_fail'] = 'Always Fail';
$_['text_edit'] = 'Configure Duitku Payment Gateway';

$_['entry_plugin_status'] = 'Plugin Status';
$_['entry_plugin_status'] = 'Environment';
$_['entry_endpoint'] = 'URL Endpoint';
$_['entry_merchant'] = 'Merchant Code';
$_['entry_api_key'] = 'Merchant API Key';
Expand All @@ -35,6 +35,7 @@
$_['redirect_mode'] = 'Redirect';

// Error
$_['error_expired_period'] = 'Expired Period is required! 1 - 1440 ( minute )';
$_['error_permission'] = 'Warning: You do not have permission to modify the Duitku Payment!';
$_['error_merchant_code'] = 'Merchant Code is required!';
$_['error_api_key'] = 'API Key is required!';
Expand Down
171 changes: 0 additions & 171 deletions admin/view/template/extension/payment/duitku_pop.twig

This file was deleted.

Loading