diff --git a/assets/js/angelleye-in-context-checkout.js b/assets/js/angelleye-in-context-checkout.js index 227150e14..9da8c8f4d 100644 --- a/assets/js/angelleye-in-context-checkout.js +++ b/assets/js/angelleye-in-context-checkout.js @@ -79,9 +79,7 @@ request_from: 'JSv4' }; - console.log(params); paypal.request.post(data.returnUrl, params).then(function (res) { - console.log(res); data.returnUrl = res.url; actions.redirect(); }); @@ -178,7 +176,6 @@ var params = { request_from: 'JSv4' }; - console.log(params); return paypal.request.post(data.url, params).then(function (res) { return res.token; }); @@ -191,10 +188,8 @@ token: data.paymentToken, request_from: 'JSv4' }; - console.log(params); paypal.request.post(data.returnUrl, params).then(function (res) { data.returnUrl = res.url; - console.log(res); actions.redirect(); }); }, diff --git a/classes/wc-gateway-paypal-express-angelleye.php b/classes/wc-gateway-paypal-express-angelleye.php index b60d4b143..0e8451d81 100644 --- a/classes/wc-gateway-paypal-express-angelleye.php +++ b/classes/wc-gateway-paypal-express-angelleye.php @@ -400,6 +400,16 @@ function is_funding_icon_should_show_php() { } }).change(); jQuery('#woocommerce_paypal_express_disallowed_funding_methods').change(function () { + if( jQuery.inArray('credit', jQuery('#woocommerce_paypal_express_disallowed_funding_methods').val()) ) { + + if( jQuery("#woocommerce_paypal_express_button_label option[value='credit']").length === 0) { + jQuery('#woocommerce_paypal_express_button_label').append(jQuery("").attr("value","credit").text("Credit")); + } + + } else { + jQuery('#woocommerce_paypal_express_button_label option[value="credit"]').remove(); + } + if( is_funding_icon_should_show_php() === false) { jQuery("#woocommerce_paypal_express_button_fundingicons").closest('tr').hide(); if( jQuery('#woocommerce_paypal_express_button_label').val() !== 'buynow' ) {