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;
}