private void DemoNativeFlowWithProduct(BUYProduct product) { if (checkoutCreationTask != null && checkoutCreationTask.State == NSUrlSessionTaskState.Running) { checkoutCreationTask.Cancel(); } var cart = new BUYCart(); cart.AddVariant(product.Variants [0]); var checkout = new BUYCheckout(cart); // Apply billing and shipping address, as well as email to the checkout checkout.ShippingAddress = Address; checkout.BillingAddress = Address; checkout.Email = "*****@*****.**"; client.UrlScheme = "xamarinsample://"; UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true; checkoutCreationTask = client.CreateCheckout(checkout, (chkout, error) => { UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false; if (error == null && chkout != null) { var shippingController = new ShippingRatesTableViewController(client, chkout); NavigationController.PushViewController(shippingController, true); } else { Console.WriteLine("Error creating checkout: {0}", error); } }); }
private void DemoProductViewControllerWithProduct(BUYProduct product) { var productViewController = GetProductViewController(); productViewController.LoadWithProduct(product, (success, error) => { if (error == null) { if (presentViewController) { productViewController.PresentPortraitInViewController(this); } else { NavigationController.PushViewController(productViewController, true); } } }); }
private void DemoProductViewControllerWithProduct(BUYProduct product) { var productViewController = GetProductViewController (); productViewController.LoadWithProduct (product, (success, error) => { if (error == null) { if (presentViewController) { productViewController.PresentPortraitInViewController (this); } else { NavigationController.PushViewController (productViewController, true); } } }); }
private void DemoNativeFlowWithProduct(BUYProduct product) { if (checkoutCreationTask != null && checkoutCreationTask.State == NSUrlSessionTaskState.Running) { checkoutCreationTask.Cancel (); } var cart = new BUYCart (); cart.AddVariant (product.Variants [0]); var checkout = new BUYCheckout (cart); // Apply billing and shipping address, as well as email to the checkout checkout.ShippingAddress = Address; checkout.BillingAddress = Address; checkout.Email = "*****@*****.**"; client.UrlScheme = "xamarinsample://"; UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true; checkoutCreationTask = client.CreateCheckout (checkout, (chkout, error) => { UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false; if (error == null && chkout != null) { var shippingController = new ShippingRatesTableViewController (client, chkout); NavigationController.PushViewController (shippingController, true); } else { Console.WriteLine ("Error creating checkout: {0}", error); } }); }