1/* global wc_fedapay_params jQuery FedaPay */ 2 3jQuery( function( $ ) { 4 'use strict'; 5 6 var wc_fedapay_checkout = { 7 init: function() { 8 window.addEventListener( 'hashchange', this.onHashChange ); 9 }, 10 11 onHashChange: function() { 12 var partials = window.location.hash.match( /^#?fedapay-confirm-(\d+):(.+)$/ ); 13 14 if ( ! partials || 3 > partials.length ) { 15 return; 16 } 17 18 var id = partials[1]; 19 var redirectURL = decodeURIComponent( partials[2] ); 20 21 // Cleanup the URL 22 window.location.hash = ''; 23 24 wc_fedapay_checkout.openDialog( id, redirectURL ); 25 }, 26 27 openDialog: function(id, redirectURL) { 28 wc_fedapay_params['transaction'] = { id: id }; 29 wc_fedapay_params['onComplete'] = function() { 30 window.location = redirectURL; 31 }; 32 33 FedaPay.init(wc_fedapay_params).open(); 34 } 35 }; 36 37 wc_fedapay_checkout.init(); 38});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.