1

Here is my braintree javascript code.

braintree.setup("<?=$clientToken?>", "custom", {
    id: "checkout_prem",
    paymentMethodNonceReceived: function (event, nonce) {
        return false;
    }
});

After i click on submit button it will submit the form that i don't want to.

Can anybody help me to solve this.

Mihir Vadalia
  • 219
  • 4
  • 14

2 Answers2

1

On the click callback of your form pass in the event and use the event.preventDefault();

http://api.jquery.com/event.preventdefault/

AJTECH
  • 367
  • 1
  • 3
  • 10
1

use onPaymentMethodReceived instead of paymentMethodNonceReceived Then It will works:

Check this link for more information: Braintree - paymentMethodNonceReceived not being invoked

Thanks

http://www.web-technology-experts-notes.in

Community
  • 1
  • 1
Poonam Gupta
  • 416
  • 6
  • 8