예제 #1
0
        public V2.ProcessingInput GetProcessingInput(V2.CCTranType aTranType, ICCPayment pDoc)
        {
            if (pDoc == null)
            {
                throw new ArgumentNullException(nameof(pDoc));
            }
            V2.ProcessingInput result = new V2.ProcessingInput()
            {
                TranType   = aTranType,
                Amount     = pDoc.CuryDocBal.Value,
                CuryID     = pDoc.CuryID,
                OrigTranID = aTranType == V2.CCTranType.CaptureOnly ? null : pDoc.OrigRefNbr,
                AuthCode   = aTranType == V2.CCTranType.CaptureOnly ? pDoc.OrigRefNbr : null
            };
            if (FillCardData)
            {
                result.CardData             = GetCardData(_provider.GetCardDataReader());
                result.CardData.AddressData = GetAddressData(_provider.GetCustomerDataReader());
            }

            if (FillCustomerData)
            {
                result.CustomerData = GetCustomerData(_provider.GetCustomerDataReader());
            }
            result.DocumentData           = new V2.DocumentData();
            result.DocumentData.DocType   = pDoc.DocType;
            result.DocumentData.DocRefNbr = pDoc.RefNbr;
            FillDocumentData(result);
            return(result);
        }
예제 #2
0
        public V2.ProcessingInput GetProcessingInput(V1.CCTranType aTranType, V1.ProcessingInput inputData)
        {
            if (inputData == null)
            {
                throw new ArgumentNullException(nameof(inputData));
            }

            V2.ProcessingInput result = new V2.ProcessingInput()
            {
                TranType   = ToV2(aTranType),
                Amount     = inputData.Amount,
                CuryID     = inputData.CuryID,
                OrigTranID = aTranType == V1.CCTranType.CaptureOnly ? null : inputData.OrigRefNbr,
                AuthCode   = aTranType == V1.CCTranType.CaptureOnly ? inputData.OrigRefNbr : null
            };
            result.CardData             = GetCardData(_provider.GetCardDataReader());
            result.CardData.AddressData = GetAddressData(_provider.GetCustomerDataReader());
            result.CustomerData         = GetCustomerData(_provider.GetCustomerDataReader());
            FillDocumentData(result, inputData);
            return(result);
        }
예제 #3
0
            public string CreateCustomerProfile()
            {
                V2.CustomerData customerData = V2ProcessingInputGenerator.GetCustomerData(_provider.GetCustomerDataReader());
                string          result       = V2PluginErrorHandler.ExecuteAndHandleError(() => _processor.CreateCustomerProfile(customerData));

                return(result);
            }
            public IEnumerable <V2.CreditCardData> GetAllPaymentProfiles()
            {
                V2.ICCProfileProcessor processor       = GetProcessor();
                string customerProfileId               = V2ProcessingInputGenerator.GetCustomerData(_provider.GetCustomerDataReader()).CustomerProfileID;
                IEnumerable <V2.CreditCardData> result = V2PluginErrorHandler.ExecuteAndHandleError(() => processor.GetAllPaymentProfiles(customerProfileId));

                return(result);
            }