You are viewing limited content. For full access, please sign in.

Question

Question

Disable Braintree/Paypal Form Integration Upon Selection

asked on March 8, 2017

Hello,

 

Does anyone know if there is a way to disable the payment collection interface through Braintree/Paypal depending upon the section of a radio button.  I have a form to sign up for utility service and a deposit is only required if the customer chooses not to participate in the automatic payment program.  If they elect to sign up for automatic payments, I would like the ending form not to show that they owe $0. 

 

Thanks in advance!

 

Ben

0 0

Replies

replied on March 8, 2017

Using variable as payment bypasses the required Braintree payment control, but still displays it below the form. What you can do is to use custom JavaScript to hide that part of the HTML conditionally, so that user won't see it if the payment variable evaluates to be zero.

0 0
replied on March 8, 2017

Thank you.  Would you happen to have any sample script that this relative javascript newbie could start with? 

0 0
replied on March 8, 2017

Please use the following JavaScript to hide the payment block:

$(".braintree-mobile-responsiveness-block").first().parent().parent().parent().hide();

You need to add condition above it so that it only hides the block when the radio button is selected.

0 0
replied on March 9, 2017

Thank you so much for your help!

0 0
replied on April 2, 2017

I'm having trouble to get this script to hide the Braintree.  Even this simple code still allows the Braintree to be shown:

 

/* Disable Braintree when No Deposit Due */
$(document).ready(function () {
   //Hide Braintree by default
$(".braintree-mobile-responsiveness-block").first().parent().parent().parent().hide();
 });
 });

 

And here is the script I am hoping to ultimately include:

 

/* Disable Braintree when No Deposit Due */
$(document).ready(function () {
   //Hide Braintree by default
$(".braintree-mobile-responsiveness-block").first().parent().parent().parent().hide();
   //Show Braintree if Deposit is Required
 $('#q22').click(function () { 
if($('input[value="Pay the $100 deposit"]').is(':checked'))
$(".braintree-mobile-responsiveness-block").first().parent().parent().parent().show();
    }
    //If not, hide it
    else {
$(".braintree-mobile-responsiveness-block").first().parent().parent().parent().hide();
    }
 });
 });

 

Any ideas?

 

 

0 0
replied on September 24, 2019

This appears to work for us (done by our VAR):

  $("#q38").change(function(){
    if($('input[value="Yes"]').is(':checked')){
      $(".braintree-mobile-responsiveness-block").first().parent().parent().parent().show();}
    else {
      $(".braintree-mobile-responsiveness-block").first().parent().parent().parent().hide();}      
})
});

 

Online Payment.png
0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.