Example #1
0
        public void StartCapture()
        {
            InitCardService();
            var paymentViewController = new CardIOPaymentViewController(this);

            rootViewController.PresentViewController(paymentViewController, true, null);
        }
Example #2
0
 public override void UserDidCancelPaymentViewController(CardIOPaymentViewController paymentViewController)
 {
     // Console.WriteLine("Scanning Canceled!");
     paymentViewController.DismissViewController(true, null);
     // ccPage.OnScanCancelled();
     Xamarin.Forms.MessagingCenter.Send <CreditCard_PCL>(ccPCL, "CreditCardScanCancelled");
 }
Example #3
0
        public override void UserDidProvideCreditCardInfo(CreditCardInfo card, CardIOPaymentViewController paymentViewController)
        {
            paymentViewController.DismissViewController(true, null);

            if (card == null)
            {
                Console.WriteLine("Scanning Canceled!");

                //ccPage.OnScanCancelled();
                Xamarin.Forms.MessagingCenter.Send <CreditCard_PCL>(ccPCL, "CreditCardScanCancelled");
            }
            else
            {
                //Console.WriteLine("Card Scanned: " + card.CardNumber);

                // Feel free to extend the CreditCard_PCL object to include more than what's here.
                ccPCL.cardNumber         = card.CardNumber;
                ccPCL.ccv                = card.Cvv;
                ccPCL.expr               = card.ExpiryMonth.ToString() + card.ExpiryYear.ToString();
                ccPCL.redactedCardNumber = card.RedactedCardNumber;
                ccPCL.cardholderName     = card.CardholderName;

                //ccPage.OnScanSucceeded (ccPCL);
                Xamarin.Forms.MessagingCenter.Send <CreditCard_PCL>(ccPCL, "CreditCardScanSuccess");
            }
        }
 public override void UserDidCancelPaymentViewController(CardIOPaymentViewController paymentViewController)
 {
     paymentViewController.DismissViewController(true, null);
     ScanningDone?.BeginInvoke(this, new CardInfoEventArgs
     {
         CardInfo = null
     }, null, null);
 }
        public void StartCapture()
        {
            InitCreditCardService();
            var cardIOPaymentViewController = new CardIOPaymentViewController(this);

            cardIOPaymentViewController.ScanExpiry            = true;
            cardIOPaymentViewController.CollectCardholderName = true;
            _viewController.PresentViewController(cardIOPaymentViewController, true, null);
        }
Example #6
0
 public void UserDidCancelPaymentViewController(CardIOPaymentViewController paymentViewController)
 {
     paymentViewController.DismissViewController(true, null);
     _retrieveCardCancelled?.Invoke();
     if (!_formsConfig.StoreUserData)
     {
         ClearUserData();
     }
 }
Example #7
0
        public void StartCapture()
        {
            InitCardService();
            var paymentViewController = new CardIOPaymentViewController(this);

            paymentViewController.DisableManualEntryButtons = true;

            rootViewController.PresentViewController(paymentViewController, true, null);
        }
