// Create a new checkout with the selected product. For convenience in the sample app we will hardcode the user's shipping address.
        // The shipping rates fetched in ShippingRateListActivity will be for this address.
        public void CreateCheckout(Product product, Action<Checkout, Response> success, Action<RetrofitError> failure)
        {
            var cart = new Cart();
            cart.AddVariant(product.Variants[0]);

            Checkout = new Checkout(cart);
            Checkout.ShippingAddress = new Address
            {
                FirstName = "Dinosaur",
                LastName = "Banana",
                Address1 = "421 8th Ave",
                City = "New York",
                Province = "NY",
                Zip = "10001",
                CountryCode = "US"
            };
            Checkout.Email = "*****@*****.**";
            Checkout.SetWebReturnToUrl(GetString(Resource.String.web_return_to_url));
            Checkout.SetWebReturnToLabel(GetString(Resource.String.web_return_to_label));

            BuyClient.CreateCheckout(Checkout, (data, response) =>
            {
                Checkout = data;
                success(data, response);
            }, failure);
        }
 public void GetCheckoutCompletionStatus(Checkout checkout, Action<bool, Response> success, Action<RetrofitError> failure)
 {
     GetCheckoutCompletionStatus(checkout, new RetrofitCallback<Java.Lang.Boolean>(
         (data, response) => success(data.BooleanValue(), response),
         failure));
 }
 public void CreateCheckout(Checkout checkout, Action<Checkout, Response> success, Action<RetrofitError> failure)
 {
     CreateCheckout(checkout, new RetrofitCallback<Checkout>(success, failure));
 }
 public void ApplyGiftCard(string giftCardCode, Checkout checkout, Action<Checkout, Response> success, Action<RetrofitError> failure)
 {
     ApplyGiftCard(giftCardCode, checkout, new RetrofitCallback<Checkout>(success, failure));
 }
 public void StoreCreditCard(CreditCard card, Checkout checkout, Action<Checkout, Response> success, Action<RetrofitError> failure)
 {
     StoreCreditCard(card, checkout, new RetrofitCallback<Checkout>(success, failure));
 }
 public void RemoveProductReservationsFromCheckout(Checkout checkout, Action<Checkout, Response> success, Action<RetrofitError> failure)
 {
     RemoveProductReservationsFromCheckout(checkout, new RetrofitCallback<Checkout>(success, failure));
 }
 public void RemoveGiftCard(GiftCard giftCard, Checkout checkout, Action<Checkout, Response> success, Action<RetrofitError> failure)
 {
     RemoveGiftCard(giftCard, checkout, new RetrofitCallback<Checkout>(success, failure));
 }
        // Polls until the web checkout has completed.
        protected void PollCheckoutCompletionStatus(Checkout checkout)
        {
            ShowLoadingDialog(Resource.String.getting_checkout_status);

            SampleApplication.GetCheckoutCompletionStatus(
                (complete, response) =>
                {
                    if (complete)
                    {
                        DismissLoadingDialog();
                        OnCheckoutComplete();
                    }
                    else
                    {
                        pollingHandler.PostDelayed(() =>
                        {
                            PollCheckoutCompletionStatus(checkout);
                        }, PollDelay);
                    }
                },
                OnError);
        }