Hi Guys
I'm creating a simple wrapper for a .Net DLL in order to remove the complex return values. Using SnapDevelop I have created a simple C# Class Object that references the extrernal DLL. My C# Code is:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Integral.Library.GuardianClient;
namespace PBSagePay
{
public class PBSagePay
{
public Boolean ProcTrans(String TransactionType, Decimal Amount, ref String ResultText, ref Int32 ResponseCode)
{
TillInformation TillInfo = new TillInformation();
TransactionInfo TransInfo = new TransactionInfo();
TransactionHook TransHook = new TransactionHook();
TransactionHook.TRANSACTIONHOOK_TRANSACTIONTYPE TransType = new TransactionHook.TRANSACTIONHOOK_TRANSACTIONTYPE();
//Setup Till Info
TillInfo.MerchantName = "Test Hotel";
TillInfo.Address1 = "Test Addr1";
// Setup the transaction type - Default Sale
TransType = TransactionHook.TRANSACTIONHOOK_TRANSACTIONTYPE.INT_TT_SALE;
if (TransactionType.ToUpper() == "REFUND")
{
TransType = TransactionHook.TRANSACTIONHOOK_TRANSACTIONTYPE.INT_TT_REFUND;
}
if (TransactionType.ToUpper() == "PREAUTH")
{
TransType = TransactionHook.TRANSACTIONHOOK_TRANSACTIONTYPE.INT_TT_PREAUTH;
}
// Prepare The Amount
Int32 PenceAmount = (Int32) Decimal.Floor(Amount * 100);
if (TransHook.Process(TransType, 25000, ref TillInfo, ref TransInfo))
{
ResponseCode = (Int32)TransInfo.ResponseCode;
ResultText = "All OK";
return true;
}
ResultText = "Failed";
ResponseCode = (Int32)TransInfo.ResponseCode;
return false;
}
}
}
I placed my resulting DLL along with the DLLs from the 3rd party application.
When I try and Load in the DLL created I get the following Could not load file or assembly.... The system cannot find the file specified. Nothing appears in the Select & Preview list.
I do not seem to have my ducks in order, any suggestions?
Cheers
David
I'm still learning how this tool "really" works and what it can do for us. When you can support more complex datatypes it will be brilliant. Accessing them in PB Script is a dream :)
Thanks
David