protected virtual void ProcessAPIResponse(APIResponse apiResponse)
 {
     if (!apiResponse.isSucess && apiResponse.ErrorSource != CCErrors.CCErrorSource.None)
     {
         StringBuilder stringBuilder = new StringBuilder();
         foreach (KeyValuePair <string, string> kvp in apiResponse.Messages)
         {
             stringBuilder.Append(kvp.Key);
             stringBuilder.Append(": ");
             stringBuilder.Append(kvp.Value);
             stringBuilder.Append(". ");
         }
         throw new PXException(Messages.CardProcessingError, CCErrors.GetDescription(apiResponse.ErrorSource), stringBuilder.ToString());
     }
 }
 public static void Copy(CCProcTran aDst, ProcessingResult aSrc)
 {
     aDst.PCTranNumber          = aSrc.PCTranNumber;
     aDst.PCResponseCode        = aSrc.PCResponseCode;
     aDst.PCResponseReasonCode  = aSrc.PCResponseReasonCode;
     aDst.AuthNumber            = aSrc.AuthorizationNbr;
     aDst.PCResponse            = aSrc.PCResponse;
     aDst.PCResponseReasonText  = aSrc.PCResponseReasonText;
     aDst.CVVVerificationStatus = CVVVerificationStatusCode.GetCCVCode(aSrc.CcvVerificatonStatus);
     aDst.TranStatus            = CCTranStatusCode.GetCode(aSrc.TranStatus);
     if (aSrc.ErrorSource != CCErrors.CCErrorSource.None)
     {
         aDst.ErrorSource = CCErrors.GetCode(aSrc.ErrorSource);
         aDst.ErrorText   = aSrc.ErrorText;
         if (aSrc.ErrorSource != CCErrors.CCErrorSource.ProcessingCenter)
         {
             aDst.PCResponseReasonText = aSrc.ErrorText;
         }
     }
 }
        public virtual void ValidateSettings(PXGraph callerGraph, string processingCenterID, ISettingsDetail settingDetail)
        {
            CCProcessingContext context = new CCProcessingContext()
            {
                callerGraph = callerGraph
            };
            CCProcessingCenter processingCenter = _repository.GetCCProcessingCenter(processingCenterID);

            CCProcessingFeatureHelper.CheckProcessing(processingCenter, CCProcessingFeature.Base, context);
            if (context.processingCenter == null)
            {
                throw new PXException(Messages.ERR_CCProcessingCenterNotFound);
            }
            var      processor = GetProcessingWrapper(context);
            CCErrors result    = processor.ValidateSettings(settingDetail);

            if (result.source != CCErrors.CCErrorSource.None)
            {
                throw new PXSetPropertyException(result.ErrorMessage, PXErrorLevel.Error);
            }
        }