I've made a custom payment method for a bitcoin payment by renaming the Bank_Transfer option.
At the moment it displays the link correctly, but it's not a clickable URL. Also is it possible to convert this to a QR code to display as well?
Code: Select all
<?php
class ControllerExtensionPaymentSatoshi extends Controller {
public function index() {
$this->load->language('extension/payment/satoshi');
$data['text_instruction'] = $this->language->get('text_instruction');
$data['text_description'] = $this->language->get('text_description');
// Old Payment Info
// $data['text_payment'] = $this->language->get('text_payment');
// Satoshi Payment Info
$order_info = $this->model_checkout_order->getOrder($this->session->data['order_id']);
$total = $this->currency->format($order_info['total'], $this->config->get('config_currency'));
$total = filter_var($total, FILTER_SANITIZE_NUMBER_FLOAT,FILTER_FLAG_ALLOW_FRACTION);
$data['text_payment'] = nl2br($this->config->get('satoshi_satoshi' . $this->config->get('config_language_id'))) . '?amount=' . $total . '&reference=' . $this->session->data['order_id'] . '-' . $this->customer->getFirstName() . $this->customer->getLastName();
$data['text_loading'] = $this->language->get('text_loading');
$data['button_confirm'] = $this->language->get('button_confirm');
// Old Link Data
// $data['satoshi'] = nl2br($this->config->get('satoshi_satoshi' . $this->config->get('config_language_id')));
// Satoshi Data Adjustment
$data['satoshi'] = ' ';
$data['continue'] = $this->url->link('checkout/success');
return $this->load->view('extension/payment/satoshi', $data);
}
public function confirm() {
if ($this->session->data['payment_method']['code'] == 'satoshi') {
$this->load->language('extension/payment/satoshi');
$this->load->model('checkout/order');
$comment = $this->language->get('text_instruction') . "\n\n";
// $comment .= $this->language->get('text_payment');
$comment .= $this->config->get('satoshi_satoshi' . $this->config->get('config_language_id')) . '?amount=' . $this->cart->getTotal() . '&reference=' . $this->customer->getFirstName() . $this->customer->getLastName() . "\n\n";
$this->model_checkout_order->addOrderHistory($this->session->data['order_id'], $this->config->get('satoshi_order_status_id'), $comment, true);
}
}
}