Beispiel #1
0
        void SendDeviceInformation_Click(object sender, EventArgs e)
        {
            int i = 0;

            if (collectURL.Text != String.Empty && merc_id.Text != String.Empty && Int32.TryParse(merc_id.Text, out i) && session_id.Text != String.Empty)
            {
                sendDeviceInformation.Enabled = false;
                generateSessionButton.Enabled = false;

                WriteLine("Created New DeviceCollector");
                deviceCollector = new DeviceCollector(this);

                WriteLine("Setting listeners to this activity");
                deviceCollector.SetStatusListener(this);

                WriteLine("Setting Collector URL : " + collectURL.Text);
                deviceCollector.SetCollectorUrl(collectURL.Text);

                WriteLine("Setting Merchant ID : " + merc_id.Text);
                deviceCollector.SetMerchantId(merc_id.Text);

                WriteLine("Called DeviceCollector for Session : " + session_id.Text);
                deviceCollector.Collect(session_id.Text);
            }
            else
            {
                WriteLine("ERROR : Either the collect URL, merchant ID or Session ID are not set correctly");
            }
        }
Beispiel #2
0
        public override async Task GenerateNewSessionIdAndCollect()
        {
            #if !DEBUG
            var paymentSettings = await PaymentService.GetPaymentSettings();

            if (paymentSettings.PaymentMode == PaymentMethod.Cmt ||
                paymentSettings.PaymentMode == PaymentMethod.RideLinqCmt)
            {
                // Kount is only enabled for CMT

                var topActivity = Mvx.Resolve <IMvxAndroidCurrentTopActivity>();

                GenerateSessionId();

                _deviceCollector = new DeviceCollector(topActivity.Activity);
                _deviceCollector.SetCollectorUrl(DeviceCollectorUrl(paymentSettings.CmtPaymentSettings.IsSandbox));
                _deviceCollector.SetMerchantId(MerchantId);
                _deviceCollector.Collect(GetSessionId());
            }
            #endif
        }