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

Question

Question

Hide Authorize.net on checkbox selection

asked on March 22, 2018

Is there a way to hide the Authorize.net payment gateway if you have a checkbox checked? 

0 0

Answer

SELECTED ANSWER
replied on March 25, 2018

Hi Dylan,

There is no out-of-the-box function for hiding payment; you can do it with custom script like this:

First set payment to use field value instead of fixed value; this is because you cannot submit if payment value is not 0;

Then, use script to set payment value to 0 and hide the gateway frame like this (the checkbox field has class "hidePayment" and choice with value "choice_1", the payment value field has class "paymentValue"):

$(document).ready(function(){
  $('.hidePayment input').click(function(){
    if($('.hidePayment input[value="choice_1"]').is(':checked')) {
      $('.paymentValue input').val('0').change();
      $('#authorizeNetPaymentBlock').hide();
    }
  });
})

Still, you need to confirm payment when you click submit. It will show "Total: 0" on the confirm dialog.

0 0

Replies

replied on May 25, 2021

I've tried implementing the code above for with a Sandbox account in Forms 11, for above but I'm running into an issue. I do not have any of the Optional Configuration items checked for the account selected in Forms Configuration.

When completing the form where the payment gateway is hidden, the Submit button is not active, or just doesn't work, to submit the form when the Authorize portion is hidden.

Any thoughts

 

0 0
replied on June 2, 2021

Can you submit with the payment shown?

The script above only hides it, you need to make sure the form can be submitted without filling payment. The payment amount must be 0 otherwise it would block submission.

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

Sign in to reply to this post.