I have implemented Tea Commerce on my site using the PayPal Payment Provider. I've been testing the checkout process using a sandbox account, and I'm seeing an odd behaviour. Orders are never finalized, unless I click on the Finalize button in the Tea Commerce admin and enter the transaction id from PayPal. Are these transactions supposed to be processed automatically using IPN, or is this the way it is supposed to work? I feel like I'm missing something, and would appreciate any light you could shed on this.
First of all - sorry for not having the paypal documentation ready at the moment - we often fall into the code new features instead of documentation :)
Yes we use IPN as the callback. Have you done the setup of that?
Profile -> Instant Payment Notification preferences -> set your Notification URL - http:// teacommerce.dk/tcbase/teacommerce/PaymentCallback/PayPal.aspx Replace teacommerce.dk with your domain. And remove the space after http:// - had to format it special because of our.umbraco :)
Thanks for quick response Anders. I definitely know how it goes with finding time to write documentation :)
I hadn't set up my sandbox IPN. I haven't really worked with PayPal before, so your suggestion saved me a real headache. Unfortunately, after configuring it the way you suggested, I'm still unable to get an Authorized status on my orders without clicking the Finalize button manually. When I look at the IPN history in paypal, the IPN messages are being sent and apparently received correctly. Here's what I see in the Backend for Tea Commerce
Order name
Customer
Created
Order status
Payment status
Order stage
Price
ORDER-163
Mon, 04 Jul 2011 14:23
New
Initial
Cart
$12.00
Any more ideas on what I can check to see why this isn't working? Let me know if you need any more info from me.
Thanks for info. Will look into it and test against our own test data and se if I can see what is going wrong. Could you also post the info for the payment method in Tea Commerce. Just so I can see how it is setup. Remember to hide sensitive info in the screenshot.
Found one thing it could be. Try and change the Secure Merchant ID/Email to your business email. [email protected] - ofcourse replace the X's with your correct numbers :)
Thanks for your suggestion. I went to try it out this morning, and ran into an unexpected error adding a product to my cart while testing. When I try to add to the cart, nothing happens, but I can see this error caught in my firebug:
Exception has been thrown by the target of an invocation. STACKTRACE: at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at TeaCommerce.Presentation.TeaCommerceBase.RequestModule.invokeMethod(restExtension myExtension, Object[] paras) INNEREXCEPTION: System.MissingMethodException: Method not found: 'Boolean Umbraco.Licensing.Validator.IsValid()'. at TeaCommerce.Licensing.ALicenseValidator.() at TeaCommerce.Data.Licensing.LicenseValidator.get_Instance() at TeaCommerce.Data.Order.Save() at TeaCommerce.SessionController.get_CurrentOrder() at TeaCommerce.SessionController.CheckCurrentOrderPaymentStatus() at TeaCommerce.Base.AddOrderLine(Int32 nodeId, Nullable`1 orderLineId, Decimal quantity, Boolean isUnique) at TeaCommerce.Base.AddOrderLine(Int32 nodeId, Decimal quantity)
The only change I've made recently is to purchase a license from you, and install it to the site. Sorry to bother you with yet another issue. I can move his to a seperate post if you think it would be best.
Hmm it looks like the Umbraco.Licensing dll has been overwritten maybe. Have you installed another package that is commercial on your site? CMSImport, MediaProtect or others?
I forgot to mention, but yes, Contour was installed at the same time as I licensed Tea Commerce. I assumed that they would play nice with each other, but maybe I was wrong. Would reinstalling Tea Commerce overwrite Umbraco.Licensing dll? Would this break Contour?
I think that Contour overwrites the Umbraco.Licensing dll. If they overwrite it with an older one than Tea Commerce is might go wrong. Try and install Tea Commerce again and see if it fix the problem.
Reinstalling Tea Commerce fixed the License issue, but changing my Secure Merchant ID/Email, as suggested, did not help with the order being finalized.
Super! Could you send me an email to info [(at)] teacommerce.dk - I will then send you a new version of the paypal provider which outputs two text files on the server recieving the callback. Then we can see what data is recieved and what is wrong.
I finally figured this out, with help from Anders.
The issue was in my WebshopEvents_BeforeOrderFinalized method in my ITeaCommerceExtension. I was calling Member.GetCurrentMember() to access some custom properties that I needed to update. The call was creating an Object Reference error that wasn't being caught anywhere, and thus the finalization never occurred. It seems like Member.GetCurrentMember() is not available in ITeaCommerceExtension during the paypal callback. Instead, I used Member.GetMemberFromEmail(order.Email) to retrieve the curent Member. I think this method is deprecated, and you are supposed to use the Umbraco Profile Provider now, but it works for me.
Problem Finalizing Orders
Hi Anders and Rune,
I have implemented Tea Commerce on my site using the PayPal Payment Provider. I've been testing the checkout process using a sandbox account, and I'm seeing an odd behaviour. Orders are never finalized, unless I click on the Finalize button in the Tea Commerce admin and enter the transaction id from PayPal. Are these transactions supposed to be processed automatically using IPN, or is this the way it is supposed to work? I feel like I'm missing something, and would appreciate any light you could shed on this.
Thanks,
Jeremy
Hi Jeremy,
First of all - sorry for not having the paypal documentation ready at the moment - we often fall into the code new features instead of documentation :)
Yes we use IPN as the callback. Have you done the setup of that?
Profile -> Instant Payment Notification preferences -> set your Notification URL - http:// teacommerce.dk/tcbase/teacommerce/PaymentCallback/PayPal.aspx
Replace teacommerce.dk with your domain. And remove the space after http:// - had to format it special because of our.umbraco :)
/Anders
Thanks for quick response Anders. I definitely know how it goes with finding time to write documentation :)
I hadn't set up my sandbox IPN. I haven't really worked with PayPal before, so your suggestion saved me a real headache. Unfortunately, after configuring it the way you suggested, I'm still unable to get an Authorized status on my orders without clicking the Finalize button manually. When I look at the IPN history in paypal, the IPN messages are being sent and apparently received correctly. Here's what I see in the Backend for Tea Commerce
Any more ideas on what I can check to see why this isn't working? Let me know if you need any more info from me.
Jeremy
Could you try and post the IPN callback url you entered and a screenshot of the IPN history?
Here are the screenshots of my IPN.
Jeremy
Thanks for info. Will look into it and test against our own test data and se if I can see what is going wrong. Could you also post the info for the payment method in Tea Commerce. Just so I can see how it is setup. Remember to hide sensitive info in the screenshot.
/Anders
Here you go Anders, hope this helps.
Jeremy
Hi Jeremy
Found one thing it could be. Try and change the Secure Merchant ID/Email to your business email. [email protected] - ofcourse replace the X's with your correct numbers :)
You will also have to change your continue URL to include the entire address. http://demo.teacommerce.dk/en/cart/confirmation.aspx
Hi Anders,
Thanks for your suggestion. I went to try it out this morning, and ran into an unexpected error adding a product to my cart while testing. When I try to add to the cart, nothing happens, but I can see this error caught in my firebug:
Exception has been thrown by the target of an invocation. STACKTRACE: at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at TeaCommerce.Presentation.TeaCommerceBase.RequestModule.invokeMethod(restExtension myExtension, Object[] paras) INNEREXCEPTION: System.MissingMethodException: Method not found: 'Boolean Umbraco.Licensing.Validator.IsValid()'. at TeaCommerce.Licensing.ALicenseValidator.() at TeaCommerce.Data.Licensing.LicenseValidator.get_Instance() at TeaCommerce.Data.Order.Save() at TeaCommerce.SessionController.get_CurrentOrder() at TeaCommerce.SessionController.CheckCurrentOrderPaymentStatus() at TeaCommerce.Base.AddOrderLine(Int32 nodeId, Nullable`1 orderLineId, Decimal quantity, Boolean isUnique) at TeaCommerce.Base.AddOrderLine(Int32 nodeId, Decimal quantity)
The only change I've made recently is to purchase a license from you, and install it to the site. Sorry to bother you with yet another issue. I can move his to a seperate post if you think it would be best.
Thanks, Jeremy
Hmm it looks like the Umbraco.Licensing dll has been overwritten maybe. Have you installed another package that is commercial on your site? CMSImport, MediaProtect or others?
I forgot to mention, but yes, Contour was installed at the same time as I licensed Tea Commerce. I assumed that they would play nice with each other, but maybe I was wrong. Would reinstalling Tea Commerce overwrite Umbraco.Licensing dll? Would this break Contour?
Jeremy
I think that Contour overwrites the Umbraco.Licensing dll. If they overwrite it with an older one than Tea Commerce is might go wrong. Try and install Tea Commerce again and see if it fix the problem.
Reinstalling Tea Commerce fixed the License issue, but changing my Secure Merchant ID/Email, as suggested, did not help with the order being finalized.
Jeremy
Super! Could you send me an email to info [(at)] teacommerce.dk - I will then send you a new version of the paypal provider which outputs two text files on the server recieving the callback. Then we can see what data is recieved and what is wrong.
/Anders
Did you ever get to the bottom of this, having exactly the same issue :(
I finally figured this out, with help from Anders.
The issue was in my WebshopEvents_BeforeOrderFinalized method in my ITeaCommerceExtension. I was calling Member.GetCurrentMember() to access some custom properties that I needed to update. The call was creating an Object Reference error that wasn't being caught anywhere, and thus the finalization never occurred. It seems like Member.GetCurrentMember() is not available in ITeaCommerceExtension during the paypal callback. Instead, I used Member.GetMemberFromEmail(order.Email) to retrieve the curent Member. I think this method is deprecated, and you are supposed to use the Umbraco Profile Provider now, but it works for me.
Thanks again for your help, Anders!
Jeremy
is working on a reply...