Developer forum

Forum » Development » Cart emptied when canceling the payment from payment provider and redirecting to cart

Cart emptied when canceling the payment from payment provider and redirecting to cart

Thaw Htun Lynn
Reply

Hi,

We have developed a custom payment provider for Braintree payment gateway and implemented for a client. We are having an issue that the cart is emptied when user cancel the payment and come back to the check out page. We tried the setting "Keep cart in context after checkout step" but If we enable this setting, this cart emptied issue will not happen but we will face another issue. After the payment is successful and redirected back to cart, the order is not marked as completed and show empty cart instead of receipt page. We can see the order from management center, Ecommerce --> order but the order is not marked completed even payment is successful. If we don't enable the "Keep cart in context after checkout step" setting, the payment is successful and order is completed and the reciept will be displayed when redirected back to cart. Kindly find the attachment for the braintreepaymenthandler.cs file and please let me know if you need any more information to help me resolve the issue. Thanks.

Regards,
Thaw

 


Replies

 
Nicolai Pedersen
Reply

Hi Thaw

You need to the checkbox to be set if you want to be able to cancel the cart.

It is hard to tell what is wrong in your checkouthandler since it does not completes the order. You should take a look at our implementations and make sure that you handle the payment completement in the 'right way'. But that will depend a lot on how your payment gateway works.

It is out of scope of this forum to debug your code. You have to do that yourself or I can ask our services department to do the job (by the hour).

BR Nicolai

 

You must be logged in to post in the forum