Current File : /home/itiffy/public_html/blog/wp-content/plugins/wp-invoice/static/scripts/wpi-frontend.js
function process_cc_checkout(){link_id="wp_cc_response";var req=jQuery.post(site_url,jQuery("#checkout_form").serialize(),function(html){var explode=html.toString().split("\n"),shown=!1,msg="<b>There are problems with your transaction:</b><ol>";for(var i in explode){var explode_again=explode[i].toString().split("|");"error"==explode_again[0]?(shown||jQuery("#"+link_id).fadeIn("slow"),shown=!0,add_remove_class("ok","error",explode_again[1]),msg+="<li>"+explode_again[2]+"</li>"):"ok"==explode_again[0]&&add_remove_class("error","ok",explode_again[1])}shown?(add_remove_class("success","error",link_id),jQuery("#"+link_id).html(msg+"</ol>")):"Transaction okay."==html&&(jQuery(".online_payment_form").fadeOut("slow"),jQuery("#wp_cc_response").fadeIn("slow"),jQuery("#wp_cc_response").html("<?php _e('Thank you! <br />Payment processed successfully!', WP_INVOICE_TRANS_DOMAIN); ?>"),jQuery("#credit_card_information").hide(),jQuery("#welcome_message").html("Invoice Paid!"),jQuery("#"+link_id).show()),jQuery("#wp_invoice_process_wait span").html(""),req=null})}function add_remove_class(search,replace,element_id){jQuery("#"+element_id).hasClass(search)&&jQuery("#"+element_id).removeClass(search),jQuery("#"+element_id).addClass(replace)}