Copied to clipboard

Flag this post as spam?

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


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Joe 2 posts 22 karma points
    Mar 23, 2015 @ 21:25
    Joe
    0

    no basket exists for the current user exception

    Hello,

    I have run into an issue that I just cannot figure out. I am using a custom payment which is working perfectly. After the confirmation has been recieved from the card processor I obviuosly then want to complete the order. However the problem that I am running into is when I try to complete the order I get a "no basket exists for the current user" execption.

    Here is the code that I am using:

    TransactionLibrary.CreatePayment(8, orderTotal.Value);
    TransactionLibrary.Checkout();

    I have also tried to use

    TransactionLibrary.ExecuteBasketPipeline();

    Instead of 

    TransactionLibrary.Checkout();

    But I get the same exception. I know that the basket is working because I am using the totals from the basket PurchaseOrder to get the order total for processing the card.

    Any help in solving this would be awesome.

    Thanks.

  • Mads Due 11 posts 72 karma points
    Mar 24, 2015 @ 15:27
    Mads Due
    0

    Hi Joe, 

    To fix your issue you need to call TransactionLibrary.CreatePayment(8, orderTotal.Value, requestPayment: false);

    The requestPayment parameter is checking whatever payment should be requested and then completes the basket using the configured checkout pipeline, so by setting the requestePayment to false you don't request the payment and the basket its not complete yet.

    The TransactionLibrary.CreatePayment is calling TransactionLibrary.Checkout(); so you don't need the second method call. 

    Regards

    Mads

     

     

  • Joe 2 posts 22 karma points
    Mar 25, 2015 @ 21:37
    Joe
    0

    Hi Mads,

    Thanks for the response. Your solution did help but it was unfortunately not a 100% solution. It did take away the exception that I was getting, but the order does not complete. That is to say, when I try to create the order I get to the confirmation screen but I do not see the order in the "New" section in the uCommerce section in Umbraco.

    When I try to call the TransactionLibrary.Checkout(); function I now get a "Payment insufficient to cover order total" exception. This does make some sense based on the feedback that you supplied last time but unfortunately does not let me complete the order.

    Thanks, Joe

  • Mads Due 11 posts 72 karma points
    Apr 14, 2015 @ 16:03
    Mads Due
    0

    It seems like that the payment status isn't set to the right status in the PaymentRequest according to the received status from the gateway. Here are some code:

    if (request.AuthorizationResult == "Authorised")
    {
        SetPaymentStatus(payment, PaymentStatusCode.Acquired, "Recurring payment authorized.");
        return;
    }
    
    if (request.AuthorizationResult == "Refused")
    {
        SetPaymentStatus(payment, PaymentStatusCode.Declined,
          "Recurring payment could not be authorized: " + result.refusalReason);
        return;
    }
    

    SetPaymentStatus(payment, PaymentStatusCode.Declined, "Error occured during authorization of recurring payment: " + result.refusalReason); That's why you are getting the "Payment insufficient to cover order total" exception.

    You can find more information about this here: http://docs.ucommerce.net/ucommerce/v6.6/payment-providers/integrating-a-payment-gateway.html

    Regards Mads

Please Sign in or register to post replies

Write your reply to:

Draft