Validation on paypal button version 2.1.102

aei_vd
New Community Member

Hi,

 

I'm trying to add validation to an old integration that uses the paypal button version 2.1.102

The integration supports validation on button render, but not on onClick.

I have change the validation and onclick methods so that I have the actions in the onclick, but once enabled the validation is ignored.

...

onClick: function(e) {
    var isValid = $('#billing-form').validate().form();
   if (!isValid) {
      paypalActions.disable();
   } else {
      paypalActions.enable();
   }
},
validate: function(actions) {
   actions.disable(); 
   paypalActions = actions;
}

 

And the button is rendered with this script:

paypal.Button.render(configCYP,'#paypal-button-container');

where configCYP contains all the configurations + the onClick and validate methods.

 

I saw that newer version have the options to restrict and resolve in the actions, but in this version I only have enable and disable.

Has anyone manage to make the validation work onClick() ?

 

Regards

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.