Skip to content

Commit

Permalink
Express Checkout - JSv4, ref #997
Browse files Browse the repository at this point in the history
  • Loading branch information
kcppdevelopers committed Mar 14, 2018
1 parent 44f6932 commit 33ad154
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 0 additions & 5 deletions assets/js/angelleye-in-context-checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down Expand Up @@ -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;
});
Expand All @@ -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();
});
},
Expand Down
10 changes: 10 additions & 0 deletions classes/wc-gateway-paypal-express-angelleye.php
Original file line number Diff line number Diff line change
Expand Up @@ -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("<option></option>").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' ) {
Expand Down

0 comments on commit 33ad154

Please sign in to comment.