Sha256: f9cf05201e74443ede3f13069aa3638f025607b41a67e9f659d3670a3d83b9df
Contents?: true
Size: 1.1 KB
Versions: 5
Compression:
Stored size: 1.1 KB
Contents
//= require spree/frontend/solidus_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/3.84.0/js/client.min.js"), $.getScript("https://js.braintreegateway.com/3.84.0/js/paypal-checkout.min.js"), $.getScript("https://js.braintreegateway.com/3.84.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 SolidusBraintree.createPaypalButton( document.querySelector("#paypal-button"), paypalOptions, options ); return button.initialize(); }). insertAfter("#content"). attr('src', 'https://www.paypalobjects.com/api/checkout.js'); }); } });
Version data entries
5 entries across 5 versions & 1 rubygems