在自定义管道上工作的OrderForm上写varibles。 [英] writing varibles on the OrderForm on a custom pipeline not working.

查看:81
本文介绍了在自定义管道上工作的OrderForm上写varibles。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个简单的问题。 目前我有一个自定义支付管道。它执行以下操作:
 
public int执行(对象pdispOrder,对象pdispContext,int lFlags)
  {
   IDictionary order = pdispOrder as IDictionary;
  订单[" _TEST_SAVING"] =" test";  返回1;



当我从结账渠道回来后,我看不到_TEST_SAVING 在orderForm下。 我应该保存orderForm或其他什么,所以我不会丢失我添加到orderForm的变量?

我这样称呼pipelin:使用(PipelineInfo管道=新的PipelineInfo("checkout"))
             {
              basket.RunPipeline(管道);
           我在调用它之后得到了一个错误:

string test = OrderForm [" _TEST_SAVING"]。ToString()  (当我查看OrderForm时,值_TEST_SAVING不存在)。

This might be a simple question.  At the moment i have a custom payment pipeline. it does the following:
 
public int Execute(object pdispOrder, object pdispContext, int lFlags)
 {
   IDictionary order = pdispOrder as IDictionary;
   order["_TEST_SAVING"] = "test";
   return 1;
}

After I come back from the checkout pipeline I cannot see the _TEST_SAVING  under the orderForm.  Am i supposed to save the orderForm or something so i don't loose the variables I am adding to the orderForm?

I am calling the pipelin this way:
 using (PipelineInfo pipeline = new PipelineInfo("checkout"))
            {
               basket.RunPipeline(pipeline);
            }

and i am getting an error on this code after i call it:

string test = OrderForm["_TEST_SAVING"].ToString()  ( when i look at OrderForm the value _TEST_SAVING does not exist).

推荐答案

我找到了一个解决方案,但我不确定它是否是正确的。

在我对管道进行调用之前,我实际上在orderForm上创建了对象。订单窗体[" _TEST_SAVING"] =新对象();

然后在管道我添加"测试"字符串或我需要保存的任何其他对象,它们会从管道传回。 任何想法我怎么能避免每次都需要在orderForm上传回一些东西?
I found a solution but i am not sure if it is the right one.

before i do the call to the pipeline i actually create the objects on the orderForm
 OrderForm["_TEST_SAVING"] = new object();

then on the pipeline i add the "test" string or any other object i need to save and they get pass back from the pipeline.  Any idea how could I avoid doing that every single time i need to pass something back on the orderForm?


这篇关于在自定义管道上工作的OrderForm上写varibles。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