Commerce Server General - Accessing COM object in orderform in C#

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > June 2006 > Accessing COM object in orderform in C#





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Accessing COM object in orderform in C#
dougelderz@gmail.com

2006-04-28, 1:14 pm

I am integrating a CyberSource Commerce pipeline component to manage my
payment transactions. CyberSource provides a hashtable COM object that
is used to set data into the orderform before a request and is used to
retrieve response data. I have set a reference to object in my project
and have no problem creating instance, setting data and then setting in
orderform.

On CyberSource response they have populated a hashtable object and
their Commerce Component sets it in the Commerce Server orderform
object (orderform{"_cybs_reply"]. I need to access that in my ASP.Net
C# code to pull response data. Something along the lines of this code
(which doesn't work):

CyberSourceWSLib.HashtableClass oReply = new
CyberSourceWSLib.HashtableClass();
oReply = (CyberSourceWSLib.HashtableClass)orderForm["_cybs_reply"];
string test = (String)oReply["decision"];

The above code fails with invalid cast error on second line. Anyone
know how to access this COM object stored in the orderform?

J.F. Larente

2006-06-18, 4:00 pm

Have you been able to view the data coming back without trying to cast it to
a "HashtableClass"?

oObject = orderForm["_cybs_reply"]

I actually haven't had time to actually think this through but if you're
just trying to access a dictionary, perhaps you don't necessarily have to
cast to a CybersSourceWSLib.HashtableClass...

J.F. Larente
Cactus Commerce

<dougelderz@gmail.com> wrote in message
news:1146242565.934023.76090@i40g2000cwc.googlegroups.com...
>I am integrating a CyberSource Commerce pipeline component to manage my
> payment transactions. CyberSource provides a hashtable COM object that
> is used to set data into the orderform before a request and is used to
> retrieve response data. I have set a reference to object in my project
> and have no problem creating instance, setting data and then setting in
> orderform.
>
> On CyberSource response they have populated a hashtable object and
> their Commerce Component sets it in the Commerce Server orderform
> object (orderform{"_cybs_reply"]. I need to access that in my ASP.Net
> C# code to pull response data. Something along the lines of this code
> (which doesn't work):
>
> CyberSourceWSLib.HashtableClass oReply = new
> CyberSourceWSLib.HashtableClass();
> oReply = (CyberSourceWSLib.HashtableClass)orderForm["_cybs_reply"];
> string test = (String)oReply["decision"];
>
> The above code fails with invalid cast error on second line. Anyone
> know how to access this COM object stored in the orderform?
>



J.F. Larente

2006-06-18, 7:18 pm

Have you been able to view the data coming back without trying to cast it to
a "HashtableClass"?

oObject = orderForm["_cybs_reply"]

I actually haven't had time to actually think this through but if you're
just trying to access a dictionary, perhaps you don't necessarily have to
cast to a CybersSourceWSLib.HashtableClass...

J.F. Larente
Cactus Commerce

<dougelderz@gmail.com> wrote in message
news:1146242565.934023.76090@i40g2000cwc.googlegroups.com...
>I am integrating a CyberSource Commerce pipeline component to manage my
> payment transactions. CyberSource provides a hashtable COM object that
> is used to set data into the orderform before a request and is used to
> retrieve response data. I have set a reference to object in my project
> and have no problem creating instance, setting data and then setting in
> orderform.
>
> On CyberSource response they have populated a hashtable object and
> their Commerce Component sets it in the Commerce Server orderform
> object (orderform{"_cybs_reply"]. I need to access that in my ASP.Net
> C# code to pull response data. Something along the lines of this code
> (which doesn't work):
>
> CyberSourceWSLib.HashtableClass oReply = new
> CyberSourceWSLib.HashtableClass();
> oReply = (CyberSourceWSLib.HashtableClass)orderForm["_cybs_reply"];
> string test = (String)oReply["decision"];
>
> The above code fails with invalid cast error on second line. Anyone
> know how to access this COM object stored in the orderform?
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com