How to call external javascript function from inside onAuthorize paypal smart payment button listener
问题 While setting up a Paypal Smart Payment Button, I wanted to call an external function from the button listener onAuthorize. How to do it? External functions are not visible inside the button listener. In order to call them they have to be attached to the window object. /* Paypal button code */ // Execute the payment onAuthorize: function(data, actions) {$(this).attr('action') return actions.payment.execute().then(function(data) { // Show a confirmation message to the buyer window.user