Skip to content

Commit

Permalink
Bug fixes First Data:
Browse files Browse the repository at this point in the history
- installation bug (standard and remote)
- email parameter sent in payment form (standard)
  • Loading branch information
chris-wm committed May 6, 2015
1 parent 0cc21e9 commit 2accd5e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 1 deletion.
10 changes: 10 additions & 0 deletions upload/admin/controller/payment/firstdata.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,16 @@ public function index() {
$this->response->setOutput($this->load->view('payment/firstdata.tpl', $data));
}

public function install() {
$this->load->model('payment/firstdata');
$this->model_payment_firstdata->install();
}

public function uninstall() {
$this->load->model('payment/firstdata');
$this->model_payment_firstdata->uninstall();
}

public function action() {
if ($this->config->get('firstdata_status')) {
$this->load->model('payment/firstdata');
Expand Down
10 changes: 10 additions & 0 deletions upload/admin/controller/payment/firstdata_remote.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,16 @@ public function index() {
$this->response->setOutput($this->load->view('payment/firstdata_remote.tpl', $data));
}

public function install() {
$this->load->model('payment/firstdata_remote');
$this->model_payment_firstdata_remote->install();
}

public function uninstall() {
$this->load->model('payment/firstdata_remote');
$this->model_payment_firstdata_remote->uninstall();
}

public function action() {
if ($this->config->get('firstdata_remote_status')) {
$this->load->model('payment/firstdata_remote');
Expand Down
7 changes: 7 additions & 0 deletions upload/admin/model/payment/firstdata.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public function install() {
`order_ref_previous` CHAR(50) NOT NULL,
`pasref` VARCHAR(50) NOT NULL,
`pasref_previous` VARCHAR(50) NOT NULL,
`tdate` DATETIME NOT NULL,
`date_added` DATETIME NOT NULL,
`date_modified` DATETIME NOT NULL,
`capture_status` INT(1) DEFAULT NULL,
Expand Down Expand Up @@ -43,6 +44,12 @@ public function install() {
) ENGINE=MyISAM DEFAULT COLLATE=utf8_general_ci;");
}

public function uninstall() {
$this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "firstdata_order`;");
$this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "firstdata_order_transaction`;");
$this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "firstdata_card`;");
}

public function void($order_id) {
$firstdata_order = $this->getOrder($order_id);

Expand Down
6 changes: 6 additions & 0 deletions upload/admin/model/payment/firstdata_remote.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ public function install() {
) ENGINE=MyISAM DEFAULT COLLATE=utf8_general_ci;");
}

public function uninstall() {
$this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "firstdata_remote_order`;");
$this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "firstdata_remote_order_transaction`;");
$this->db->query("DROP TABLE IF EXISTS `" . DB_PREFIX . "firstdata_remote_card`;");
}

public function call($xml) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://test.ipg-online.com/ipgapi/services");
Expand Down
3 changes: 2 additions & 1 deletion upload/catalog/controller/payment/firstdata.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public function index() {
$data['bstate'] = substr($order_info['payment_zone'], 0, 30);
$data['bcountry'] = $order_info['payment_iso_code_2'];
$data['bzip'] = $order_info['payment_postcode'];
$data['email'] = $order_info['email'];

if ($this->cart->hasShipping()) {
$data['sname'] = $order_info['shipping_firstname'] . ' ' . $order_info['shipping_lastname'];
Expand Down Expand Up @@ -107,7 +108,7 @@ public function notify() {
if ($local_hash == $this->request->post['notification_hash']) {
$order_id_parts = explode('T', $this->request->post['oid']);

$order_id = (int)$order_id_parts[0];
$order_id = str_replace("CON-","",$order_id_parts[0]);

$order_info = $this->model_checkout_order->getOrder($order_id);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<input type="hidden" name="bstate" value="<?php echo $bstate; ?>" />
<input type="hidden" name="bcountry" value="<?php echo $bcountry; ?>" />
<input type="hidden" name="bzip" value="<?php echo $bzip; ?>" />
<input type="hidden" name="email" value="<?php echo $email; ?>" />
<input type="hidden" name="invoicenumber" value="<?php echo $version; ?>" />

<?php if ($card_storage == 1) { ?>
Expand Down

0 comments on commit 2accd5e

Please sign in to comment.