Наследование: UITableViewSource
Пример #1
0
		void SetUpTableView ()
		{
			Dictionary<string, Action> buttonDictionary = new Dictionary<string, Action> ();
			SuccessCallback successCallback = SuccessPayment;
			FailureCallback failureCallback = FailurePayment;

			var tokenPayment = new TokenPaymentViewModel {
				Amount = 3.5m,
				ConsumerReference = consumerRef,
				PaymentReference = paymentReference,
				CV2 = cv2
			};

			buttonDictionary.Add ("Make a Payment", () => {
				JudoSDKManager.Payment (GetCardViewModel (), successCallback, failureCallback, this.NavigationController);
			});

			buttonDictionary.Add ("PreAuthorise", delegate {
				JudoSDKManager.PreAuth (GetCardViewModel (), successCallback, failureCallback, this.NavigationController);
			});

			buttonDictionary.Add ("Token Payment", delegate {
				tokenPayment.Token = cardToken;
				tokenPayment.ConsumerToken = consumerToken;
				tokenPayment.LastFour = lastFour;
				tokenPayment.CardType = cardType;

				JudoSDKManager.TokenPayment (tokenPayment, successCallback, failureCallback, this.NavigationController);
			});

			buttonDictionary.Add ("Token PreAuthorise", delegate {
				tokenPayment.Token = cardToken;
				tokenPayment.ConsumerToken = consumerToken;
				tokenPayment.LastFour = lastFour;
				tokenPayment.CardType = cardType;

				JudoSDKManager.TokenPreAuth (tokenPayment, successCallback, failureCallback, this.NavigationController);
			});

			buttonDictionary.Add ("Register a Card", delegate {
				JudoSDKManager.RegisterCard (GetCardViewModel (), successCallback, failureCallback, this.NavigationController);
			});

			MainMenuSource menuSource = new MainMenuSource (buttonDictionary);
			ButtonTable.Source = menuSource;
			TableHeightConstrant.Constant = menuSource.GetTableHeight () + 60f;
		}
Пример #2
0
        void SetUpTableView ()
        {
            Dictionary<string, Action> buttonDictionary = new Dictionary<string, Action> ();
            JudoSuccessCallback successCallback = SuccessPayment;
            JudoFailureCallback failureCallback = FailurePayment;

            var tokenPayment = new TokenPaymentViewModel () {
                Amount = 3.5m,
                ConsumerReference = consumerRef,  
                CV2 = cv2
            };

            buttonDictionary.Add ("Make a Payment", delegate {
                Judo.Instance.Payment (GetCardViewModel (), successCallback, failureCallback);
            });



            buttonDictionary.Add ("PreAuthorise", delegate {
                Judo.Instance.PreAuth (GetCardViewModel (), successCallback, failureCallback);
            });


            buttonDictionary.Add ("Token Payment", delegate {
                tokenPayment.Token = cardToken;
                tokenPayment.ConsumerToken = consumerToken;
                tokenPayment.LastFour = lastFour;
                tokenPayment.CardType = cardType;

                Judo.Instance.TokenPayment (tokenPayment, successCallback, failureCallback);
            });

            buttonDictionary.Add ("Token PreAuthorise", delegate {
                tokenPayment.Token = cardToken;
                tokenPayment.ConsumerToken = consumerToken;
                tokenPayment.LastFour = lastFour;
                tokenPayment.CardType = cardType;

                Judo.Instance.TokenPreAuth (tokenPayment, successCallback, failureCallback);
            });

            buttonDictionary.Add ("Register a Card", delegate {
                var payment = GetCardViewModel ();
                payment.Amount = 1.01m; //Minimum amount Gateways accept without question

                Judo.Instance.RegisterCard (payment, successCallback, failureCallback);
            });
            if (_clientService.ApplePayAvailable) {

                buttonDictionary.Add ("Make a ApplePay Payment", delegate {
                    Judo.Instance.MakeApplePayment (GetApplePayViewModel (), successCallback, failureCallback);
                });

                buttonDictionary.Add ("Make a ApplePay PreAuthorise", delegate {
                    Judo.Instance.MakeApplePreAuth (GetApplePayViewModel (), successCallback, failureCallback);
                });

            }

            MainMenuSource menuSource = new MainMenuSource (buttonDictionary);
            ButtonTable.Source = menuSource;
            TableHeightConstrant.Constant = menuSource.GetTableHeight () + 60f;
        }
Пример #3
0
        void SetUpTableView()
        {
            Dictionary <string, Action> buttonDictionary = new Dictionary <string, Action> ();
            JudoSuccessCallback         successCallback  = SuccessPayment;
            JudoFailureCallback         failureCallback  = FailurePayment;

            var tokenPayment = new TokenPaymentViewModel()
            {
                Amount            = 3.5m,
                ConsumerReference = consumerRef,
                CV2 = cv2
            };

            buttonDictionary.Add("Make a Payment", delegate {
                Judo.Instance.Payment(GetCardViewModel(), successCallback, failureCallback);
            });



            buttonDictionary.Add("PreAuthorise", delegate {
                Judo.Instance.PreAuth(GetCardViewModel(), successCallback, failureCallback);
            });


            buttonDictionary.Add("Token Payment", delegate {
                tokenPayment.Token         = cardToken;
                tokenPayment.ConsumerToken = consumerToken;
                tokenPayment.LastFour      = lastFour;
                tokenPayment.CardType      = cardType;

                Judo.Instance.TokenPayment(tokenPayment, successCallback, failureCallback);
            });

            buttonDictionary.Add("Token PreAuthorise", delegate {
                tokenPayment.Token         = cardToken;
                tokenPayment.ConsumerToken = consumerToken;
                tokenPayment.LastFour      = lastFour;
                tokenPayment.CardType      = cardType;

                Judo.Instance.TokenPreAuth(tokenPayment, successCallback, failureCallback);
            });

            buttonDictionary.Add("Register a Card", delegate {
                var payment    = GetCardViewModel();
                payment.Amount = 1.01m; //Minimum amount Gateways accept without question

                Judo.Instance.RegisterCard(payment, successCallback, failureCallback);
            });
            if (_clientService.ApplePayAvailable)
            {
                buttonDictionary.Add("Make a ApplePay Payment", delegate {
                    Judo.Instance.MakeApplePayment(GetApplePayViewModel(), successCallback, failureCallback);
                });

                buttonDictionary.Add("Make a ApplePay PreAuthorise", delegate {
                    Judo.Instance.MakeApplePreAuth(GetApplePayViewModel(), successCallback, failureCallback);
                });
            }

            MainMenuSource menuSource = new MainMenuSource(buttonDictionary);

            ButtonTable.Source            = menuSource;
            TableHeightConstrant.Constant = menuSource.GetTableHeight() + 60f;
        }