Example #1
0
        public CreateMembershipPage()
        {
            InitializeComponent();

            _addWalletTask            = new AddWalletItemTask();
            _addWalletTask.Completed += AddWalletTask_Completed;
        }
        public CreateMembershipPage()
        {
            InitializeComponent();

            _addWalletTask = new AddWalletItemTask();
            _addWalletTask.Completed += AddWalletTask_Completed;
        }
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Sample code to localize the ApplicationBar
            //BuildLocalizedApplicationBar();
            this.task = new AddWalletItemTask();
            task.Completed += task_Completed;

            ClearAllItems();
        }
        private async void btnMeioPagto_Click(object sender, RoutedEventArgs e)
        {

            try
            {
                var item = new PaymentInstrument(Guid.NewGuid().ToString());


                item.IssuerName = "Grupo 1";
                item.CustomerName = "Dono da Wallet";
                item.ExpirationDate = DateTime.Now.AddDays(15);
                item.PaymentInstrumentKinds = PaymentInstrumentKinds.Debit;
                item.DisplayName = "Dilmas - D£";
                item.Logo99x99 = Conversao.GetBitmapImage("/Images/Dilma.jpg");
                item.Logo159x159 = Conversao.GetBitmapImage("/Images/Dilma.jpg");
                item.Logo336x336 = Conversao.GetBitmapImage("/Images/Dilma.jpg");
                item.DisplayAvailableBalance = "500D£";
                item.DisplayBalance = "1000D£";
                item.DisplayCreditLimit = "200D£";
                item.DisplayAvailableCredit = "200£";
                item.BackgroundColor = Color.FromArgb(255, 70, 150, 250);
                item.Nickname = "Dilmas D£";
                item.Message = "Pode bater na panela que eu nao saio";
                item.MemberSince = DateTime.Now.AddYears(-1);
                item.AccountNumber = "12345666";

                //await item.SaveAsync();

                AddWalletItemTask task = new AddWalletItemTask()
                {
                    Item = item
                };

                task.Completed += (s, args) => MessageBox.Show(string.Format("Inclusao cartao pagto: {0}", args.TaskResult.ToString()));
                task.Show();

                await Launcher.LaunchUriAsync(new Uri("wallet://", UriKind.RelativeOrAbsolute));

            }
            catch (Exception ex)
            {

                MessageBox.Show(ex.Message);
            }

            
            

        }
Example #5
0
        private void transationbutton_Click(object sender, RoutedEventArgs e)
        {
            WalletTransactionItem walletTransactionItem = new WalletTransactionItem("walletTransactionItem1");
            walletTransactionItem.DisplayName = "会员卡";

            BitmapImage bitmapImage = new BitmapImage();
            bitmapImage.SetSource(Application.GetResourceStream(new Uri("Assets/ApplicationIcon.png", UriKind.Relative)).Stream);
            walletTransactionItem.Logo159x159 = bitmapImage;
            walletTransactionItem.Logo336x336 = bitmapImage;
            walletTransactionItem.Logo99x99 = bitmapImage;

            AddWalletItemTask addWalletItemTask = new AddWalletItemTask();
            addWalletItemTask.Item = walletTransactionItem;
            addWalletItemTask.Completed += addWalletItemTask_Completed;
            addWalletItemTask.Show();
        }
Example #6
0
        private void bank_Click(object sender, RoutedEventArgs e)
        {
            PaymentInstrument paymentInstrument = new PaymentInstrument("paymentInstrument1");
            paymentInstrument.DisplayName = "我的银行卡";
            paymentInstrument.PaymentInstrumentKinds = PaymentInstrumentKinds.Credit;
            BitmapImage bitmapImage = new BitmapImage();
            bitmapImage.SetSource(Application.GetResourceStream(new Uri("Assets/ApplicationIcon.png", UriKind.Relative)).Stream);
            paymentInstrument.Logo159x159 = bitmapImage;
            paymentInstrument.Logo336x336 = bitmapImage;
            paymentInstrument.Logo99x99 = bitmapImage;

            AddWalletItemTask addWalletItemTask = new AddWalletItemTask();
            addWalletItemTask.Item = paymentInstrument;
            addWalletItemTask.Completed += addWalletItemTask_Completed;
            addWalletItemTask.Show();
        }
        private void AddToWallet(Card card, bool showSuccessMessage = false)
        {
            if (card == null) return;

            var walletCard = new WalletTransactionItem(card.Id)
            {
                DisplayName = card.Name,
                IssuerName = card.CardProvider.ProviderName,
                Logo99x99 = GetTileFromProvider(card.CardProvider, 99),
                Logo159x159 = GetTileFromProvider(card.CardProvider, 159),
                Logo336x336 = GetTileFromProvider(card.CardProvider, 336),
                BarcodeImage = (BitmapSource) new Converters.BarcodeToImageConverter().Convert(card, typeof (BitmapSource), "false", null),
                NavigationUri = new Uri(string.Format("/Views/DisplayBarcodeView.xaml?id={0}", card.Id), UriKind.Relative),
                CustomerName = card.DisplayBarcode
            };

            var walletTask = new AddWalletItemTask
            {
                Item = walletCard
            };
            walletTask.Completed += (sender, result) =>
            {
                if (result.Error != null)
                {
                    App.ShowMessage("There was an error adding your card");
                    return;
                }

                CheckWalletForCard(card.Id);
                if (showSuccessMessage)
                    App.ShowMessage("Card was added to the wallet");
            };
            walletTask.Show();
        }