Skip to content

Commit be77401

Browse files
author
Christopher Wong
committed
Bug fix for Admin and Checkout UI
1 parent ba5afc6 commit be77401

18 files changed

+720
-964
lines changed

LICENSE

100644100755
File mode changed.

README.md

100644100755
File mode changed.

assets/css/bootstrap.css

100644100755
File mode changed.

assets/css/modal.css

100644100755
File mode changed.

assets/css/ui.bambora.1.2.0.css

100644100755
File mode changed.

assets/images/bambora-logo.png

100644100755
File mode changed.

assets/images/success.gif

100644100755
File mode changed.

assets/images/success.png

-6.54 KB
Binary file not shown.

assets/js/admin-bambora.js

100644100755
Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,26 +59,32 @@ jQuery(function ($) {
5959
var save_card = $('#woocommerce_bambora_apac_save_card_detail').parents('tr').eq(0);
6060
var card_storage = $('#woocommerce_bambora_apac_save_card_method').parents('tr').eq(0);
6161
var batch_payment = $('#woocommerce_bambora_apac_batch_payment').parents('tr').eq(0);
62-
var batch_schedule = $('#woocommerce_bambora_apac_payment_scheduling').parents('tr').eq(0);
6362
var red_3dsec = $('#woocommerce_bambora_apac_red_3dsec').parents('tr').eq(0);
64-
red_3dsec.hide();
6563

6664
if (bambora_apac_admin.isAPIMode()) {
6765
dl.hide();
6866
save_card.show();
69-
card_storage.show();
70-
batch_payment.show();
71-
batch_schedule.show();
72-
7367
} else {
7468
dl.show();
7569
save_card.hide();
76-
card_storage.hide();
77-
batch_payment.hide();
78-
batch_schedule.hide();
7970

8071
}
8172

73+
if (bambora_apac_admin.isReadyMode()) {
74+
card_storage.hide();
75+
save_card.hide();
76+
red_3dsec.hide();
77+
} else {
78+
card_storage.show();
79+
save_card.show();
80+
red_3dsec.show();
81+
}
82+
83+
if ($('#woocommerce_bambora_apac_save_card_method').val() == "customerregistration") {
84+
batch_payment.show();
85+
} else {
86+
batch_payment.hide();
87+
}
8288
}
8389
};
8490

@@ -88,29 +94,33 @@ jQuery(function ($) {
8894

8995
var dl = $('#woocommerce_bambora_apac_dl').parents('tr').eq(0);
9096
var save_card = $('#woocommerce_bambora_apac_save_card_detail').parents('tr').eq(0);
91-
var card_storage = $('#woocommerce_bambora_apac_save_card_method').parents('tr').eq(0);
92-
var batch_payment = $('#woocommerce_bambora_apac_batch_payment').parents('tr').eq(0);
93-
var batch_schedule = $('#woocommerce_bambora_apac_payment_scheduling').parents('tr').eq(0);
94-
var red_3dsec = $('#woocommerce_bambora_apac_red_3dsec').parents('tr').eq(0);
95-
red_3dsec.hide();
9697

9798
if (bambora_apac_admin.isAPIMode()) {
9899
dl.hide();
99100
save_card.show();
100-
card_storage.show();
101-
batch_payment.show();
102-
batch_schedule.show();
103-
104101
} else {
105102
dl.show();
106103
save_card.hide();
107-
card_storage.hide();
108-
batch_payment.hide();
109-
batch_schedule.hide();
110-
111104
}
112105
});
113106

107+
$('#woocommerce_bambora_apac_bambora_product').change(function () {
108+
109+
var card_storage = $('#woocommerce_bambora_apac_save_card_method').parents('tr').eq(0);
110+
var save_card = $('#woocommerce_bambora_apac_save_card_detail').parents('tr').eq(0);
111+
var red_3dsec = $('#woocommerce_bambora_apac_red_3dsec').parents('tr').eq(0);
112+
113+
if (bambora_apac_admin.isReadyMode()) {
114+
card_storage.hide();
115+
save_card.hide();
116+
red_3dsec.hide();
117+
} else {
118+
card_storage.show();
119+
save_card.show();
120+
red_3dsec.show();
121+
}
122+
123+
});
114124

115125
$('#woocommerce_bambora_apac_bambora_product').change(function () {
116126

@@ -127,6 +137,14 @@ jQuery(function ($) {
127137

128138
});
129139

140+
$('#woocommerce_bambora_apac_save_card_method').change(function () {
141+
var batch_payment = $('#woocommerce_bambora_apac_batch_payment').parents('tr').eq(0);
142+
if ($('#woocommerce_bambora_apac_save_card_method').val() == "customerregistration") {
143+
batch_payment.show();
144+
} else {
145+
batch_payment.hide();
146+
}
147+
});
130148
});
131149

132150

assets/js/bootstrap.min.js

100644100755
File mode changed.

assets/js/bulkactions.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

assets/js/checkout-bambora.js

100644100755
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ jQuery( function( $ ) {
3636
bambora_checkout.init($( "form.checkout" ));
3737
$("body").on("click", "button.close", function(){
3838
$('#myModal').modal('hide');
39-
window.parent.location = 'wordpress/checkout/';
40-
});
41-
42-
$("body").on("click", "button.btntest", function(){
43-
$('#myModal').modal('hide');
44-
alert('ss');
45-
// window.parent.location = '/checkout/';
39+
window.parent.location = '/checkout/';
4640
});
4741
});

bambora-apac-online.php

100644100755
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Bambora APAC Online Plug-in for WooCommerce.
44
* Plugin URI: https://dev-apac.bambora.com/
55
* Description: Welcome to the Bambora APAC Plug-in for WooCommerce. Need an Account? Check us out at https://www.bambora.com
6-
* Version: 1.1.2.1
6+
* Version: 1.2.0
77
* Author: Bambora APAC
88
* Author URI: http://www.bambora.com/
99
* Developer: Bambora APAC
@@ -33,7 +33,7 @@ function bambora_apac_init() {
3333
// Checking whether WooCommerce is not installed return null
3434
if ( ! class_exists( 'WC_Payment_Gateway' ) ) return;
3535
// If WooCommerce is installed include Gateway Class
36-
include_once( plugin_dir_path(__FILE__).'bambora-apac.php' );
36+
include_once( 'bambora-apac.php' );
3737

3838
// Adding Class to WooCommerce
3939
add_filter( 'woocommerce_payment_gateways', 'wc_add_bambora_gateway' );

0 commit comments

Comments
 (0)