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(newOrderProperty("TransactionNumber", eWayResponse.TransactionNumber)); order.AddProperty(newOrderProperty("AuthorisationCode", eWayResponse.AuthorisationCode)); var callback =newTeaCommerce.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?
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?
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?
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.
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();
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.
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.
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.
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
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.
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
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
Any thoughts?
Cheers
Figured it out...
The CN and EMAIL fields weren't being populated as the corresponding order properties weren't set correctly.
Cheers
Great you got it working
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
to this
I assume this may affect others also.
Cheers Scott.
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
I have asked... will let you know.
is working on a reply...