Skip to content

Commit

Permalink
2.4.1 mejoras en apertura del terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
edavism committed May 24, 2016
1 parent 3c9c1dd commit 678c263
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
25 changes: 13 additions & 12 deletions class-wc-khipu.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Plugin Name: WooCommerce khipu
* Plugin URI: https://khipu.com
* Description: khipu payment gateway for woocommerce
* Version: 2.4.0
* Version: 2.4.1
* Author: khipu
* Author URI: https://khipu.com
*/
Expand Down Expand Up @@ -68,7 +68,7 @@ class WC_Gateway_khipu extends WC_Payment_Gateway
public function __construct()
{
$this->id = 'khipu';
$this->icon = plugins_url('images/buttons/110x25-transparent.png', __FILE__);
$this->icon = 'https://bi.khipu.com/150x50/capsule/khipu/transparent/'.$this->get_option('receiver_id');
$this->has_fields = false;
$this->method_title = __('khipu - Transferencia simplificada', 'woocommerce');
$this->notify_url = add_query_arg('wc-api', 'WC_Gateway_' . $this->id, home_url('/'));
Expand Down Expand Up @@ -200,7 +200,7 @@ function get_available_banks()
$configuration = new Khipu\Configuration();
$configuration->setSecret($this->secret);
$configuration->setReceiverId($this->receiver_id);
$configuration->setPlatform('woocommerce-khipu', '2.4.0');
$configuration->setPlatform('woocommerce-khipu', '2.4.1');

$client = new Khipu\ApiClient($configuration);
$banks = new Khipu\Client\BanksApi($client);
Expand Down Expand Up @@ -264,10 +264,10 @@ function generate_khipu_bankselect()
<script>
(function ($) {
var messages = [];
var bankRootSelect = $('#root-bank')
var bankOptions = []
var selectedRootBankId = 0
var selectedBankId = 0
var bankRootSelect = $('#root-bank');
var bankOptions = [];
var selectedRootBankId = 0;
var selectedBankId = 0;
bankRootSelect.attr("disabled", "disabled");
EOD;

Expand All @@ -283,7 +283,7 @@ function generate_khipu_bankselect()
$bankSelector .= <<<EOD
function updateBankOptions(rootId, bankId) {
if (rootId) {
$('#root-bank').val(rootId)
$('#root-bank').val(rootId);
}
var idx = $('#root-bank :selected').val();
Expand Down Expand Up @@ -338,16 +338,17 @@ function generate_khipu_terminal_page()
wp_enqueue_script('khipu-js', '//storage.googleapis.com/installer/khipu-1.1.js', array('jquery'));

$waitMsg =
__('Estamos iniciando el terminal de pagos khipu, por favor espera unos minutos.<br>No cierres esta página, una vez que completes el pago serás redirigido automáticamente.');
__(' Estamos iniciando la aplicación khipu, por favor espera unos segundos.<br>No cierres esta página, una vez que completes el pago serás redirigido automáticamente.<br><br>Si pasado unos segundos no se ha abierto la aplicación<br><a href="javascript:openKhipu();" class="btn btn-default">Pincha aquí para abrirla</a>');
$out = <<<EOD
<div id="wait-msg" class="woocommerce-info">$waitMsg</div>
<div id="khipu-chrome-extension-div" style="display: none"></div>
<script>
window.onload = function () {
function openKhipu() {
KhipuLib.onLoad({
data: $json_string
})
}
window.onload = openKhipu;
</script>
EOD;
return $out;
Expand Down Expand Up @@ -375,7 +376,7 @@ function generate_khipu_generate_payment($order_id)
$configuration = new Khipu\Configuration();
$configuration->setSecret($this->secret);
$configuration->setReceiverId($this->receiver_id);
$configuration->setPlatform('opencart-khipu', '2.4.0');
$configuration->setPlatform('woocommerce-khipu', '2.4.1');

$client = new Khipu\ApiClient($configuration);
$payments = new Khipu\Client\PaymentsApi($client);
Expand Down Expand Up @@ -471,7 +472,7 @@ function get_order_from_notification()
$configuration = new Khipu\Configuration();
$configuration->setSecret($this->secret);
$configuration->setReceiverId($this->receiver_id);
$configuration->setPlatform('woocommerce-khipu', '2.4.0');
$configuration->setPlatform('woocommerce-khipu', '2.4.1');

$client = new Khipu\ApiClient($configuration);
$payments = new Khipu\Client\PaymentsApi($client);
Expand Down
8 changes: 4 additions & 4 deletions class-wc-khipubacs.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Plugin Name: WooCommerce khipubacs
* Plugin URI: https://khipu.com
* Description: khipu powered direct transfer payment gateway for woocommerce
* Version: 2.4.0
* Version: 2.4.1
* Author: khipu
* Author URI: https://khipu.com
*/
Expand Down Expand Up @@ -68,7 +68,7 @@ class WC_Gateway_khipubacs extends WC_Payment_Gateway
public function __construct()
{
$this->id = 'khipubacs';
//$this->icon = plugins_url('images/buttons/50x25.png', __FILE__);
$this->icon = 'https://bi.khipu.com/150x50/capsule/transfer/transparent/'.$this->get_option('receiver_id');
$this->has_fields = false;
$this->method_title = __('Trasferencia normal', 'woocommerce');
$this->notify_url = add_query_arg('wc-api', 'WC_Gateway_' . $this->id, home_url('/'));
Expand Down Expand Up @@ -233,7 +233,7 @@ function generate_khipubacs_submit_button($order_id)
$configuration = new Khipu\Configuration();
$configuration->setSecret($this->secret);
$configuration->setReceiverId($this->receiver_id);
$configuration->setPlatform('opencart-khipu', '2.4.0');
$configuration->setPlatform('opencart-khipu', '2.4.1');

$client = new Khipu\ApiClient($configuration);
$payments = new Khipu\Client\PaymentsApi($client);
Expand Down Expand Up @@ -296,7 +296,7 @@ function get_order_from_notification()
$configuration = new Khipu\Configuration();
$configuration->setSecret($this->secret);
$configuration->setReceiverId($this->receiver_id);
$configuration->setPlatform('woocommerce-khipu', '2.4.0');
$configuration->setPlatform('woocommerce-khipu', '2.4.1');

$client = new Khipu\ApiClient($configuration);
$payments = new Khipu\Client\PaymentsApi($client);
Expand Down

0 comments on commit 678c263

Please sign in to comment.