Example #8
0
 public void UserDidProvideCreditCardInfo(CardIOCreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
 {
     paymentViewController.DismissViewController(true, null);
     _retrieveCardSuccess?.Invoke(cardInfo);
     if (!_formsConfig.StoreUserData)
     {
         ClearUserData();
     }
 }
        public override void UserDidProvideCreditCardInfo(CreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
        {
            _creditCardInfo = cardInfo;

            Debug.WriteLine($"CardholderName : {cardInfo.CardholderName}");
            Debug.WriteLine($"Card Type : {cardInfo.CardType}");
            Debug.WriteLine($"ExpiryMonth : {cardInfo.ExpiryMonth}");
            Debug.WriteLine($"ExpiryYear : {cardInfo.ExpiryYear}");

            paymentViewController.DismissViewController(true, null);
        }
Example #10
0
 /// <inheritdoc/>
 public void UserDidProvideCreditCardInfo(CreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
 {
     this._result = new CardIOResult 
     {
         CreditCardType = cardInfo.CardType.ToPclCardType(),
         CardNumber = cardInfo.CardNumber,
         Cvv = cardInfo.Cvv,
         Expiry = new DateTime((int)cardInfo.ExpiryYear, (int)cardInfo.ExpiryMonth, 1),
         PostalCode = cardInfo.PostalCode,
         Success = true
     };
     this._finished = true;
 }
        public void UserDidProvideCreditCardInfo (CreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
        {
            if (cardInfo == null) {
                elemCardNumber.Caption = "xxxx xxxx xxxx xxxx";
                Console.WriteLine("Cancelled");
            } else {
                elemCardNumber.Caption = cardInfo.CardNumber;
            }

            ReloadData();

            paymentViewController.DismissViewController(true, null);        
        }
Example #12
0
        public void UserDidProvideCreditCardInfo(Card.IO.CreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
        {
            if (cardInfo == null)
            {
                Console.WriteLine("Scanning Cancelled!");
            }
            else
            {
                this.cardInfo = cardInfo;
            }

            paymentViewController.DismissViewController(true, null);
        }
        public void Present()
        {
            var window = UIApplication.SharedApplication.KeyWindow;
            var vc     = window.RootViewController;

            while (vc.PresentedViewController != null)
            {
                vc = vc.PresentedViewController;
            }

            paymentViewController = new CardIOPaymentViewController(this);

            vc.PresentViewController(paymentViewController, true, null);
        }
 public override void UserDidProvideCreditCardInfo(CreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
 {
     paymentViewController.DismissViewController(true, null);
     ScanningDone?.BeginInvoke(this, new CardInfoEventArgs
     {
         CardInfo = new CardInfo
         {
             PAN    = cardInfo.CardNumber,
             CVV    = cardInfo.Cvv,
             Expiry = cardInfo.ExpiryMonth + "/" + cardInfo.ExpiryYear,
             Name   = cardInfo.CardholderName
         }
     }, null, null);
 }
        public void UserDidProvideCreditCardInfo(CreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
        {
            var creditCard = cardInfo == null ? AddCreditCard.Empty : new AddCreditCard
            {
                //CardNumber = cardInfo.CardNumber,
                //Cvv = cardInfo.Cvv,
                //ExpirationMonth = cardInfo.ExpiryMonth,
                //ExpirationYear = cardInfo.ExpiryYear
            };

            _callback?.Invoke(creditCard);
            _paymentViewController.DismissViewController(true, null);
            _modalHost.NativeModalViewControllerDisappearedOnItsOwn();
        }
        public void UserDidProvideCreditCardInfo(CreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
        {
            if (cardInfo == null)
            {
                elemCardNumber.Caption = "xxxx xxxx xxxx xxxx";
                Console.WriteLine("Cancelled");
            }
            else
            {
                elemCardNumber.Caption = cardInfo.CardNumber;
            }

            ReloadData();

            paymentViewController.DismissViewController(true, null);
        }
        public void UserDidProvideCreditCardInfo(CreditCardInfo card, CardIOPaymentViewController paymentViewController)
        {
            paymentViewController.DismissViewController(true, null);

            if (card != null)
            {
                var creditCardInfo = new CreditCardInformation
                {
                    CardNumber      = card.CardNumber,
                    ExpirationMonth = card.ExpiryMonth.ToString(),
                    ExpirationYear  = card.ExpiryYear.ToString()
                };

                MessagingCenter.Send(creditCardInfo, MessengerKeys.CreditCardScanned);
            }
        }
        public void ScanCardInfo(Action <AddCreditCard> callback, CreditCardScanOptions creditCardScanOptions = null)
        {
            if (creditCardScanOptions == null)
            {
                creditCardScanOptions = new CreditCardScanOptions();
            }

            _callback              = callback;
            _modalHost             = Mvx.Resolve <IMvxIosModalHost>();
            _paymentViewController = new CardIOPaymentViewController()
            {
                GuideColor = new UIColor(255, 255, 255, 1.0f)//ColorFromHex(creditCardScanOptions.GuideColor)
            };

            _modalHost.PresentModalViewController(_paymentViewController, true);
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
            	
			elemCardNumber = new StyledStringElement ("xxxx xxxx xxxx xxxx");

			Root = new RootElement ("card.io") {
				new Section {
					elemCardNumber,
					new StyledStringElement("Enter your Credit Card", () => {
                        paymentViewController = new CardIOPaymentViewController (this);

						NavigationController.PresentViewController(paymentViewController, true, null);
					}) { Accessory = UITableViewCellAccessory.DisclosureIndicator }
				}
			};
		}
        public void UserDidProvideCreditCardInfo(CreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
        {
            creditCardInfo = cardInfo;


            edtCreditCardData.Text = cardInfo.RedactedCardNumber;            // String.Format ("#### #### #### {0} {1}/{2}", cardInfo.RedactedCardNumber.Substring (l, 4).ToString (), cardInfo.ExpiryMonth, cardInfo.ExpiryYear.ToString ().Substring (2, 2));
            edtCCV.Text            = cardInfo.Cvv;
            edtCreditDate.Text     = String.Format("{0}/{1}", cardInfo.ExpiryMonth.ToString(), cardInfo.ExpiryYear.ToString());

            switch (creditCardInfo.CardType)
            {
            case CreditCardType.Mastercard:
                imgAddCard.Image = UIImage.FromBundle(@"fa-cc-mastercard");
                crditCardType    = CardType.Mastercard;
                break;

            case CreditCardType.Visa:
                imgAddCard.Image = UIImage.FromBundle(@"fa-cc-visa");
                crditCardType    = CardType.Visa;
                break;

            case CreditCardType.Amex:
                imgAddCard.Image = UIImage.FromBundle(@"fa-cc-amex");
                crditCardType    = CardType.AmericanExpress;
                break;

            case CreditCardType.Discover:
                imgAddCard.Image = UIImage.FromBundle(@"fa-cc-discover");
                crditCardType    = CardType.Discover;
                break;

            case CreditCardType.JCB:
                imgAddCard.Image = UIImage.FromBundle(@"fa-cc-diners-club");
                crditCardType    = CardType.DinersClub;
                break;

            default:
                imgAddCard.Image = UIImage.FromBundle(@"oi-credit-card");
                crditCardType    = CardType.Unknown;
                break;
            }

            paymentViewController.DismissViewController(true, null);
        }
Example #21
0
        /// <inheritdoc/>
        public async Task<CardIOResult> Scan(CardIOConfig config = null)
        {
            if(this._paymentViewController == null)
                this._paymentViewController = new CardIOPaymentViewController();
            
            if (config == null) config = new CardIOConfig();

            this._result = null;
            this._finished = false;

            this._paymentViewController.CollectExpiry = config.RequireExpiry;
            this._paymentViewController.CollectCVV = config.RequireCvv;
            this._paymentViewController.CollectPostalCode = config.RequirePostalCode;
            this._paymentViewController.UseCardIOLogo = config.ShowPaypalLogo;

            if (!string.IsNullOrEmpty(config.ScanInstructions))
                this._paymentViewController.ScanInstructions = config.ScanInstructions;
            if (!string.IsNullOrEmpty(config.Localization))
                this._paymentViewController.LanguageOrLocale = config.Localization;

            if(!string.IsNullOrEmpty(config.ScanInstructions))
                this._paymentViewController.ScanInstructions = config.ScanInstructions;

            Device.BeginInvokeOnMainThread(() => 
            {
                var window= UIApplication.SharedApplication.KeyWindow;
                var vc = window.RootViewController;
                while (vc.PresentedViewController != null)
                {
                    vc = vc.PresentedViewController;
                }

                vc.PresentViewController(
                    this._paymentViewController,
                    true,
                    null);
            });

            while (!this._finished) await Task.Delay(100);

            return this._result;
        }
Example #22
0
        private void ScanCard()
        {
            if (_cardScanner == null)
            {
                _cardScannerDelegate = new CardScannerDelegate(PopulateCreditCardName);
                _cardScanner         = new CardIOPaymentViewController(_cardScannerDelegate)
                {
                    GuideColor = this.View.BackgroundColor,
                    SuppressScanConfirmation = true,
                    CollectCVV                           = false,
                    CollectExpiry                        = false,
                    DisableManualEntryButtons            = true,
                    DisableBlurWhenBackgrounding         = true,
                    AutomaticallyAdjustsScrollViewInsets = false,
                    HideCardIOLogo                       = true,
                };
            }

            PresentViewController(_cardScanner, true, null);
        }
Example #23
0
        public void UserDidProvideCreditCardInfo(CreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
        {
            if (cardInfo != null)
            {
                if (CardFound != null)
                {
                    CardFound(cardInfo.RedactedCardNumber, (int)cardInfo.ExpiryMonth, (int)cardInfo.ExpiryYear, cardInfo.CardholderName, cardInfo.CardType);
                }
            }

            //if (cardInfo == null)
            //{
            //	Console.WriteLine("Scanning Canceled!");
            //}
            //else {
            //	Console.WriteLine("Card Scanned: " + cardInfo.CardNumber);
            //}

            paymentViewController.DismissViewController(true, null);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            elemCardNumber = new StyledStringElement("xxxx xxxx xxxx xxxx");

            Root = new RootElement("card.io")
            {
                new Section {
                    elemCardNumber,
                    new StyledStringElement("Enter your Credit Card", () => {
                        paymentViewController = new CardIOPaymentViewController(this);

                        NavigationController.PresentViewController(paymentViewController, true, null);
                    })
                    {
                        Accessory = UITableViewCellAccessory.DisclosureIndicator
                    }
                }
            };
        }
        public override void ViewDidAppear(bool animated)
        {
            base.ViewDidAppear(animated);

            // I don't know why ViewDidAppear keeps firing again, but we're able to shut it down
            // by checking bViewAlreadyDisappeared.
            if (bViewAlreadyDisappeared)
            {
                return;
            }

            //var paymentDelegate = new CardIOPaymentViewControllerDg(ccPage);

            // Create and Show the View Controller
            //var paymentViewController = new CardIOPaymentViewController(paymentDelegate);
            CardIOPaymentViewController paymentViewController = new CardIOPaymentViewController(this);

            paymentViewController.CollectExpiry         = ccPage.cardIOConfig.RequireExpiry;
            paymentViewController.CollectCVV            = ccPage.cardIOConfig.RequireCvv;
            paymentViewController.CollectPostalCode     = ccPage.cardIOConfig.RequirePostalCode;
            paymentViewController.HideCardIOLogo        = ccPage.cardIOConfig.HideCardIOLogo;
            paymentViewController.CollectCardholderName = ccPage.cardIOConfig.CollectCardholderName;

            if (!string.IsNullOrEmpty(ccPage.cardIOConfig.Localization))
            {
                paymentViewController.LanguageOrLocale = ccPage.cardIOConfig.Localization;
            }
            if (!string.IsNullOrEmpty(ccPage.cardIOConfig.ScanInstructions))
            {
                paymentViewController.ScanInstructions = ccPage.cardIOConfig.ScanInstructions;
            }



            // Not sure if this needs to be diabled, but it doesn't seem like something I want to do.
            paymentViewController.AllowFreelyRotatingCardGuide = false;

            // Display the card.io interface
            PresentViewController(paymentViewController, true, null);
        }
Example #26
0
        public void RequestCardData(Action onCancelled, Action <CardIOCreditCardInfo> onSuccess, PayPal.Forms.Abstractions.Enum.CardIOLogo scannerLogo)
        {
            RetrieveCardCancelled = onCancelled;
            RetrieveCardSuccess   = onSuccess;
            var scanViewController = new CardIOPaymentViewController(new CustomCardIOPaymentViewControllerDelegate(this));

            switch (scannerLogo)
            {
            case Abstractions.Enum.CardIOLogo.CardIO:
                scanViewController.HideCardIOLogo = false;
                scanViewController.UseCardIOLogo  = true;
                break;

            case Abstractions.Enum.CardIOLogo.None:
                scanViewController.HideCardIOLogo = true;
                scanViewController.UseCardIOLogo  = false;
                break;
            }
            var top = GetTopViewController(UIApplication.SharedApplication.KeyWindow);

            top.PresentViewController(scanViewController, true, null);
        }
        public override void ViewWillAppear(bool animated)
        {
            base.ViewWillAppear(animated);

            if (_appeared)
            {
                DismissViewController(false, null);
                return;
            }

            _appeared = true;

            var paymentViewController = new CardIOPaymentViewController(this);

            paymentViewController.CollectExpiry             = true;
            paymentViewController.CollectCVV                = false;
            paymentViewController.CollectPostalCode         = false;
            paymentViewController.HideCardIOLogo            = true;
            paymentViewController.UseCardIOLogo             = false;
            paymentViewController.DisableManualEntryButtons = true;

            paymentViewController.AllowFreelyRotatingCardGuide = true;
            PresentViewController(paymentViewController, true, null);
        }
		/// <summary>
		/// Overrides the Card IO delegate method called after the user completes the Card IO view controller.
		/// </summary>
		/// <param name="CreditCardInfo">The retrieved credit card information.</param>
		/// <param name="PaymentViewController">The Card IO payment view controller.</param>
		public override void InPaymentViewController (CardIOCreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
		{
			if ( CardIORetrievalCompleted != null )
				CardIORetrievalCompleted.Invoke (new CardIORetrievalCompletedEventArgs (paymentViewController, cardInfo));
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="CardIOSDK.CardIOGenericEventArgs"/> class.
		/// </summary>
		/// <param name="ViewController">The Card IO view controller that ultimately triggered the event.</param>
		public CardIOGenericEventArgs( CardIOPaymentViewController ViewController )
		{
			this.ViewController = ViewController;
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="CardIOSDK.CardIORetrievalCanceledEventArgs"/> class.
		/// </summary>
		/// <param name="ViewController">The Card IO view controller that ultimately triggered the event.</param>
		public CardIORetrievalCanceledEventArgs(CardIOPaymentViewController ViewController)
			: base(ViewController)
		{
		}
Example #31
0
 public override void UserDidCancelPaymentViewController(CardIOPaymentViewController paymentViewController)
 {
     Console.WriteLine("Scanning Canceled!");
     paymentViewController.DismissViewController(true, null);
 }
Example #32
0
 /// <inheritdoc/>
 public void UserDidCancelPaymentViewController(CardIOPaymentViewController paymentViewController)
 {
     this._result = new CardIOResult() { Success = false };
     this._finished = true;
 }
 public void UserDidCancelPaymentViewController(CardIOPaymentViewController paymentViewController)
 {
     paymentViewController.DismissViewController(true, null);
 }
		/// <summary>
		/// Initializes a new instance of the <see cref="CardIOSDK.CardIORetrievalCompletedEventArgs"/> class.
		/// </summary>
		/// <param name="ViewController">The Card IO view controller that ultimately triggered the event.</param>
		/// <param name="CreditCardInfo">The retrieved credit card information.</param>
		public CardIORetrievalCompletedEventArgs(CardIOPaymentViewController ViewController, CardIOCreditCardInfo CreditCardInfo)
			: base(ViewController)
		{
			this.CreditCardInfo = CreditCardInfo;
		}
Example #35
0
 public void UserDidProvideCreditCardInfo(CardIOCreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
 {
     paymentViewController.DismissViewController(true, null);
     RetrieveCardSuccess?.Invoke(cardInfo);
 }
Example #36
0
 public void UserDidCancelPaymentViewController(CardIOPaymentViewController paymentViewController)
 {
     paymentViewController.DismissViewController(true, null);
     RetrieveCardCancelled?.Invoke();
 }
Example #37
0
 public override void UserDidProvideCreditCardInfo(CardIOCreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
 {
     PayPalManager.UserDidProvideCreditCardInfo(cardInfo, paymentViewController);
 }
Example #38
0
 public override void UserDidCancelPaymentViewController(CardIOPaymentViewController paymentViewController)
 {
     PayPalManager.UserDidCancelPaymentViewController(paymentViewController);
 }
 public void UserDidCancelPaymentViewController(CardIOPaymentViewController paymentViewController)
 {
     paymentViewController.DismissViewController(true, null);
     RetrieveCardCancelled?.Invoke();
 }
Example #40
0
 public void UserDidCancelPaymentViewController(CardIOPaymentViewController paymentViewController)
 {
     Console.WriteLine("Scanning Cancelled!");
 }
		/// <summary>
		/// Overrides the Card IO delegate method called after the user cancels the Card IO view controller.
		/// </summary>
		/// <param name="PaymentViewController">The Card IO payment view controller.</param>
		public override void UserDidCancelPaymentViewController (CardIOPaymentViewController PaymentViewController)
		{
			if(CardIORetrievalCanceled!=null)
				CardIORetrievalCanceled.Invoke (new CardIORetrievalCanceledEventArgs(PaymentViewController));
		}
 public override void UserDidProvideCreditCardInfo(CardIOCreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
 {
     PayPalManager.UserDidProvideCreditCardInfo(cardInfo, paymentViewController);
 }
 public override void UserDidCancelPaymentViewController(CardIOPaymentViewController paymentViewController)
 {
     PayPalManager.UserDidCancelPaymentViewController(paymentViewController);
 }
        public void RequestCardData(Action onCancelled, Action<CardIOCreditCardInfo> onSuccess, PayPal.Forms.Abstractions.Enum.CardIOLogo scannerLogo)
        {
            RetrieveCardCancelled = onCancelled;
            RetrieveCardSuccess = onSuccess;
            var scanViewController = new CardIOPaymentViewController(new CustomCardIOPaymentViewControllerDelegate(this));

            switch (scannerLogo)
            {
                case Abstractions.Enum.CardIOLogo.CardIO:
                    scanViewController.HideCardIOLogo = false;
                    scanViewController.UseCardIOLogo = true;
                    break;
                case Abstractions.Enum.CardIOLogo.None:
                    scanViewController.HideCardIOLogo = true;
                    scanViewController.UseCardIOLogo = false;
                    break;
            }
            var top = GetTopViewController(UIApplication.SharedApplication.KeyWindow);
            top.PresentViewController(scanViewController, true, null);
        }
 public void UserDidCancelPaymentViewController (CardIOPaymentViewController paymentViewController)
 {
 	paymentViewController.DismissViewController(true, null);
 }
 public void UserDidProvideCreditCardInfo(CardIOCreditCardInfo cardInfo, CardIOPaymentViewController paymentViewController)
 {
     paymentViewController.DismissViewController(true, null);
     RetrieveCardSuccess?.Invoke(cardInfo);
 }