Copied to clipboard

Flag this post as spam?

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


  • Nicolas Gangloff 19 posts 99 karma points
    Mar 20, 2013 @ 21:34
    Nicolas Gangloff
    0

    Tea Commerce 2 Events

    I just installed Tea Commerce 2 Starter Kit, and it looks good. I like the 100% razor approach. However, I am not too familiar with the concept and I know the release is fresh, but I have to say, the lack of documentation is difficult.

    I want to do 2 things:

    1. We want to be able to use 1.x events. 
    2. We are trying to create our own payment form and I am not sure how to approach this the "Razor way". I would need to post the CC number, expiration and security code to a page and process the transaction through Authorize.net AIM (HttpWebRequest POST and response says if transaction successful). I already downloaded TC 2.0 Payment providers and created a shell provider based on your authorize.net provider, but the payment workflow is a little blury.
    Could you provide any guideline on those issues?
    Thank you very much for your support

  • Anders Burla Johansen 2560 posts 8256 karma points
    Mar 21, 2013 @ 09:08
    Anders Burla Johansen
    0

    Hi Nicolas

    First - we are really sorry for the lack of documentation! But we are working on our new documentation portal where all will be documented as fast as possible. We released the software without to much documentation because we wanted you guys to have the software as quick as possible. The documentation at the moment right now is the starter kit.

    Events in Tea Commerce 2 is really simple. Just start the way you normally do in Umbraco: http://our.umbraco.org/documentation/Reference/Events/application-startup
    Then use TeaCommerce.Api.Notifications.NotificationCenter.Order.Created or some other events. Thats it! :)

    Your own payment provider is ok simple when you just want to make one that redirects the website to the payment gateway - that is what all the out of the box payment providers does. In your case you will implement the entire card information process your self which is a bit harder and you really need to know the basic concepts of payment gateways. The start for you is to make your own payment provider and in the GenerataHtmlForm method you need to set the PaymentHtmlForm.Action to the url at your website where the customer can enter his credit card information. When you have that working. Let me know and I will guide you in the next steps :)

    Kind regards
    Anders

  • Nicolas Gangloff 19 posts 99 karma points
    Mar 22, 2013 @ 14:50
    Nicolas Gangloff
    0

    Hi Anders,

    Thank you for your quick answer. I was able to do the events part without any issues.

    For the payment provider, part, I did that as well. I created my GenerateHtmlForm and it returns a PaymentHtmlForm object with Action set to /shop/cart/payment. In this page, I created my payment form shell as well with CC number, CC expiration and security code.

    Once again, thank you for your help and I am waiting for more guidance :)

  • Anders Burla Johansen 2560 posts 8256 karma points
    Mar 22, 2013 @ 15:45
    Anders Burla Johansen
    100

    Next step is to have a html submit button at your /shop/payment step. This should post to a /base method. In the base method you will properly need to call a 3 party payment gateway to verify the card info. If its valid you will need to do two things. You need to mimic a server to server callback - you do this by making a post request from your base method the teaCommerceCallbackUrl you got as a parameter in the GenerateHtmlForm method. This url you will need to either save as an order property on the order or somehow parse it along to your /base method. This should make Tea Commerce to invoke your ProcessCallback in your provider. In this method you need to validate the info and implement some kind of security so people cant cheat by just knowing your callback url. This server to server post should properly be made async. Now you also need to redirect the customer. This is the teaCommerceContinueUrl that you got in the GenerateHtmlForm method. This changes the order in session state and now the client is redirected to the url that you return in your payment providers GetContinueUrl.

    This is the most complicated part :)

    Kind regards
    Anders

  • Nicolas Gangloff 19 posts 99 karma points
    Mar 25, 2013 @ 17:25
    Nicolas Gangloff
    0

    Hi Anders,

    After a little bit of work, I have been able to make this work. Here is what I did:

    • In GenerateHtmlForm: add callback url and continue url to order properties. I removed those urls from being written to generated form to prevent anybody to figure them out.

    • In /Base method, check for payment. if ok, post to callback url and validated transaction in callback

    • After POST to callback URL is done, I do a response.redirect to continue url and user is redirected to confirmation page automatically

    Now, I have a question: the callback method is invoked 2 times. it seems the redirection to continue url makes the invocation happen. Is that normal or is there something to do to prevent this behavior?

    Thank you very much for the support,

    Nico

  • Anders Burla Johansen 2560 posts 8256 karma points
    Mar 28, 2013 @ 16:01
    Anders Burla Johansen
    0

    Did you override the FinalizeAtContinueUrl and return true? This would cause this behaviour because then TC will "make" a callback when the customer is redirected to the continue url.

    Kind regards
    Anders

  • Nicolas Gangloff 19 posts 99 karma points
    Mar 28, 2013 @ 16:15
    Nicolas Gangloff
    0

    That was the issue. I was bringing in code from 1.x and it was there reason that was there.

    Thanks for the explanation, everything works as expected!

  • Anders Burla Johansen 2560 posts 8256 karma points
    Mar 28, 2013 @ 16:29
    Anders Burla Johansen
    0

    GREAT to hear!

Please Sign in or register to post replies

Write your reply to:

Draft