I am trying to do something that seems easy, but I cannot get it to work. I am using the Brainree dropin UI and I have a submit button. I need to disable the button during processing, and I cannot find a good event to join.
var ct = 'tokenhere'; var bt = braintree.setup(ct, 'dropin', { container: 'braintreedropin', });
<form id="PayByBrainTreeCheckout" method="post"> <div id="braintreedropin"></div> <input type="submit" value="Pay"> </form>
I tried $('#PayByBrainTreeCheckout').submit(function(){/*disable button*/}), but it also disables the button if there is a validation error in the form.
$('#PayByBrainTreeCheckout').submit(function(){/*disable button*/})
Any ideas? Thanks
Braintree. , , , , , (, , ). , , , .
(, ), .
Mat, support@getbraintree.com, !
Braintree . github: https://github.com/braintree/braintree-web/issues/38
- :
braintree.setup(TOKEN, 'dropin', { container: 'my-container', onError: function (payload) { if (payload.type === 'validation:failed') { // re-enable button } } });
I made a working example of how to use Braintree with WebForms.
https://github.com/StavrosD/BrainTree-PayPal-DotNet
I am describing a workflow on README.md.