コード例 #1
0
        // For our sample native checkout, we use a hardcoded credit card.
        private 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);
            SampleApplication.StoreCreditCard(creditCard, delegate
            {
                // When the credit card has successfully been added, complete the checkout and begin polling.
                SampleApplication.CompleteCheckout((checkout, response) =>
                {
                    DismissLoadingDialog();
                    PollCheckoutCompletionStatus(checkout);
                }, OnError);
            }, OnError);
        }