Example #1
0
        // For our sample native checkout, we use a hardcoded credit card.
        private async void OnNativeCheckoutButtonClicked(object sender, EventArgs e)
        {
            // Create the card to send to Shopify.  This is hardcoded here for simplicity, but the user should be prompted for their credit card information.
            var creditCard = new CreditCard
            {
                FirstName         = "Dinosaur",
                LastName          = "Banana",
                Month             = "2",
                Year              = "20",
                VerificationValue = "123",
                Number            = "4242424242424242"
            };

            ShowLoadingDialog(Resource.String.completing_checkout);

            try
            {
                await SampleApplication.StoreCreditCardAsync(creditCard);

                var checkout = await SampleApplication.CompleteCheckoutAsync();

                DismissLoadingDialog();
                await PollCheckoutCompletionStatusAsync(checkout);
            }
            catch (ShopifyException ex)
            {
                OnError(ex.Error);
            }
        }