- David Peace (Powersoft)
- PowerBuilder
- Wednesday, 17 June 2020 09:55 AM UTC
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
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.