public void Init(ICardInterfaceManger contactCardInterfaceManger, string contactDeviceId, ICardInterfaceManger contactlessCardInterfaceManger, string contactlessDeviceId, QRCodeMode qrCodeMode, string accountNumberInUse, IConfigurationProvider configProvider, IOnlineApprover onlineContactEMVApprover, TCPClientStream tcpClientStream, TransactionRequest tr = null) { qrCodeScanned = false; this.contactDeviceId = contactDeviceId; this.contactlessDeviceId = contactlessDeviceId; this.qrCodeMode = qrCodeMode; this.contactCardInterfaceManger = contactCardInterfaceManger; this.contactlessCardInterfaceManger = contactlessCardInterfaceManger; this.configProvider = configProvider; this.onlineContactEMVApprover = onlineContactEMVApprover; this.tcpClientStream = tcpClientStream; this.accountNumberInUse = accountNumberInUse; if (tr != null) { this.tr = tr; totalAmount.Total = Convert.ToString(tr.GetAmountAuthorized_9F02()); Start(); } else { UpdateView(ViewState.Step1TransactDetails); } }
private void StartQRCodeScanPaymentApp(string barcode) { try { qrCodeScanApp = new EMVTerminalQRCodeScanApplication(); qrCodeScanApp.ExceptionOccured += QRCodeScanApp_ExceptionOccured; qrCodeScanApp.ProcessCompleted += QRCodeScanApp_ProcessCompleted; qrCodeScanApp.StartTransactionRequest(ref tr, barcode); totalAmount.Total = Convert.ToString(tr.GetAmountAuthorized_9F02()); UpdateView(ViewState.Step2TapCard); } catch (Exception ex) { SetStatusLabel(MakeUIMessage(ex), InterFaceType.QRCodeScanned); } }
private void CmdNextToPaymentApp_Clicked(object sender, EventArgs e) { long amount; if (!Int64.TryParse(totalAmount.Total, out amount)) { lblStatusAskAmount.Text = "Enter the amount below without decimals"; return; } long amountOther = 0; tr = new TransactionRequest(amount + amountOther, amountOther, TransactionTypeEnum.PurchaseGoodsAndServices); totalAmount.Total = Convert.ToString(tr.GetAmountAuthorized_9F02()); Start(); }
public static List <Tuple <TerminalSupportedKernelAidTransactionTypeCombination, EntryPointPreProcessingIndicators> > PreProcessing(TransactionRequest transactionRequest) { List <Tuple <TerminalSupportedKernelAidTransactionTypeCombination, EntryPointPreProcessingIndicators> > EntryPointPreProcessingIndicators = new List <Tuple <TerminalSupportedKernelAidTransactionTypeCombination, EntryPointPreProcessingIndicators> >(); foreach (TerminalSupportedKernelAidTransactionTypeCombination kcA in TerminalSupportedKernelAidTransactionTypeCombinations.SupportedContactlessCombinations) { TerminalSupportedContactlessKernelAidTransactionTypeCombination kc = (TerminalSupportedContactlessKernelAidTransactionTypeCombination)kcA; if (transactionRequest.GetTransactionType_9C() != kc.TransactionTypeEnum) { continue; } //3.1.1.1 EntryPointPreProcessingIndicators eppi = new EntryPointPreProcessingIndicators(); EntryPointPreProcessingIndicators.Add(Tuple.Create(kcA, eppi)); if (kc.TTQ != null) { //3.1.1.2 eppi.TTQ = (TERMINAL_TRANSACTION_QUALIFIERS_9F66_KRN)kc.TTQ.Clone(); eppi.TTQ.Value.OnlineCryptogramRequired = false; eppi.TTQ.Value.CVMRequired = false; eppi.TTQ.Val.Serialize(); } //3.1.1.3 if (kc.StatusCheckSupportFlag != null && kc.StatusCheckSupportFlag == true && transactionRequest.IsSingleUnitOfCurrency) { eppi.StatusCheckRequested = true; } //3.1.1.4 if (transactionRequest.GetAmountAuthorized_9F02() == 0) { if (kc.ZeroAmountAllowedFlag != null && kc.ZeroAmountAllowedFlag == false) { eppi.ContactlessApplicationNotAllowed = true; } else { eppi.ZeroAmount = true; } } //3.1.1.5 if (kc.ReaderContactlessTransactionLimit != null && transactionRequest.GetAmountAuthorized_9F02() > kc.ReaderContactlessTransactionLimit) { eppi.ContactlessApplicationNotAllowed = true; } //3.1.1.6 if (kc.ReaderContactlessFloorLimit != null && transactionRequest.GetAmountAuthorized_9F02() > kc.ReaderContactlessFloorLimit) { eppi.ReaderContactlessFloorLimitExceeded = true; } //3.1.1.7 if (kc.ReaderContactlessFloorLimit == null && kc.TerminalFloorLimit_9F1B != null && transactionRequest.GetAmountAuthorized_9F02() > kc.TerminalFloorLimit_9F1B) { eppi.ReaderContactlessFloorLimitExceeded = true; } //3.1.1.8 if (kc.ReaderCVMRequiredLimit != null && transactionRequest.GetAmountAuthorized_9F02() > kc.ReaderCVMRequiredLimit) { eppi.ReaderCVMRequiredLimitExceeded = true; } if (eppi.TTQ != null) { //3.1.1.9 if (eppi.ReaderContactlessFloorLimitExceeded) { eppi.TTQ.Value.OnlineCryptogramRequired = true; } //3.1.1.10 if (eppi.StatusCheckRequested) { eppi.TTQ.Value.OnlineCryptogramRequired = true; } //3.1.1.11 if (eppi.ZeroAmount) { if (!eppi.TTQ.Value.OfflineOnlyReader) { eppi.TTQ.Value.OnlineCryptogramRequired = true; } else { eppi.ContactlessApplicationNotAllowed = true; } } //3.1.1.12 if (eppi.ReaderCVMRequiredLimitExceeded) { eppi.TTQ.Value.CVMRequired = true; } eppi.TTQ.Serialize(); } EntryPointPreProcessingIndicators.RemoveAll(x => x.Item2.ContactlessApplicationNotAllowed); } return(EntryPointPreProcessingIndicators); }