Copied to clipboard

Flag this post as spam?

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


  • Scott Anderson 18 posts 51 karma points
    Jun 18, 2014 @ 17:49
    Scott Anderson
    0

    Ogone integration

    Hi

    I am trying to set up an Ogone integration with TeaCommerce.

    Does anyone have any example order finalization code that would work with Ogone.

    E.g I found this for eWay.

    var orderid = int.Parse(Request["OrderId"]);
    var order = TeaCommerce.Data.Order.GetOrder(orderid);
    var card = eWAYRequest.CardNumber.Remove(0, eWAYRequest.CardNumber.Length - 4).PadLeft(eWAYRequest.CardNumber.Length - 4, 'X');
    order
    .AddProperty(new OrderProperty("TransactionNumber", eWayResponse.TransactionNumber));
    order
    .AddProperty(new OrderProperty("AuthorisationCode", eWayResponse.AuthorisationCode));
    var callback = new TeaCommerce.Data.Payment.CallbackInfo(orderReference, Math.Round(eWayResponse.Amount / 100M, 2),eWayResponse.TransactionNumber, TeaCommerce.Data.Payment.PaymentStatus.Captured, "Credit Card (eWay)", card);
    order
    .Finalize(callback);

     

    Also is it possible to redirect to Ogone's payment page to take the CC details rather than having them entered on our own site?

    How would this be done?

    >> Edit:

    I found this Razor code which looks promising

    TC.GeneratePaymentForm(storeId, "<input type=\"submit\" class=\"checkout-btn\" id=\"next\" value=\"Checkout\" />")

     

    But then I'm wondering if I set the AcceptUrl in the settings how do I receive a payment status response from Ogone and update the Order payment status?

     

    Thanks

    Scott.

     

  • Anders Burla 2560 posts 8256 karma points
    Jun 19, 2014 @ 09:30
    Anders Burla
    0

    Hi Scott

    Tea Commerce already have an implementation for Ogone as a payment provider. So why not use that? :)

    The provider takes care of receiving info from ogone and change order status etc.

    Kind regards
    Anders

  • Scott Anderson 18 posts 51 karma points
    Jun 19, 2014 @ 10:01
    Scott Anderson
    0

    Hi Anders

    That's what I am trying to use.

    I am using Tea Commerce in an MVC implementaion of Umbraco so it's quite a different set up to the Starter Kit and I'm trying to work out how the pieces fit together.

    If I set the AcceptUrl to /continue/ does the Ogone payment provider automatically process the recieved data from Ogone and update the Order status?

    Or do I have to manually call ProcessCallback() or similar on that page (or controller) to process the payment feedback that Ogone sends?

     

    Thanks

    Scott.

     

  • Anders Burla 2560 posts 8256 karma points
    Jun 19, 2014 @ 10:19
    Anders Burla
    0

    Tea Commerce gets the requests from Ogone and does the callback process and redirect the customer to the continue url and update the cart to an order by finalizing it.

    Kind regards
    Anders

  • Scott Anderson 18 posts 51 karma points
    Jun 20, 2014 @ 03:59
    Scott Anderson
    0

    Thanks Anders... I'm making progress.

    Currently I'm getting unknown order/1/s/ when I post the generated form, which means the SHA signature doesn't match.

    I have checked the PSPID and the SHA-IN passphrase are matching in Ogone portal and the TeaCommerce settings.

    SHA-512 and UTF8 are set in Ogone portal.

    This is the generated form

    <form action="https://secure.ogone.com/ncol/test/orderstandard_utf8.asp" method="post"><input type="hidden" id="PSPID" name="PSPID" value="worldsteelSU" /><input type="hidden" id="LANGUAGE" name="LANGUAGE" value="en_US" /><input type="hidden" id="ACCEPTURL" name="ACCEPTURL" value="http://demo-steeluni.org/base/TC/PaymentContinue/1/Ogone/f74a6f04-ed23-4fb7-b623-27308e3051f7.aspx" /><input type="hidden" id="CANCELURL" name="CANCELURL" value="http://demo-steeluni.org/base/TC/PaymentCancel/1/Ogone/f74a6f04-ed23-4fb7-b623-27308e3051f7.aspx" /><input type="hidden" id="ORDERID" name="ORDERID" value="CART-8" /><input type="hidden" id="AMOUNT" name="AMOUNT" value="3300" /><input type="hidden" id="CURRENCY" name="CURRENCY" value="EUR" /><input type="hidden" id="CN" name="CN" value=" " /><input type="hidden" id="EMAIL" name="EMAIL" value="" /><input type="hidden" id="DECLINEURL" name="DECLINEURL" value="http://demo-steeluni.org/base/TC/PaymentCancel/1/Ogone/f74a6f04-ed23-4fb7-b623-27308e3051f7.aspx" /><input type="hidden" id="EXCEPTIONURL" name="EXCEPTIONURL" value="http://demo-steeluni.org/base/TC/PaymentCancel/1/Ogone/f74a6f04-ed23-4fb7-b623-27308e3051f7.aspx" /><input type="hidden" id="SHASIGN" name="SHASIGN" value="16d28e4675a991fed4d30ce9d4cd3e8c9ce4ea0d2180261f735b8e04693ae06464aaa114d7723975091a4aeb4b3cffc20b3738b424919fc2074ac4de03e1aadd" />
    

    Any thoughts?

    Cheers

  • Scott Anderson 18 posts 51 karma points
    Jun 20, 2014 @ 14:08
    Scott Anderson
    0

    Figured it out...

    The CN and EMAIL fields weren't being populated as the corresponding order properties weren't set correctly.

    Cheers

  • Anders Burla 2560 posts 8256 karma points
    Jun 23, 2014 @ 08:23
    Anders Burla
    0

    Great you got it working

  • Scott Anderson 18 posts 51 karma points
    Jun 23, 2014 @ 15:11
    Scott Anderson
    1

    I had to resolve an interesting issue to get the finalization working correctly.

    After Ogone redirects back to my website the Ogone code was running and redirecting to the "Continue" URL but the payment status of the order wasn't being updated.

    I downloaded the source code for Ogone to check what the problem might be and found the SHA check failing because the SHA generated by our source had lowercase characters while Ogone's SHASIGN is all uppercase.

    To fix I changed this line

    string digest = new SHA512Managed().ComputeHash( Encoding.UTF8.GetBytes( strToHash ) ).ToHex();
    

    to this

    string digest = new SHA512Managed().ComputeHash( Encoding.UTF8.GetBytes( strToHash ) ).ToHex().ToUpper();
    

    I assume this may affect others also.

    Cheers Scott.

  • Anders Burla 2560 posts 8256 karma points
    Jun 24, 2014 @ 10:04
    Anders Burla
    0

    Could you try and contact Ogone and know if this has changed in their API. Their documentation states that the keys should be uppercase, but not the entire SHASIGN. So would be interesting to know.

    Kind regards
    Anders

  • Scott Anderson 18 posts 51 karma points
    Jun 24, 2014 @ 13:13
    Scott Anderson
    0

    I have asked... will let you know.

Please Sign in or register to post replies

Write your reply to:

Draft