WorldPay Integration

  • Thread starter Thread starter Andy Everett via .NET 247
  • Start date Start date
A

Andy Everett via .NET 247

Has anybody had experience of integrating with WorldPay using C#please? I have rewritten the example asp code in C#/ASP.NET. Every aspect of this has been a success except one. Whencalling the produce method on the WorldPay object I am asked tosupply an object parameter [method definition: objectCOMpurchaseClass.produce (ref object Parameter0)]. Obviouslythis does not happen within ASP. I have tried passing both'new' and 'null' objects neither works. In the case of 'null'it appears as if the WorldPay DLL has been written in a way thatdoes not accept a null parameter. Does anybody know what mustbe passed. I am using:

WorldPay.COMpurchaseClass objWP = newWorldPay.COMpurchaseClass();
objWP.init("");
objWP.setInstallationId(iInstallationID);
objWP.setOrderId(psOrderID);
objWP.setShopperId(psShopperID);
objWP.setCurrencyISOCode(sCurrencyISOCode);
objWP.setAmount(pdblAmount);
//objWP.setAuthMode(objWP.AUTHMODE_full);
objWP.setValidDates(lsTransactionStartTime,lsTransactionExpiryTime);
objWP.setTestMode(iTestMode); //100 is testMode
objWP.process();

if (objWP.hadError())
{
while (objWP.hasMoreErrors())
{
lsErrorMessage += objWP.getNextError() + ";";
}
throw new Exception(lsErrorMessage);
}
object objTest = null;
//object objTest2 = new object;
objWP.produce(objTest);


Many thanks,
 
Back
Top