Last active
February 6, 2019 13:27
-
-
Save m1k3lm/bd268b49d89b5c4d7a4267edcca162ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sequraConfigParams = { | |
merchant: "agrieuro", // Your merchant reference given by SeQura. | |
assetKey: "G1GbZfecNj", // Your asset key given by SeQura. | |
products: ["i1", "pp3"], // List of SeQura products that you want to include components. | |
scriptUri: "https://sandbox.sequracdn.com/assets/sequra-checkout.min.js", // SeQura Javascript library uri for production or sandbox. | |
decimalSeparator: ',', // Decimal separator used in currencies formatting. Optional, default `,`. | |
thousandSeparator: '.', // Thousand separator used in currencies formatting. Optional, default `.`. | |
}; | |
(function(i, s, o, g, r, a, m) {i['SequraConfiguration'] = g;i['SequraOnLoad'] = [];i[r] = {};i[r][a] = function(callback) {i['SequraOnLoad'].push(callback);};(a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]);a.async = 1;a.src = g.scriptUri;m.parentNode.insertBefore(a, m);})(window, document, 'script', sequraConfigParams, 'Sequra', 'onLoad'); | |
//Customize Icon | |
jQuery('label[for=payment_sequra] div') | |
.off() | |
.addClass('sequra-educational-popup') | |
.attr('data-product','pp3'); | |
//Get price | |
amount = jQuery('#target_summary div:last').text().replace(/^\D*/,'').replace(/^\D|\,|\./g,''); | |
//Propper name | |
html = jQuery('label[for=payment_sequra]').html().replace('SeQura','Fracciona tu pago'); | |
//Add widget | |
jQuery('label[for=payment_sequra]') | |
.html(html) //Set propper name | |
.parent() | |
.append( | |
'<div class="sequra-promotion-widget"' + | |
' data-amount="'+amount+'"' + | |
' data-product="pp3"' + | |
' data-alignment="left"' + | |
' data-size="M"' + | |
' data-starting-text="as-low-as">' + | |
'</div>'); | |
//Refresh Sequra to redraw | |
Sequra.onLoad(function (){ | |
Sequra.refreshComponents(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment