public override void Close()
 {
     ikajo     = null;
     saleReq   = null;
     rebillReq = null;
     base.Close();
 }
        public override int ProcessPayment(Payment payment)
        {
            if (!EnabledFor3d(payment.TransactionType))
            {
                return(590);
            }

            int ret = 300;

            Tools.LogInfo("TransactionIkajo.ProcessPayment/10", "Sale, Merchant Ref=" + payment.MerchantReference, 199);

            try
            {
                string md5Signature = HashMD5(Tools.XMLSafe(payment.ProviderUserID)
                                              + Tools.XMLSafe(payment.PaymentAmountDecimal)
                                              + Tools.XMLSafe(payment.PaymentDescription)
                                              + Tools.XMLSafe(payment.MerchantReference)
                                              + Tools.XMLSafe(payment.MerchantReferenceOriginal)
                                              + Tools.XMLSafe(payment.CardToken)
                                              + Tools.XMLSafe(payment.ProviderPassword));

                if (rebillReq == null)
                {
                    rebillReq = new RebillRequest();
                }

                rebillReq.merchantID             = Tools.XMLSafe(payment.ProviderUserID);
                rebillReq.orderAmount            = Tools.XMLSafe(payment.PaymentAmountDecimal);
                rebillReq.orderDescription       = Tools.XMLSafe(payment.PaymentDescription);
                rebillReq.orderReference         = Tools.XMLSafe(payment.MerchantReference);
                rebillReq.originalOrderReference = Tools.XMLSafe(payment.MerchantReferenceOriginal);
                rebillReq.recurringToken         = Tools.XMLSafe(payment.CardToken);
                rebillReq.signature = md5Signature;

                Tools.LogInfo("TransactionIkajo.ProcessPayment/20", "", 10);

                if (ikajo == null)
                {
                    ikajo = new PtCardService();
                }

                PCIBusiness.IkajoService.RebillResult result = ikajo.rebill(rebillReq);
                string x = "[PaymentResult] StatusCode=" + result.statusCode
                           + " | TransactionStatus=" + result.transactionStatus
                           + " | TransactionError=" + result.transactionError;

                Tools.LogInfo("TransactionIkajo.ProcessPayment/30", x, 10);

                payRef     = result.orderReference;
                resultCode = result.transactionStatus;
                resultMsg  = result.transactionError;

//				if ( ret != 0 )
//					Tools.LogInfo("TransactionIkajo.GetToken/50","ResultCode="+ResultCode + ", payToken=" + payToken,220);
            }
            catch (Exception ex)
            {
                Tools.LogInfo("TransactionIkajo.ProcessPayment/98", "Ret=" + ret.ToString() + ", XML Sent=" + xmlSent, 255);
                Tools.LogException("TransactionIkajo.ProcessPayment/99", "Ret=" + ret.ToString() + ", XML Sent=" + xmlSent, ex);
            }
            return(ret);
        }