Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
        public TransactView(FlowType flowType, ICardInterfaceManger contactCardInterfaceManger, ICardInterfaceManger contactlessCardInterfaceManger, IConfigurationProvider configProvider, IOnlineApprover onlineApprover, TCPClientStream tcpClientStream)
        {
            InitializeComponent();

            this.onlineApprover = onlineApprover;
            this.flowType       = flowType;

            QRCodeMode mode = QRCodeMode.None;

            switch (flowType)
            {
            case FlowType.SendMoneyFromCardToApp:
                mode = QRCodeMode.PresentAndPoll;
                emvTxCtl.SetHeaderInstruction("Send money from their card to your account");
                emvTxCtl.SetTxStartLabel("Send money from their card to your account");
                this.Title = "Receive Money";
                break;

            case FlowType.SendMoneyFromAppToCard:
                mode = QRCodeMode.ScanAndProcess;
                emvTxCtl.SetHeaderInstruction("Send money from your account to their card");
                emvTxCtl.SetTxStartLabel("Send money from your account to their card");
                this.Title = "Send Money";
                break;
            }

            emvTxCtl.Init(contactCardInterfaceManger, SessionSingleton.ContactDeviceId,
                          contactlessCardInterfaceManger, SessionSingleton.ContactlessDeviceId,
                          mode, SessionSingleton.Account.AccountNumberId,
                          configProvider, onlineApprover, tcpClientStream);

            emvTxCtl.TxCompleted += EmvTxCtl_TxCompleted;

            gridProgress.IsVisible = false;

            UpdateView(ViewState.StepTxCtl);
        }