Jump to content

How to pass constructor parameter to a dotnet assembly?


tcarnes

Recommended Posts

How can I pass a necessary parameter while instantiating an object from a .NET assembly using DOTNET in PHP 5?

 

The sample code that came with the .NET assembly shows how to do this is with VB and C#:

 

VB: Dim transaction As New Paymentech.Transaction(RequestType.CC_AUTHORIZE)

 

C#: Paymentech.Transaction(Paymentech.RequestType.CC_AUTHORIZE);

 

I've tried the following using PHP:

$transaction = new DOTNET("ptDotNetSDK20","Paymentech.Transaction(CC_AUTHORIZE) ")

 

and

 

$transaction = new DOTNET("ptDotNetSDK20","Paymentech.Transaction(RequestType.CC_AUTHORIZE) ")

 

and even

 

$transaction = new DOTNET("ptDotNetSDK20","Paymentech.Transaction(Paymentech.RequestType.CC_AUTHORIZE) ")

 

and each time get errors "Failed to instantiate .Net object". I've even tried enclosing the parameter in single quotes, with no improvement.

 

If I leave out the parameter and just try:

$transaction = new DOTNET("ptDotNetSDK20","Paymentech.Transaction")

I am able to create the transaction, but am then told "Transaction Object is invalid" when I later try to use it, which makes sense since I didn't create it with the necessary parameter in the first place.

 

Can anyone help me?

 

Terry

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.