Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jesper Lauridsen 25 posts 84 karma points
    Feb 21, 2013 @ 18:10
    Jesper Lauridsen
    0

    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;

    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.

    Why is the Finalize() method not called?

    --
      Regards
        Jesper Lauridsen

  • Anders Burla 2560 posts 8256 karma points
    Feb 22, 2013 @ 11:54
    Anders Burla
    0

    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

  • Anders Burla 2560 posts 8256 karma points
    Feb 26, 2013 @ 23:49
    Anders Burla
    0

    Hi Jesper

    Did we solve you problem?

    Kind regards
    Anders

  • Jesper Lauridsen 25 posts 84 karma points
    Mar 04, 2013 @ 12:04
    Jesper Lauridsen
    0

    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;

    [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.

    Can you perhaps guide me in the right direction?

    --
      Regards
        Jesper Lauridsen 

  • Anders Burla 2560 posts 8256 karma points
    Mar 04, 2013 @ 12:30
    Anders Burla
    0

    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

  • Jesper Lauridsen 25 posts 84 karma points
    Mar 04, 2013 @ 12:35
    Jesper Lauridsen
    0

    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 

  • Anders Burla 2560 posts 8256 karma points
    Mar 04, 2013 @ 21:32
    Anders Burla
    0

    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?

  • Jesper Lauridsen 25 posts 84 karma points
    Mar 04, 2013 @ 22:13
    Jesper Lauridsen
    0

    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);

    [PaymentProvider( "NextInvoice" )]
    public class NextInvoice : APaymentProvider
    {
    ...

    Does there exist any documentation on how to implement your own paymentprovider?

    --
      Regards
        Jesper Lauridsen

     

  • Anders Burla 2560 posts 8256 karma points
    Mar 05, 2013 @ 17:08
    Anders Burla
    0

    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

  • Jesper Lauridsen 25 posts 84 karma points
    Mar 05, 2013 @ 17:12
    Jesper Lauridsen
    0

    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 

Please Sign in or register to post replies

Write your reply to:

Draft