示例#1
0
        async void btnTryAgain_Clicked(System.Object sender, System.EventArgs e)
        {
            Models.Payment payment = new Models.Payment()
            {
                ItemName   = txtItemName.Text,
                Amount     = decimal.Parse(txtAmount.Text),
                ItemNumber = txtItemNumber.Text,
                Email      = txtEmail.Text
            };
            //await Navigation.PushModalAsync(new ppweb(payment), true);
            if (string.IsNullOrEmpty(payment.ItemNumber))
            {
                payment.ItemNumber = "001";
            }
            string url = new Models.PayPalUrl().PayPalLink(payment);

            //await Launcher.OpenAsync(url);
            await Task.WhenAll(
                Browser.OpenAsync(url, new BrowserLaunchOptions
            {
                LaunchMode            = BrowserLaunchMode.SystemPreferred,
                TitleMode             = BrowserTitleMode.Default,
                PreferredToolbarColor = Color.FromHex(App.AnyPalBlue),
                PreferredControlColor = Color.White
            })
                );
        }
示例#2
0
        async void btnPayNow_Clicked(System.Object sender, System.EventArgs e)
        {
            string msg = "";// IsValid();
            Entry  obj = IsValid2() as Entry;

            //if (!string.IsNullOrEmpty(msg))
            if (obj != null)
            {
                //await DisplayAlert("Error", msg, "Ok");

                Device.BeginInvokeOnMainThread(async() =>
                {
                    try
                    {
                        await obj.TranslateTo(-15, 0, 50);
                        await obj.TranslateTo(15, 0, 50);
                        await obj.TranslateTo(-10, 0, 50);
                        await obj.TranslateTo(10, 0, 50);
                        await obj.TranslateTo(-5, 0, 50);
                        await obj.TranslateTo(5, 0, 50);
                        obj.TranslationX = 0;
                    }
                    finally
                    {
                        //_isAnimating = false;
                    }
                });
            }
            else
            {
                Models.Payment payment = new Models.Payment()
                {
                    ItemName   = txtItemName.Text,
                    Amount     = decimal.Parse(txtAmount.Text),
                    ItemNumber = txtItemNumber.Text,
                    Email      = txtEmail.Text
                };
                //await Navigation.PushModalAsync(new ppweb(payment), true);
                if (string.IsNullOrEmpty(payment.ItemNumber))
                {
                    payment.ItemNumber = "001";
                }
                //string url = "https://www.paypal.com/cgi-bin/webscr?cmd=_cart";
                //url += "&business=" + payment.Email + "&add=1&quantity=1";
                //url += "&item_number=" + payment.ItemNumber + "&amount=" + payment.Amount;
                //url += "&item_name=" + payment.ItemName + "&bn=gjhdigital";

                string url = new Models.PayPalUrl().PayPalLink(payment);

                //await Launcher.OpenAsync(url);
                await Task.WhenAll(
                    Browser.OpenAsync(url, new BrowserLaunchOptions
                {
                    LaunchMode            = BrowserLaunchMode.SystemPreferred,
                    TitleMode             = BrowserTitleMode.Default,
                    PreferredToolbarColor = Color.FromHex(App.AnyPalBlue),
                    PreferredControlColor = Color.White
                })
                    );

                //await Navigation.PushModalAsync(new ppweb(payment), true);

                //await DisplayAlert("", "Add New Contact", "Ok");
                lblSaveContact.Text     = "Save " + payment.Email + " to AnyPal contacts?";
                frmAddContact.IsVisible = true;
                frmPayment.IsVisible    = false;
            }
        }
示例#3
0
 public ppweb(Models.Payment p)
 {
     InitializeComponent();
     payment = p as Models.Payment;
     //btnSaveRecipient.IsVisible = false;
 }