Jump to content

How do I pass constructor variables to an assembly using DOTNET?


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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.