Since Shopify is in Ruby...JavaScript should be OK. There are good articles on Rails and JQuery integragtion, like JQuery Rails over on Github.. so here is my code for an express checkout paypal.Buttons({ style: { layout: 'horizontal', color: 'gold', shape: 'pill', label: 'checkout', size: 'responsive', tagline: 'true', }, // Set up the transaction createOrder: function(data, actions) { $('#paypalmsg').hide(); $('#transmsg').show(); $('#transmsg').html('<b>'+'WAITING ON AUTHORIZATION...'+'</b>'); $('#chkoutmsg').hide() return actions.order.create({ purchase_units: [{ description: 'GnG Order', amount: { value: cartTotal } }], application_context: { shipping_preference: 'NO_SHIPPING' } }); }, /* onClick: function() { */ /* },*/ // Finalize the transaction onApprove: function(data, actions) { return actions.order.get().then(function(orderDetails) { // Show a success message to the buyer $('#transmsg').html('<b>' + 'AUTHORIZED...' + '</b>'); $('#transmsg').append('<br>'+'Transaction completed by: ' + orderDetails.payer.name.given_name +' '+ orderDetails.payer.name.surname + '<br>' + "Order Id: " + orderDetails.id + '<br>' + 'Status: ' + orderDetails.status+'!' + '<br>'+ 'Thank You For Your Order'+ '<br>'); if (orderDetails.status === "APPROVED") { window.setTimeout(function() {}, 500) $('#transmsg').append('<b>' + 'Sending Order...Please Wait' + '</b>'+'<br>'); var getId = '#'+ $('span:contains("Market")').attr('id'); var getmrktDiv = '#'+ $(getId).offsetParent().attr('id'); var mrktchkId = '#'+ $(getmrktDiv).closest(getmrktDiv).find(".chkbox").attr('id'); var mrktpriceId = '#'+ $(getmrktDiv).closest(getmrktDiv).find(".price").attr('id'); var chkboxId = "#chk6"; var hidpriceId = "#pricef"; var marketLocation = $(mrktchkId); if (marketLocation.length > 0 ) { var checked = $(mrktchkId).prop('checked'); if (!checked) { var storedVal = $(mrktpriceId).val(); if ($(mrktpriceId+':not([data-val])')) { $(mrktpriceId).attr("data-val", storedVal); } $(mrktpriceId).val(""); } } $('#transid').val(orderDetails.id); $('#orderstat').val(orderDetails.status); $('#orderform').submit(); } }); if (details.error === 'INSTRUMENT_DECLINED') { $('#transmsg').html('<b>' + 'TRANSACTION WAS DECLINED'+'</b>'); $('#transmsg').fadeIn('slow').delay(3000).fadeOut('slow', function() { $('#paypalmsg').show(); $('#chkoutmsg').show(); $('#transmsg').empty(); }); return actions.restart(); }; }, onCancel: function(data) { $('#transmsg').html('<b>' + 'YOUR TRANSACTION WAS CANCELLED' + '</b>'); $('#transmsg').fadeIn('slow').delay(3000).fadeOut('slow', function() { $('#paypalmsg').show(); $('#chkoutmsg').show(); $('#transmsg').empty(); }); } }).render('#paypal-button-container'); Hope this helps ya D
... View more