Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Globalpay/Realex ECI message changes #2821

Merged
merged 3 commits into from
Mar 27, 2015
Merged
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
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
1 change: 1 addition & 0 deletions upload/catalog/language/english/payment/globalpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
$_['text_3d_s8'] = 'Authentication Unavailable, no liability shift';
$_['text_3d_s9'] = 'Invalid Response From ACS, no liability shift';
$_['text_3d_s10'] = 'RealMPI Fatal Error, no liability shift';
$_['text_3d_liability'] = 'No Liability Shift';
$_['text_card_visa'] = 'Visa';
$_['text_card_mc'] = 'Mastercard';
$_['text_card_amex'] = 'American Express';
Expand Down
1 change: 1 addition & 0 deletions upload/catalog/language/english/payment/realex.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
$_['text_3d_s8'] = 'Authentication Unavailable, no liability shift';
$_['text_3d_s9'] = 'Invalid Response From ACS, no liability shift';
$_['text_3d_s10'] = 'RealMPI Fatal Error, no liability shift';
$_['text_3d_liability'] = 'No Liability Shift';
$_['text_card_visa'] = 'Visa';
$_['text_card_mc'] = 'Mastercard';
$_['text_card_amex'] = 'American Express';
Expand Down