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.
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.
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.
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.
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.
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:
I have also tried to use
Instead of
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.
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
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
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:
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
is working on a reply...