1 2function initialize_paypal_sdk(submission_id, payment_id, user_id, btn_color='gold') { 3 if(typeof paypal !== 'undefined') { 4 paypal.Buttons({ 5 style: { 6 layout: 'vertical', 7 color: btn_color 8 }, 9 createOrder: function(data, actions) { 10 return actions.order.create(orders); 11 }, 12 onApprove: function(data, actions) { 13 return actions.order.capture().then(function(orderData) { 14 var transaction = orderData.purchase_units[0].payments.captures[0]; 15 process_paypal_sdk_payment(submission_id, payment_id, transaction, user_id); 16 }); 17 }, 18 onError: function (err) { 19 console.log(err); 20 alert(rm_ajax.paypal_error); 21 } 22 23 }).render('#rm_paypal_btn_container'); 24 } else { 25 console.log('Incorrect PayPal Client ID. Please recheck your Client ID and try again.'); 26 } 27} 28 29function process_paypal_sdk_payment(submission_id, payment_id, transaction,user_id){ 30 31 let data = {action: 'rm_process_paypal_sdk_payment', 'rm_sec_nonce': rm_ajax.nonce, transaction: transaction, submission_id: submission_id, payment_id: payment_id, user_id:user_id}; 32 jQuery.ajax({ 33 url: rm_ajax.url, 34 type: 'POST', 35 data: data, 36 async: true, 37 success: function(success_response) { 38 jQuery('#rm_paypal_order_success').show(); 39 jQuery('#rm_paypal_order_area').html(success_response.data.msg); 40 if (success_response.data.redirect) { 41 location.href = success_response.data.redirect; 42 } 43 if (success_response.data.hasOwnProperty('reload_params')) { 44 var url = [location.protocol, '//', location.host, location.pathname].join(''); 45 if(url.indexOf('admin-ajax.php')>=0){ 46 return; 47 } 48 url += success_response.data.reload_params; 49 location.href = url; 50 } 51 }, 52 error: function(error_response) { 53 console.log(error_response); 54 } 55 }); 56}
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.