Exemple #1
0
        private void EmvTxCtl_TxCompleted(object sender, EventArgs e)
        {
            if ((e as TxCompletedEventArgs).TxResult == TxResult.Cancelled)
            {
                UpdateView(ViewState.StepTxCtl);
            }

            if ((e as TxCompletedEventArgs).EMV_Data.IsPresent())
            {
                //the contact app would have already gone online, and the TxResult would be approved or declined
                //the reason going online for contactless is handled differently to going online for
                //contact is that with contact we have to go online and then back to the card before we can
                //process the transaction on the backend, for contacless we can choose to go online and process
                //the transaction in one call
                if ((e as TxCompletedEventArgs).TxResult == TxResult.ContactlessOnline)
                {
                    EMVApproverRequest auth = new EMVApproverRequest()
                    {
                        EMV_Data = (e as TxCompletedEventArgs).EMV_Data.Get()
                    };
                    try
                    {
                        EMVApproverResponse response = (EMVApproverResponse)onlineApprover.DoAuth(auth);
                        emvTxCtl.SetTxFinalResultLabel("CTLS Online:" + response.ResponseMessage);
                    }
                    catch (Exception ex)
                    {
                        emvTxCtl.SetTxFinalResultLabel("CTLS Online:" + ex.Message);
                    }
                }
            }
            if ((e as TxCompletedEventArgs).QR_Data.IsPresent())
            {
                if ((e as TxCompletedEventArgs).TxResult == TxResult.QRCodeScanned)
                {
                    //send qr code auth request
                    QRCodeApproverRequest auth = new QRCodeApproverRequest()
                    {
                        QRData = (e as TxCompletedEventArgs).QR_Data.Get()
                    };
                    try
                    {
                        QRCodeApproverResponse response = (QRCodeApproverResponse)onlineApprover.DoAuth(auth);
                        emvTxCtl.SetTxFinalResultLabel("QRCode Online:" + response.ResponseMessage);
                    }
                    catch (Exception ex)
                    {
                        emvTxCtl.SetTxFinalResultLabel("QRCode Online:" + ex.Message);
                    }
                }
            }
        }
Exemple #2
0
        private EMVApproverResponse GoOnlineForContactEMV(InterFaceType interfaceType, TLV data, TLV discretionary)
        {
            try
            {
                #region Merge EMV Lists
                if (discretionary != null)
                {
                    data.Children.AddListToList(discretionary.Children);
                }
                #endregion

                EMVApproverResponse onlineResponse = (EMVApproverResponse)onlineContactEMVApprover.DoAuth(
                    new EMVApproverRequest()
                {
                    EMV_Data        = data,
                    TCPClientStream = tcpClientStream
                });
                return(onlineResponse);
            }
            catch (Exception ex)
            {
                Logger.Log("Unable to go online:" + ex.Message);
                return(null);
            }
        }