Skip to content

Commit

Permalink
Merge pull request #56 from CoinPaymentsNet/INT-337_nastya_opencart_2…
Browse files Browse the repository at this point in the history
….0-2.2

Fixing bugs with link
  • Loading branch information
letscode-u authored Mar 29, 2021
2 parents 2eda402 + 359a884 commit 8d6c796
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions upload/catalog/model/payment/coinpayments.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ public function createInvoice($order_info)
$currency_code = $order_info['currency_code'];
$coin_currency = $this->coinpayments->getCoinCurrency($currency_code);

$amount = number_format($order_info['total'], $coin_currency['decimalPlaces'], '', '');;
$amount = number_format($order_info['total'], $coin_currency['decimalPlaces'], '', '');
$display_value = $order_info['total'];

$hostname = $this->coinpayments->getShopHostname();
$admin_catalog = 'admin/';
$url = new Url((defined('HTTP_CATALOG') ? HTTP_CATALOG : HTTP_SERVER) . $admin_catalog, $hostname . $admin_catalog);

$invoice_params = array(
'invoice_id' => $invoice_id,
'currency_id' => $coin_currency['id'],
Expand All @@ -69,7 +73,7 @@ public function createInvoice($order_info)
'billing_data' => $order_info,
'notes_link' => sprintf(
"%s|Store name: %s|Order #%s",
html_entity_decode($this->url->link('sale/order/info', 'user_token=' . $this->session->data['user_token'] . '&order_id=' . $order_info['order_id'], true)),
html_entity_decode($url->link('sale/order/info', 'order_id=' . $order_info['order_id'], true)),
$this->config->get('config_name'),
$order_info['order_id']),
);
Expand Down
6 changes: 3 additions & 3 deletions upload/system/library/coinpayments.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ public function createWebHook($client_id, $client_secret, $event)
/**
* @return string
*/
protected function getShopHostname(){
public function getShopHostname(){

if (defined('HTTP_CATALOG')) {
$hostname = $this->config->get('config_secure') ? HTTP_CATALOG : HTTPS_CATALOG;
$hostname = $this->config->get('config_secure') ? HTTPS_CATALOG : HTTP_CATALOG;
} else {
$hostname = $this->config->get('config_secure') ? HTTP_SERVER : HTTPS_SERVER;
$hostname = $this->config->get('config_secure') ? HTTPS_SERVER : HTTP_SERVER;
}
return $hostname;
}
Expand Down

0 comments on commit 8d6c796

Please sign in to comment.