Tengo que editar el fragmento minimizado a continuación para: SI un mensaje (cadena) es manejado por el fragmento que contiene la palabra API , entonces para cambiar el mensaje completo a Algo salió mal. Vuelva a intentarlo más tarde. Por favor, hágame saber cómo puedo hacer esto. ¡Gracias!
wc_myplugin.BaseGateway.prototype.submit_error = function(t) { var e = this.get_error_message(t); e.indexOf("</ul>") < 0 && (e = '<div class="' + function() { var t = "woocommerce-MyPlugin"; return this.is_current_page("checkout") && (t += " woocommerce-MyPlugin-checkout"), t }.bind(this)() + '"><ul class="woocommerce-error"><li>' + e + "</li></ul></div>"); t = o(document.body).triggerHandler("wc_myplugin_submit_error", [e, t, this]); e = void 0 === t ? e : t, this.submit_message(e)var eMessage = e.contains('API') ? 'Something went wrong. Try again later' : e; en la tercera fila. Básicamente, comprueba si el mensaje de error contiene "API" (letras mayúsculas). Si es así, el mensaje de error se reemplaza, de lo contrario, sigue siendo el mismo.
wc_myplugin.BaseGateway.prototype.submit_error = function(t) { var e = this.get_error_message(t); var eMessage = e.contains('API') ? 'Something went wrong. Try again later' : e; e.indexOf("</ul>") < 0 && (e = '<div class="' + function() { var t = "woocommerce-MyPlugin"; return this.is_current_page("checkout") && (t += " woocommerce-MyPlugin-checkout"), t }.bind(this)() + '"><ul class="woocommerce-error"><li>' + eMessage + "</li></ul></div>"); t = o(document.body).triggerHandler("wc_myplugin_submit_error", [e, t, this]); e = void 0 === t ? e : t, this.submit_message(e)