Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeremy 17 posts 37 karma points
    Jun 04, 2011 @ 00:55
    Jeremy
    0

    goToPayment throwing javascript error

    I'm trying to setup a basic Tea Commerce Implementation based on Anders Burla's blog post.

    I have this in my javascript file that is fired when the user clicks Checkout:

    /* The confirm order step of the cart */
    jQuery('a#confirmOrder').live("click", function () {
        var personalInformation = jQuery("#personalInformation");

        /* We fetch the information from the form and creates
        an object that can be sent to the server as a form
        POST submit */
        var formObj = {
            "firstName": personalInformation.find("#firstName").val(),
            "lastName": personalInformation.find("#lastName").val(),
            "email": personalInformation.find("#email").val()
        };

        /* The properties is sent to the server with a syncronous call
        This way we lock the UI and can redirect the user.*/
        TeaCommerce.updateOrderProperties(formObj, false);
        TeaCommerce.setPaymentMethod(2, false);
        TeaCommerce.goToPayment();
        return false;
    });

    I get the error "rtnData is null" and the user is not moved to the next step. I'm referencing the teaCommerce_unpacked.js file instead of the minified version, to make it easier for me to debug. The same error was occuring before I switched, although it was "b is null".

    Looking through the teaCommerce_unpacked.js code, the problem appears to be with teaCommerceService.callBase. If I view the "data" variable in the success function that fires after the ajax call, it always has a value, except when goToPayment is called, in which case it is null.

    Note: I haven't licensed Tea Commerce yet, as I'm still running it on my local machine in test mode.

    I'd appreciate any suggestions you have as to how I can fix this. I'm really enjoying working with Tea Commerce, and I hope this can be resolved.

    Thanks,

    Jeremy

  • Anders Burla 2560 posts 8256 karma points
    Jun 04, 2011 @ 01:15
    Anders Burla
    0

    Hi Jeremy

    This often happens when the payment method isnt setup correctly. Have you added the countries as possible countries for the payment method?

  • Anders Burla 2560 posts 8256 karma points
    Jun 06, 2011 @ 09:18
    Anders Burla
    0

    Any luck fixing it?

  • Rune Grønkjær 1372 posts 3103 karma points
    Jun 06, 2011 @ 09:27
    Rune Grønkjær
    0

    Yes, the payment method is probably not selected. As Anders mentions this happens because it is not valid in the chosen country.

    Under the payment methods "Available in these countries" tab you must check the countries that are allowed for that payment method.

    /Rune

  • Jeremy 17 posts 37 karma points
    Jun 06, 2011 @ 18:28
    Jeremy
    0

    Thanks Anders and Rune, you were right about the Countries. I totally missed the "Available in these countries" tab. Thanks for you quick response, and for creating such a great product!

    Cheers,

    Jeremy

  • Anders Burla 2560 posts 8256 karma points
    Jun 06, 2011 @ 19:31
    Anders Burla
    0

    Great you got it solved. It would be a help for others if you would mark the right solution to your problem.

    And thanks for the kind words - we love to help people

Please Sign in or register to post replies

Write your reply to:

Draft