Sha256: 675e3db944c4876285dcc7550905ee6eb2350da36c468eb07b4a1155a26c000f
Contents?: true
Size: 1.11 KB
Versions: 2
Compression:
Stored size: 1.11 KB
Contents
//= require solidus_paypal_braintree/paypal_button // This is the PayPal button on the cart page $(document).ready(function() { if (document.getElementById("empty-cart")) { $.when( $.getScript("https://js.braintreegateway.com/web/3.31.0/js/client.min.js"), $.getScript("https://js.braintreegateway.com/web/3.31.0/js/paypal-checkout.min.js"), $.getScript("https://js.braintreegateway.com/web/3.31.0/js/data-collector.min.js") ).done(function() { $("#content").append('<div id="paypal-button"/>'); $('<script/>').attr({ 'data-version-4' : "true" }). load(function() { var paypalOptions = { flow: 'vault', enableShippingAddress: true } var options = { restart_checkout: true } var button = new SolidusPaypalBraintree.createPaypalButton( document.querySelector("#paypal-button"), paypalOptions, options ); return button.initialize(); }). insertAfter("#content"). attr('src', 'https://www.paypalobjects.com/api/checkout.js'); }); } });
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
solidus_paypal_braintree-1.0.0 | app/assets/javascripts/spree/frontend/paypal_button.js |
solidus_paypal_braintree-0.4.0 | app/assets/javascripts/spree/frontend/paypal_button.js |