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); }
public V2.ProcessingInput GetProcessingInput(V1.CCTranType aTranType, V1.ProcessingInput inputData) { if (inputData == null) { throw new ArgumentNullException(nameof(inputData)); } V2.CCTranType tranType = ToV2(aTranType); V2.ProcessingInput result = new V2.ProcessingInput() { TranType = tranType, Amount = inputData.Amount, CuryID = inputData.CuryID, OrigTranID = aTranType == V1.CCTranType.CaptureOnly ? null : inputData.OrigRefNbr, AuthCode = aTranType == V1.CCTranType.CaptureOnly ? inputData.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 = inputData.DocType; result.DocumentData.DocRefNbr = inputData.DocRefNbr; FillDocumentData(result); return(result); }
public void GetPaymentForm(V2.ProcessingInput inputData) { var formProcessor = GetProcessor <V2.ICCHostedPaymentFormProcessor>(); var result = V2PluginErrorHandler.ExecuteAndHandleError(() => { CheckWebhook(); return(formProcessor.GetDataForPaymentForm(inputData)); }); PXTrace.WriteInformation($"Perform PaymentRedirectException. Url: {result.Url}"); throw new PXPaymentRedirectException(result.Caption, result.Url, result.UseGetMethod, result.Token, result.Parameters); }
private void FillDocumentData(V2.ProcessingInput processingInput) { processingInput.DocumentData.DocumentDetails = new List <V2.DocumentDetailData>(); V1.IDocDetailsDataReader documentReader = _provider.GetDocDetailsDataReader(); List <V1.DocDetailInfo> detailsData = new List <V1.DocDetailInfo>(); documentReader.ReadData(detailsData); foreach (var item in detailsData) { V2.DocumentDetailData v2Item = ToV2(item); processingInput.DocumentData.DocumentDetails.Add(v2Item); } }