Skip to content

Commit

Permalink
3d Secure message fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
David Teal committed Mar 27, 2015
1 parent 3b2961d commit 3b1c653
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 8 deletions.
33 changes: 29 additions & 4 deletions upload/catalog/controller/payment/globalpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,37 @@ public function notify() {
$message .= '<br /><strong>' . $this->language->get('text_avs_address') . ':</strong> ' . $this->request->post['AVSADDRESSRESULT'];
}

if (isset($this->request->post['ECI']) && !empty($this->request->post['ECI'])) {
if ($this->request->post['ECI'] == 6 && (!isset($this->request->post['CAVV']) || empty($this->request->post['CAVV'])) && (!isset($this->request->post['XID']) || empty($this->request->post['CAVV']))) {
$this->request->post['ECI'] = 1;
//3D Secure message
if (isset($this->request->post['ECI']) && isset($this->request->post['CAVV']) && isset($this->request->post['XID'])) {
$eci = $this->request->post['ECI'];

if (($this->request->post['ECI'] == 6 || $this->request->post['ECI'] == 1) && empty($this->request->post['CAVV']) && empty($this->request->post['XID'])) {
$scenario_id = 1;
}

$message .= '<br /><strong>' . $this->language->get('text_eci') . ':</strong> (' . $this->request->post['ECI'] . ') ' . $this->language->get('text_3d_s' . $this->request->post['ECI']);
if (($this->request->post['ECI'] == 5 || $this->request->post['ECI'] == 0) && !empty($this->request->post['CAVV']) && !empty($this->request->post['XID'])) {
$scenario_id = 5;
}

if (($this->request->post['ECI'] == 6 || $this->request->post['ECI'] == 1) && !empty($this->request->post['CAVV']) && !empty($this->request->post['XID'])) {
$scenario_id = 6;
}

if (isset($scenario_id)) {
$scenario_message = $this->language->get('text_3d_s' . $scenario_id);
} else {
if (isset($this->request->post['CARDTYPE'])) {
if ($this->request->post['CARDTYPE'] == 'VISA') {
$eci = 7;
} else {
$eci = 2;
}
}

$scenario_message = $this->language->get('text_3d_liability');
}

$message .= '<br /><strong>' . $this->language->get('text_eci') . ':</strong> (' . $eci . ') ' . $scenario_message;
}

if ($tss == 1 && isset($this->request->post['TSS'])) {
Expand Down
33 changes: 29 additions & 4 deletions upload/catalog/controller/payment/realex.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,37 @@ public function notify() {
$message .= '<br /><strong>' . $this->language->get('text_avs_address') . ':</strong> ' . $this->request->post['AVSADDRESSRESULT'];
}

if (isset($this->request->post['ECI']) && !empty($this->request->post['ECI'])) {
if ($this->request->post['ECI'] == 6 && (!isset($this->request->post['CAVV']) || empty($this->request->post['CAVV'])) && (!isset($this->request->post['XID']) || empty($this->request->post['CAVV']))) {
$this->request->post['ECI'] = 1;
//3D Secure message
if (isset($this->request->post['ECI']) && isset($this->request->post['CAVV']) && isset($this->request->post['XID'])) {
$eci = $this->request->post['ECI'];

if (($this->request->post['ECI'] == 6 || $this->request->post['ECI'] == 1) && empty($this->request->post['CAVV']) && empty($this->request->post['XID'])) {
$scenario_id = 1;
}

$message .= '<br /><strong>' . $this->language->get('text_eci') . ':</strong> (' . $this->request->post['ECI'] . ') ' . $this->language->get('text_3d_s' . $this->request->post['ECI']);
if (($this->request->post['ECI'] == 5 || $this->request->post['ECI'] == 0) && !empty($this->request->post['CAVV']) && !empty($this->request->post['XID'])) {
$scenario_id = 5;
}

if (($this->request->post['ECI'] == 6 || $this->request->post['ECI'] == 1) && !empty($this->request->post['CAVV']) && !empty($this->request->post['XID'])) {
$scenario_id = 6;
}

if (isset($scenario_id)) {
$scenario_message = $this->language->get('text_3d_s' . $scenario_id);
} else {
if (isset($this->request->post['CARDTYPE'])) {
if ($this->request->post['CARDTYPE'] == 'VISA') {
$eci = 7;
} else {
$eci = 2;
}
}

$scenario_message = $this->language->get('text_3d_liability');
}

$message .= '<br /><strong>' . $this->language->get('text_eci') . ':</strong> (' . $eci . ') ' . $scenario_message;
}

if ($tss == 1 && isset($this->request->post['TSS'])) {
Expand Down

0 comments on commit 3b1c653

Please sign in to comment.