return res.token; passing data to controller from js (paypal)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

return res.token; passing data to controller from js (paypal)

fugee ohu
if the script contains: `return res.token;` how do i see if token is success in my controller? ... if token.success? Here's the script I have to get the token in my controller
paypal.Button.render({
    payment: function() {
        var SETEC_URL = 'https://mystore.com/api/paypal/set-express-checkout';

        return paypal.request.post(SETEC_URL).then(function(res) {
            return res.token;
        });
    }
}, '#paypal-button-container');

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/5d0df62b-b5cb-4b8b-abd5-0d091efc62d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.