Skip to content

Commit

Permalink
Adds some features from #7
Browse files Browse the repository at this point in the history
  • Loading branch information
jaimehgb committed Jul 27, 2017
1 parent 3adde1a commit 11711d7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion upload/catalog/controller/payment/mycelium.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,19 @@ public function callback() {
$amount_btc = $this->request->get['amount_in_btc'];
$amount_btc_paid = $this->request->get['amount_paid_in_btc'];
$address = $this->request->get['address'];
$txids = json_decode($this->request->get['transaction_ids']);
$callback_data = $this->request->get['callback_data'];
$callback_data = explode('/', $callback_data);

$opencart_order_id = str_replace('opencart_order_id_', '', $callback_data[0]);
$keychain_id = str_replace('mycelium_keychain_id_', '', $callback_data[1]);

$comment[] = "Amount in BTC: " . $amount_btc;
$comment[] = "Amount paid in BTC: " . $amount_btc_paid;
$comment[] = "Payment Address: " . $address;
$comment[] = "Exchange Rate: " . ($amount / $amount_btc);
$comment[] = 'Txids: ' . implode(', ', $txids);
$comment = implode('<br/>', $comment);

switch ($status) {
case '1':
Expand Down Expand Up @@ -292,6 +299,6 @@ public function callback() {
}

// Progress the order status
$this->model_checkout_order->addOrderHistory($opencart_order_id, $order_status_id);
$this->model_checkout_order->addOrderHistory($opencart_order_id, $order_status_id, $comment);
}
}

0 comments on commit 11711d7

Please sign in to comment.