• Resolved webmonk

    (@webmonk)


    plugins/checkout-for-woocommerce/build/js/default-checkout-order-pay-7c2d873e1953684f44e0.js

    in createAlertsFromMessages at line 1:7240

    {snip} m(),cfw-alert-success ${t});n.queueAlert(a),r=!0})),-1!==e.indexOf("<script")&&jQuery(document.body).prepend(`<div style="display:none">${ {snip}

    This is the error message when a user tries to checkout and there’s an error notice to be displayed on the checkout page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter webmonk

    (@webmonk)

    The bug is in AlertService.ts file.

    messages is undefined here:

    if ( messages.indexOf( '<script' ) !== -1 ) {
    jQuery( document.body ).prepend(
    <div style="display:none">${messages}</div> );
    }

    • This reply was modified 2 years, 2 months ago by webmonk.
    Thread Starter webmonk

    (@webmonk)

    I found the fix for this.

    In CompleteOrderAction.ts, you have triple “s” in resp.messages
    AlertService.createAlertsFromMessages( resp.messsages );

    if ( typeof resp.messages === 'string' && resp.messages.length ) { AlertService.createAlertsFromMessages( resp.messsages ); } else { /** * If the payment gateway comes back with no message, show a generic error. */ const message = DataService.getCheckoutParam( 'i18n_checkout_error' ).toString(); const rawResponse = JSON.stringify( resp, null, 2 ); const alert: Alert = new Alert( 'error', message, 'cfw-alert-error', ); AlertService.queueAlert( alert ); // Console log the error + raw response LoggingService.logError( ${message}\n\n${rawResponse} ); } // Trigger update in case we need a fresh nonce if ( resp.refresh === true ) { jQuery( document.body ).trigger( 'update_checkout' ); }

    Thread Starter webmonk

    (@webmonk)

    Do you have a github repository for this plugin? I can fix and submit a PR.

    Plugin Author Clifton Griffin

    (@clifgriffin)

    Hi there – so sorry about this. Fix is up now: 1.1.7

    We’re going to setup monitoring so that we are notified more quickly of new bug reports / support requests.

    (It’s manual currently because we usually hear about bugs from our Pro users first – but that didn’t work this time)

    Great job tracking this down.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Type error: e is undefined’ is closed to new replies.