Posted on 14/07/2009 09:48:04
mn@co3.dk wrote:
ldedw wrote:
mn@co3.dk wrote:
Hi guys,
I'm trying to make a gateway, and i ran into a problem when i needed to access the value from the standard tag <!-@Ecom:Order.Gateway.Page.CallBack-> in my code.
I can't seem to find a property that contains the content of that tag, in any of the Objects my gateway inherits from GatewayProvider.
Anyone got an idea to how it's done?
Regards
Martin
There are no properties containing the urls from the gateway template. Do you need to simply read the value or do you need to overwrite it?
I just need to read it, since i have to encode the Callback url with some other stuff into an MD5.
I could generate the url from the Callback tag my self.
But that would give problems if DW ever changed the callback url structure.
I get your point. I have requested this as a new feature.
In the meantime I think the only workaround is to make a template and render the gateway tags to that template, and read the values.
Something like:
Frontend.Cart.Renderer renderer = new Frontend.Cart.Renderer(PageView.Current);
Templatev2.Template template = new Templatev2.Template();
template.Html = "<!--@Ecom:Order.Gateway.Page.Callback-->"
Order order = Common.Context.Cart;
Payment payment = New Payment(order.PaymentMethodID);
renderer.RenderGatewaySettings(template, order, payment);
string callbackUrl = template.Output();
Please note: I haven't tested this code, it might need adjustments. Also, the PageView given to the renderer should be the pageview of the cart page.