In the webshopEvents_BeforePaymentFormGenerated-event, I have the following code, which should be executed if "DefaultPaymentProvider" is selected;
void WebshopEvents_BeforePaymentFormGenerated(Data.Order order, Dictionary paymentProviderSettings, string paymentProviderAlias){if (paymentProviderAlias == "DefaultPaymentProvider")
{
...<some other code>
TeaCommerce.Data.Payment.CallbackInfo info = new TeaCommerce.Data.Payment.CallbackInfo(order.Name, order.TotalPrice, "Næste faktura", TeaCommerce.Data.Payment.PaymentStatus.Authorized, "Næste faktura", String.Empty); order.Finalize(info);
... <I have a logentry here, so I konw that I get here> } }
The CallBackInfo.IsValid method returns true.
I know that my Finalize-code is working, as it is executed, when the customers is paying with the DIBS paymentprovider.
Could you try and check your database - your order should be finalized. What might not happen is that the order doesnt change correctly in the session because Tea Commerce 1.x wasnt build for this scenario. For this to work you should build your own payment provider that does some magic. You should configue it in your implementation to FinalizeAtContinueUrl.
Returning from a much-needed vacation :) Before I left for vacation, I tried to get a custom payment-provider running based on the code found in the link you posted, but I ran into the following error;
[NullReferenceException: Object reference not set to an instance of an object.]
TeaCommerce.Data.PaymentProvider.GetPaymentProviders() +509
TeaCommerce.Admin.Umbraco.plugins.TeaCommerce.Settings.Orders.EditPaymentMethod.LoadPaymentProviders() +228
TeaCommerce.Admin.Umbraco.plugins.TeaCommerce.Settings.Orders.EditPaymentMethod.OnLoad(EventArgs e) +56
System.Web.UI.Control.LoadRecursive() +70
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3063
I am not sure, which part of my payment-provider-code (I have copied the code for the DIBS paymentprovider and simply commented out the parts I know, that I dont need) would cause this error.
If you have implemented your own code you need to debug where it returns null. When I look at the callstack it looks like it tries to load a payment provider but it cant load it. Did you enter the right alias, assembly etc in the admin area in Tea Commerce?
I should of course have mentioned that I get the above error from within the admin area in TeaCommerce, when I select the paymentmethod 'attached' with my paymentprovider.
This is properly because Tea Commerce cant load your payment provider. Did you copy the dll file to your /bin folder and have you verified that you have entered the provider in the Tea Commerce -> Settings -> General settings -> admin tab area and its the right info?
No, I am not sure of anything - I haven't been able to find any documentation on how to implement a custom payment provider.
I have copied my .DLL; TeaCommerce.PaymentProviders.NextInvoice.DLL to the /bin folder, and I have entered, what i 'think' should be the right info on the Admin Tab;<Provider alias="NextInvoice" assembly="TeaCommerce.PaymentProviders.NextInvoice" type="TeaCommerce.PaymentProviders.NextInvoice" />
As I wrote I took one of the existing paymentprovider implementations and made my changes to that (this is more or less my changes);
[PaymentProvider( "NextInvoice" )] public class NextInvoice : APaymentProvider { ... }
Does there exist any documentation on how to implement your own paymentprovider?
Are you using the 2.0 source branch of the payment provider API? It looks like you are - and I know your website is running 1.x of Tea Commerce so you need to use the right code base for a start :)
Order not getting finalized
Hi
I have Extenced the TeaCommerce-event system.
In the webshopEvents_BeforePaymentFormGenerated-event, I have the following code, which should be executed if "DefaultPaymentProvider" is selected;
The CallBackInfo.IsValid method returns true.
I know that my Finalize-code is working, as it is executed, when the customers is paying with the DIBS paymentprovider.
Why is the Finalize() method not called?
--
Regards
Jesper Lauridsen
Hi Jesper
Could you try and check your database - your order should be finalized. What might not happen is that the order doesnt change correctly in the session because Tea Commerce 1.x wasnt build for this scenario. For this to work you should build your own payment provider that does some magic. You should configue it in your implementation to FinalizeAtContinueUrl.
Our payment provider are open source so you can see how you implement one here:
https://bitbucket.org/teasolutions/tea-commerce-tea-commerce-payment-providers
Kind regards
Anders
Hi Jesper
Did we solve you problem?
Kind regards
Anders
Hi Anders
Returning from a much-needed vacation :)
Before I left for vacation, I tried to get a custom payment-provider running based on the code found in the link you posted, but I ran into the following error;
I am not sure, which part of my payment-provider-code (I have copied the code for the DIBS paymentprovider and simply commented out the parts I know, that I dont need) would cause this error.
Can you perhaps guide me in the right direction?
--
Regards
Jesper Lauridsen
If you have implemented your own code you need to debug where it returns null. When I look at the callstack it looks like it tries to load a payment provider but it cant load it. Did you enter the right alias, assembly etc in the admin area in Tea Commerce?
Kind regards
Anders
Hi Anders
I should of course have mentioned that I get the above error from within the admin area in TeaCommerce, when I select the paymentmethod 'attached' with my paymentprovider.
I am not sure how I can debug it?
--
Regards
Jesper Lauridsen
This is properly because Tea Commerce cant load your payment provider. Did you copy the dll file to your /bin folder and have you verified that you have entered the provider in the Tea Commerce -> Settings -> General settings -> admin tab area and its the right info?
Hi Anders
No, I am not sure of anything - I haven't been able to find any documentation on how to implement a custom payment provider.
I have copied my .DLL; TeaCommerce.PaymentProviders.NextInvoice.DLL to the /bin folder, and I have entered, what i 'think' should be the right info on the Admin Tab;<Provider alias="NextInvoice" assembly="TeaCommerce.PaymentProviders.NextInvoice" type="TeaCommerce.PaymentProviders.NextInvoice" />
As I wrote I took one of the existing paymentprovider implementations and made my changes to that (this is more or less my changes);
Does there exist any documentation on how to implement your own paymentprovider?
--
Regards
Jesper Lauridsen
Are you using the 2.0 source branch of the payment provider API? It looks like you are - and I know your website is running 1.x of Tea Commerce so you need to use the right code base for a start :)
There is some old old documentation that isnt fully updated but it could maybe help you:
http://anders.burla.dk/umbraco/making-a-payment-provider-for-tea-commerce/
Kind regards
Anders
Hi Anders
Thank you for trying to guide me in the right direction.
I will have a look at the documentation, and see if I can get the 1.x branch downloaded instead.
--
Regards
Jesper Lauridsen
is working on a reply...