Skip to content

Commit

Permalink
Update monero.php
Browse files Browse the repository at this point in the history
  • Loading branch information
serhack authored Mar 28, 2018
1 parent 7046b5f commit 4bcdc43
Showing 1 changed file with 12 additions and 51 deletions.
63 changes: 12 additions & 51 deletions catalog/model/extension/payment/monero.php
Original file line number Diff line number Diff line change
@@ -1,56 +1,17 @@
<?php

class ModelExtensionPaymentMonero extends Model {

public function getMethod($address, $total){
$this->language->load('extension/payment/monero');

public function getMethod($address) {


$method_data = array(
'code' => 'monero',
'title' => 'Monero Payment Gateway',
'sort_order' => '',
'terms' => 'by Monero Integrations Team'
);



if ($total > 0){
$status = true;
} else {
$status = false;
}

$method_data = array();

if ($status){
$method_data = array(
'code' => 'Monero',
'title' => $this->language->get('text_title'),
'sort_order' => $this->config->get('monero_sort_order')
);
}

return $method_data;
}

public function addMoneroOrder($order_id, $payment_id){
$query = NULL;
$sql_q = "";
$sql_q = "INSERT INTO `" . DB_PREFIX . "order_monero` (`order_id`, `payment_id`)";
$sql_q .= " VALUES (" . (int)$order_id . ", '" . $payment_id . "')";
$this->db->query($sql_q);
return true;
}

public function getMoneroPaymentId($order_id){
$query = NULL;
$sql_q = "";
$sql_q = "SELECT `payment_id` FROM `" . DB_PREFIX . "order_monero` WHERE";
$sql_q .= " `order_id` = " . (int)$order_id;
$query = $this->db->query($sql_q)->rows;
$payment_id = '';
if (count($query) == 1){
$status = true;
foreach ($query as $result){
$payment_id = $result['payment_id'];
}
}
return $payment_id;
}

return $method_data;
}
}

?>

0 comments on commit 4bcdc43

Please sign in to comment.