简体   繁体   中英

Braintree Payment gateway : paymentMethodNonceReceived unable to stop submitting form

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.

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM