How to set order as completed in custom payment provider
I have setup a custom payment provider for PayPal. Everything is working fine except after the callback runs the order still has a status of 'new'. This means that when you return from Paypal you can still see the current order in the cart.
If the callback executes successfully this is the return statement: return new CallbackInfo(orderName, amount, transactionId, PaymentStatus.Authorized, null, null);
If I look in the DB I can see that the TransactionID and payment amount are both set and the payment status is set to 1 (authorized). Is there something additional I need to do to set the order to completed?
Do you click the continue link/button in Paypal when finished with the order or do you just to another window/tab and refresh the page to see if the cart i gone or how is your senario?
I have been clicking continue but it shouldnt matter. The IPN is sent out when payment is completed and when processed the order should be set as completed. I would expect the cart to be emptied after an order is submitted as well i.e. when TeaCommerce.goToPayment() is called.
Just to make a couple of things a little more clear. The order status "New" is a status for the webshop owner to use. It could be when they have packed the items and shipped it, they change the order status to "Completed". If you want to have the order to have the "Completed" order status when the order is finalized ( when Tea Commerce gets the IPN ) you could hook into the .Net events and change it.
When clicking continue in paypal - Tea Commerce should move this order from the current order to the finalizedOrder - and we are looking into the PayPal problem and has a couple of changes already to make the payment providers better. Your senario to "empty" the cart when goToPayment is called is not possible as the customer could choose to cancel the process at paypal because they forgot an item and wants to go back and buy it. But as I said we are chaning some things in our standard payment providers to make them better. ( will send you our PayPal provider when we are finished for you to look after to upgrade your own )
ok thanks that makes sense, but my main issue is not resolved. Once a user has successfully made a payment, and PayPayl IPN has been processed the cart is not being cleared.
When you recieve the IPN and you process it in your payment provider is the order changed from a cart to an order? Dont think about the customer now - just talking about the server to server communication.
The other issue you have is that when the customer hits "Continue" at paypal they cart isn't removed by Tea Commerce?
I'm not sure what identifies an order as cart or not. But the IsOrder property is set to true after the IPN is processed.
I can understand that after a customer clicks continue and returns to our website their cart may still be showing their order if the IPN hasn't arrived. It seems to take around 15-20 seconds for the IPN to be sent from Paypal and processed. But after that IPN is processed when I refresh the page I would think the cart would then show as empty - right now it doesn't. I can easily demo this for you if you want to take this offline ...
A possible solution for this will be to have a macro or user control that clears the customers cart. The control could be placed on the payment thanks page so it is cleared when the customer returns to the site. This would be really easy for us to create if their is a server side function to clear the cart that can be called?
Yes the IsOrder property indicates if its an order or cart. And by the way we are actualy making a RemoveOrder method that will the cart completly. Should be released next week :)
about the cart still having content when clicking the continue link at paypal i think is an error but we can test it with the next release, so lets take that by email
How to set order as completed in custom payment provider
I have setup a custom payment provider for PayPal. Everything is working fine except after the callback runs the order still has a status of 'new'. This means that when you return from Paypal you can still see the current order in the cart.
If the callback executes successfully this is the return statement:
return new CallbackInfo(orderName, amount, transactionId, PaymentStatus.Authorized, null, null);
If I look in the DB I can see that the TransactionID and payment amount are both set and the payment status is set to 1 (authorized). Is there something additional I need to do to set the order to completed?
Zac
Do you click the continue link/button in Paypal when finished with the order or do you just to another window/tab and refresh the page to see if the cart i gone or how is your senario?
I have been clicking continue but it shouldnt matter. The IPN is sent out when payment is completed and when processed the order should be set as completed. I would expect the cart to be emptied after an order is submitted as well i.e. when TeaCommerce.goToPayment() is called.
Just to make a couple of things a little more clear. The order status "New" is a status for the webshop owner to use. It could be when they have packed the items and shipped it, they change the order status to "Completed". If you want to have the order to have the "Completed" order status when the order is finalized ( when Tea Commerce gets the IPN ) you could hook into the .Net events and change it.
When clicking continue in paypal - Tea Commerce should move this order from the current order to the finalizedOrder - and we are looking into the PayPal problem and has a couple of changes already to make the payment providers better. Your senario to "empty" the cart when goToPayment is called is not possible as the customer could choose to cancel the process at paypal because they forgot an item and wants to go back and buy it. But as I said we are chaning some things in our standard payment providers to make them better. ( will send you our PayPal provider when we are finished for you to look after to upgrade your own )
ok thanks that makes sense, but my main issue is not resolved. Once a user has successfully made a payment, and PayPayl IPN has been processed the cart is not being cleared.
When you recieve the IPN and you process it in your payment provider is the order changed from a cart to an order? Dont think about the customer now - just talking about the server to server communication.
The other issue you have is that when the customer hits "Continue" at paypal they cart isn't removed by Tea Commerce?
I'm not sure what identifies an order as cart or not. But the IsOrder property is set to true after the IPN is processed.
I can understand that after a customer clicks continue and returns to our website their cart may still be showing their order if the IPN hasn't arrived. It seems to take around 15-20 seconds for the IPN to be sent from Paypal and processed. But after that IPN is processed when I refresh the page I would think the cart would then show as empty - right now it doesn't. I can easily demo this for you if you want to take this offline ...
A possible solution for this will be to have a macro or user control that clears the customers cart. The control could be placed on the payment thanks page so it is cleared when the customer returns to the site. This would be really easy for us to create if their is a server side function to clear the cart that can be called?
Yes the IsOrder property indicates if its an order or cart. And by the way we are actualy making a RemoveOrder method that will the cart completly. Should be released next week :)
about the cart still having content when clicking the continue link at paypal i think is an error but we can test it with the next release, so lets take that by email
@Zac - I have sent you an email with a beta of the next Tea Commerce release - could you try and test it and see if its fix you problem
@Zac - did the update i sent you help you with your problem?
yes issue has been resolved with new version. Also making sure that I didn't have the continueUrl going straight to my own page was important.
is working on a reply...