public void StoreCreditCard(CreditCard card, Action <Checkout, Response> success, Action <RetrofitError> failure)
 {
     Checkout.BillingAddress = Checkout.ShippingAddress;
     BuyClient.StoreCreditCard(card, Checkout, (data, response) =>
     {
         Checkout = data;
         success(data, response);
     }, failure);
 }
예제 #2
0
        private void AddCreditCardToCheckout(Action <bool> callback)
        {
            UIApplication.SharedApplication.NetworkActivityIndicatorVisible = true;
            client.StoreCreditCard(CreditCard, checkout, (checkout, paymentSessionId, error) => {
                UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;

                if (error == null && checkout != null)
                {
                    Console.WriteLine("Successfully added credit card to checkout");
                    this.checkout = checkout;
                    TableView.ReloadData();
                }
                else
                {
                    Console.WriteLine("Error applying credit card: {0}", error);
                }

                callback(error == null && checkout != null);
            });
        }