Skip to content

Commit

Permalink
More status prefixes work
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCartpenter committed May 19, 2024
1 parent 6770201 commit 2f82764
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 57 deletions.
34 changes: 17 additions & 17 deletions upload/admin/controller/extension/payment/securetrading_pp.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,28 +99,28 @@ public function index(): void {
$data['payment_securetrading_pp_order_status_id'] = 1;
}

if (isset($this->request->post['payment_securetrading_pp_declined_order_status_id'])) {
$data['payment_securetrading_pp_declined_order_status_id'] = (int)$this->request->post['payment_securetrading_pp_declined_order_status_id'];
} elseif ($this->config->get('payment_securetrading_pp_declined_order_status_id') != '') {
$data['payment_securetrading_pp_declined_order_status_id'] = (int)$this->config->get('payment_securetrading_pp_declined_order_status_id');
if (isset($this->request->post['payment_securetrading_pp_declined_status_id'])) {
$data['payment_securetrading_pp_declined_status_id'] = (int)$this->request->post['payment_securetrading_pp_declined_status_id'];
} elseif ($this->config->get('payment_securetrading_pp_declined_status_id') != '') {
$data['payment_securetrading_pp_declined_status_id'] = (int)$this->config->get('payment_securetrading_pp_declined_status_id');
} else {
$data['payment_securetrading_pp_declined_order_status_id'] = 8;
$data['payment_securetrading_pp_declined_status_id'] = 8;
}

if (isset($this->request->post['payment_securetrading_pp_refunded_order_status_id'])) {
$data['payment_securetrading_pp_refunded_order_status_id'] = (int)$this->request->post['payment_securetrading_pp_refunded_order_status_id'];
} elseif ($this->config->get('payment_securetrading_pp_refunded_order_status_id') != '') {
$data['payment_securetrading_pp_refunded_order_status_id'] = (int)$this->config->get('payment_securetrading_pp_refunded_order_status_id');
if (isset($this->request->post['payment_securetrading_pp_refunded_status_id'])) {
$data['payment_securetrading_pp_refunded_status_id'] = (int)$this->request->post['payment_securetrading_pp_refunded_status_id'];
} elseif ($this->config->get('payment_securetrading_pp_refunded_status_id') != '') {
$data['payment_securetrading_pp_refunded_status_id'] = (int)$this->config->get('payment_securetrading_pp_refunded_status_id');
} else {
$data['payment_securetrading_pp_refunded_order_status_id'] = 11;
$data['payment_securetrading_pp_refunded_status_id'] = 11;
}

if (isset($this->request->post['payment_securetrading_pp_authorisation_reversed_order_status_id'])) {
$data['payment_securetrading_pp_authorisation_reversed_order_status_id'] = (int)$this->request->post['payment_securetrading_pp_authorisation_reversed_order_status_id'];
} elseif ($this->config->get('payment_securetrading_pp_authorisation_reversed_order_status_id') != '') {
$data['payment_securetrading_pp_authorisation_reversed_order_status_id'] = (int)$this->config->get('payment_securetrading_pp_authorisation_reversed_order_status_id');
if (isset($this->request->post['payment_securetrading_pp_authorisation_reversed_status_id'])) {
$data['payment_securetrading_pp_authorisation_reversed_status_id'] = (int)$this->request->post['payment_securetrading_pp_authorisation_reversed_status_id'];
} elseif ($this->config->get('payment_securetrading_pp_authorisation_reversed_status_id') != '') {
$data['payment_securetrading_pp_authorisation_reversed_status_id'] = (int)$this->config->get('payment_securetrading_pp_authorisation_reversed_status_id');
} else {
$data['payment_securetrading_pp_authorisation_reversed_order_status_id'] = 12;
$data['payment_securetrading_pp_authorisation_reversed_status_id'] = 12;
}

if (isset($this->request->post['payment_securetrading_pp_settle_status'])) {
Expand Down Expand Up @@ -368,7 +368,7 @@ public function void(): void {
$json['created'] = date('Y-m-d H:i:s');

$json['order_id'] = (int)$this->request->post['order_id'];
$json['order_status_id'] = (int)$this->config->get('payment_securetrading_pp_authorisation_reversed_order_status_id');
$json['order_status_id'] = (int)$this->config->get('payment_securetrading_pp_authorisation_reversed_status_id');

$json['error'] = false;
}
Expand Down Expand Up @@ -503,7 +503,7 @@ public function rebate(): void {
$json['msg'] = $this->language->get('text_rebate_ok_order');

$json['order_id'] = (int)$this->request->post['order_id'];
$json['order_status_id'] = (int)$this->config->get('payment_securetrading_pp_refunded_order_status_id');
$json['order_status_id'] = (int)$this->config->get('payment_securetrading_pp_refunded_status_id');
} else {
$rebate_status = 0;

Expand Down
44 changes: 22 additions & 22 deletions upload/admin/controller/extension/payment/securetrading_ws.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,36 +97,36 @@ public function index(): void {
$data['payment_securetrading_ws_order_status_id'] = 1;
}

if (isset($this->request->post['payment_securetrading_ws_failed_order_status_id'])) {
$data['payment_securetrading_ws_failed_id'] = (int)$this->request->post['payment_securetrading_ws_failed_order_status_id'];
} elseif ($this->config->get('payment_securetrading_ws_failed_order_status_id') != '') {
$data['payment_securetrading_ws_failed_id'] = (int)$this->config->get('payment_securetrading_ws_failed_order_status_id');
if (isset($this->request->post['payment_securetrading_ws_failed_status_id'])) {
$data['payment_securetrading_ws_failed_id'] = (int)$this->request->post['payment_securetrading_ws_failed_status_id'];
} elseif ($this->config->get('payment_securetrading_ws_failed_status_id') != '') {
$data['payment_securetrading_ws_failed_id'] = (int)$this->config->get('payment_securetrading_ws_failed_status_id');
} else {
$data['payment_securetrading_ws_failed_order_status_id'] = 10;
$data['payment_securetrading_ws_failed_status_id'] = 10;
}

if (isset($this->request->post['payment_securetrading_ws_declined_order_status_id'])) {
$data['payment_securetrading_ws_declined_id'] = (int)$this->request->post['payment_securetrading_ws_declined_order_status_id'];
} elseif ($this->config->get('payment_securetrading_ws_declined_order_status_id') != '') {
$data['payment_securetrading_ws_declined_id'] = (int)$this->config->get('payment_securetrading_ws_declined_order_status_id');
if (isset($this->request->post['payment_securetrading_ws_declined_status_id'])) {
$data['payment_securetrading_ws_declined_id'] = (int)$this->request->post['payment_securetrading_ws_declined_status_id'];
} elseif ($this->config->get('payment_securetrading_ws_declined_status_id') != '') {
$data['payment_securetrading_ws_declined_id'] = (int)$this->config->get('payment_securetrading_ws_declined_status_id');
} else {
$data['payment_securetrading_ws_declined_order_status_id'] = 8;
$data['payment_securetrading_ws_declined_status_id'] = 8;
}

if (isset($this->request->post['payment_securetrading_ws_refunded_order_status_id'])) {
$data['payment_securetrading_ws_refunded_id'] = (int)$this->request->post['payment_securetrading_ws_refunded_order_status_id'];
} elseif ($this->config->get('payment_securetrading_ws_refunded_order_status_id') != '') {
$data['payment_securetrading_ws_refunded_id'] = (int)$this->config->get('payment_securetrading_ws_refunded_order_status_id');
if (isset($this->request->post['payment_securetrading_ws_refunded_status_id'])) {
$data['payment_securetrading_ws_refunded_id'] = (int)$this->request->post['payment_securetrading_ws_refunded_status_id'];
} elseif ($this->config->get('payment_securetrading_ws_refunded_status_id') != '') {
$data['payment_securetrading_ws_refunded_id'] = (int)$this->config->get('payment_securetrading_ws_refunded_status_id');
} else {
$data['payment_securetrading_ws_refunded_order_status_id'] = 11;
$data['payment_securetrading_ws_refunded_status_id'] = 11;
}

if (isset($this->request->post['payment_securetrading_ws_authorisation_reversed_order_status_id'])) {
$data['payment_securetrading_ws_authorisation_reversed_id'] = (int)$this->request->post['payment_securetrading_ws_authorisation_reversed_order_status_id'];
} elseif ($this->config->get('payment_securetrading_ws_authorisation_reversed_order_status_id') != '') {
$data['payment_securetrading_ws_authorisation_reversed_id'] = (int)$this->config->get('payment_securetrading_ws_authorisation_reversed_order_status_id');
if (isset($this->request->post['payment_securetrading_ws_authorisation_reversed_status_id'])) {
$data['payment_securetrading_ws_authorisation_reversed_id'] = (int)$this->request->post['payment_securetrading_ws_authorisation_reversed_status_id'];
} elseif ($this->config->get('payment_securetrading_ws_authorisation_reversed_status_id') != '') {
$data['payment_securetrading_ws_authorisation_reversed_id'] = (int)$this->config->get('payment_securetrading_ws_authorisation_reversed_status_id');
} else {
$data['payment_securetrading_ws_authorisation_reversed_order_status_id'] = 12;
$data['payment_securetrading_ws_authorisation_reversed_status_id'] = 12;
}

if (isset($this->request->post['payment_securetrading_ws_settle_status'])) {
Expand Down Expand Up @@ -460,7 +460,7 @@ public function void(): void {
$json['data']['created'] = date('Y-m-d H:i:s');

$json['order_id'] = (int)$this->request->post['order_id'];
$json['order_status_id'] = (int)$this->config->get('payment_securetrading_ws_authorisation_reversed_order_status_id');
$json['order_status_id'] = (int)$this->config->get('payment_securetrading_ws_authorisation_reversed_status_id');

$json['error'] = false;
}
Expand Down Expand Up @@ -593,7 +593,7 @@ public function rebate(): void {
$json['msg'] = $this->language->get('text_rebate_ok_order');

$json['order_id'] = (int)$this->request->post['order_id'];
$json['order_status_id'] = $this->config->get('payment_securetrading_ws_refunded_order_status_id');
$json['order_status_id'] = $this->config->get('payment_securetrading_ws_refunded_status_id');
} else {
$rebate_status = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@
<div class="form-group">
<label class="col-sm-2 control-label" for="securetrading-pp-declined-order-status-id">{{ entry_declined_order_status }}</label>
<div class="col-sm-10">
<select name="payment_securetrading_pp_declined_order_status_id" class="form-control" id="securetrading-pp-declined-order-status-id"/>
<select name="payment_securetrading_pp_declined_status_id" class="form-control" id="securetrading-pp-declined-order-status-id"/>
{% for order_status in order_statuses %}
{% if order_status.order_status_id == payment_securetrading_pp_declined_order_status_id %}
{% if order_status.order_status_id == payment_securetrading_pp_declined_status_id %}
<option value="{{ order_status.order_status_id }}" selected="selected">{{ order_status.name }}</option>
{% else %}
<option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>
Expand All @@ -187,9 +187,9 @@
<div class="form-group">
<label class="col-sm-2 control-label" for="securetrading-pp-refunded-order-status-id">{{ entry_refunded_order_status }}</label>
<div class="col-sm-10">
<select name="payment_securetrading_pp_refunded_order_status_id" class="form-control" id="securetrading-pp-refunded-order-status-id"/>
<select name="payment_securetrading_pp_refunded_status_id" class="form-control" id="securetrading-pp-refunded-order-status-id"/>
{% for order_status in order_statuses %}
{% if order_status.order_status_id == payment_securetrading_pp_refunded_order_status_id %}
{% if order_status.order_status_id == payment_securetrading_pp_refunded_status_id %}
<option value="{{ order_status.order_status_id }}" selected="selected">{{ order_status.name }}</option>
{% else %}
<option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>
Expand All @@ -201,9 +201,9 @@
<div class="form-group">
<label class="col-sm-2 control-label" for="securetrading-pp-authorisation-reversed-order-status-id">{{ entry_authorisation_reversed_order_status }}</label>
<div class="col-sm-10">
<select name="payment_securetrading_pp_authorisation_reversed_order_status_id" class="form-control" id="securetrading-pp-authorisation-reversed-order-status-id"/>
<select name="payment_securetrading_pp_authorisation_reversed_status_id" class="form-control" id="securetrading-pp-authorisation-reversed-order-status-id"/>
{% for order_status in order_statuses %}
{% if order_status.order_status_id == payment_securetrading_pp_authorisation_reversed_order_status_id %}
{% if order_status.order_status_id == payment_securetrading_pp_authorisation_reversed_status_id %}
<option value="{{ order_status.order_status_id }}" selected="selected">{{ order_status.name }}</option>
{% else %}
<option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@
<div class="form-group">
<label class="col-sm-2 control-label" for="securetrading-ws-failed-order-status-id">{{ entry_failed_order_status }}</label>
<div class="col-sm-10">
<select name="payment_securetrading_ws_failed_order_status_id" class="form-control" id="securetrading-ws-failed-order-status-id"/>
<select name="payment_securetrading_ws_failed_status_id" class="form-control" id="securetrading-ws-failed-order-status-id"/>
{% for order_status in order_statuses %}
{% if order_status.order_status_id == payment_securetrading_ws_failed_order_status_id %}
{% if order_status.order_status_id == payment_securetrading_ws_failed_status_id %}
<option value="{{ order_status.order_status_id }}" selected="selected">{{ order_status.name }}</option>
{% else %}
<option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>
Expand All @@ -152,9 +152,9 @@
<div class="form-group">
<label class="col-sm-2 control-label" for="securetrading-ws-declined-order-status-id">{{ entry_declined_order_status }}</label>
<div class="col-sm-10">
<select name="payment_securetrading_ws_declined_order_status_id" class="form-control" id="securetrading-ws-declined-order-status-id"/>
<select name="payment_securetrading_ws_declined_status_id" class="form-control" id="securetrading-ws-declined-order-status-id"/>
{% for order_status in order_statuses %}
{% if order_status.order_status_id == payment_securetrading_ws_declined_order_status_id %}
{% if order_status.order_status_id == payment_securetrading_ws_declined_status_id %}
<option value="{{ order_status.order_status_id }}" selected="selected">{{ order_status.name }}</option>
{% else %}
<option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>
Expand All @@ -166,9 +166,9 @@
<div class="form-group">
<label class="col-sm-2 control-label" for="securetrading-ws-refunded-order-status-id">{{ entry_refunded_order_status }}</label>
<div class="col-sm-10">
<select name="payment_securetrading_ws_refunded_order_status_id" class="form-control" id="securetrading-ws-refunded-order-status-id"/>
<select name="payment_securetrading_ws_refunded_status_id" class="form-control" id="securetrading-ws-refunded-order-status-id"/>
{% for order_status in order_statuses %}
{% if order_status.order_status_id == payment_securetrading_ws_refunded_order_status_id %}
{% if order_status.order_status_id == payment_securetrading_ws_refunded_status_id %}
<option value="{{ order_status.order_status_id }}" selected="selected">{{ order_status.name }}</option>
{% else %}
<option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>
Expand All @@ -180,9 +180,9 @@
<div class="form-group">
<label class="col-sm-2 control-label" for="securetrading-ws-authorisation-reversed-order-status-id">{{ entry_authorisation_reversed_order_status }}</label>
<div class="col-sm-10">
<select name="payment_securetrading_ws_authorisation_reversed_order_status_id" class="form-control" id="securetrading-ws-authorisation-reversed-order-status-id"/>
<select name="payment_securetrading_ws_authorisation_reversed_status_id" class="form-control" id="securetrading-ws-authorisation-reversed-order-status-id"/>
{% for order_status in order_statuses %}
{% if order_status.order_status_id == payment_securetrading_ws_authorisation_reversed_order_status_id %}
{% if order_status.order_status_id == payment_securetrading_ws_authorisation_reversed_status_id %}
<option value="{{ order_status.order_status_id }}" selected="selected">{{ order_status.name }}</option>
{% else %}
<option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function ipn(): void {
$this->model_extension_payment_securetrading_pp->confirmOrder($order_info['order_id'], $order_status_id);
$this->model_extension_payment_securetrading_pp->updateOrder($order_info['order_id'], $order_status_id, $message);
} elseif ($this->request->post['errorcode'] == '70000') {
$order_status_id = (int)$this->config->get('payment_securetrading_pp_declined_order_status_id');
$order_status_id = (int)$this->config->get('payment_securetrading_pp_declined_status_id');

$this->model_extension_payment_securetrading_pp->updateOrder($order_info['order_id'], $order_status_id, $message);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public function threedreturn(): void {

$this->response->redirect($this->url->link('checkout/success', '', true));
} else {
$this->model_extension_payment_securetrading_ws->updateOrder($order_id, $this->config->get('payment_securetrading_ws_declined_order_status_id'));
$this->model_extension_payment_securetrading_ws->updateOrder($order_id, $this->config->get('payment_securetrading_ws_declined_status_id'));

$this->session->data['error'] = $this->language->get('text_transaction_declined');

Expand Down Expand Up @@ -385,14 +385,14 @@ private function processAuthResponse(string $response, int $order_id): array {

$json['status'] = 1;
} else {
$this->model_extension_payment_securetrading_ws->updateOrder($order_id, $this->config->get('payment_securetrading_ws_declined_order_status_id'));
$this->model_extension_payment_securetrading_ws->updateOrder($order_id, $this->config->get('payment_securetrading_ws_declined_status_id'));

$json['message'] = $this->language->get('text_transaction_declined');

$json['status'] = 0;
}
} else {
$this->model_extension_payment_securetrading_ws->updateOrder($order_id, $this->config->get('payment_securetrading_ws_failed_order_status_id'));
$this->model_extension_payment_securetrading_ws->updateOrder($order_id, $this->config->get('payment_securetrading_ws_failed_status_id'));

$json['message'] = $this->language->get('text_transaction_failed');

Expand Down

0 comments on commit 2f82764

Please sign in to comment.