void CheckoutWithShippingAddress(string serializedMessage)
        {
            var message = NativeMessageTester.CreateFromJSON(serializedMessage);

            Initialize();

            SetDefaultCartProducts(completion: () => {
                SaveCheckout(callback: (checkoutError) => {
                    if (checkoutError != null)
                    {
                        message.Respond(checkoutError.Description);
                        return;
                    }

                    SetDefaultShippingAddress(callback: (ShopifyError shippingError) => {
                        if (shippingError != null)
                        {
                            message.Respond(shippingError.Description);
                            return;
                        }
                        CreateNativeCheckout();
                        message.Respond("");
                    });
                });
            });
        }
예제 #2
0
        void GetLastMessage(string serializedMessage)
        {
            var lastMessage = NativeMessageTester.LastMessage;
            var message     = NativeMessageTester.CreateFromJSON(serializedMessage);

            message.Respond(lastMessage.Content);
        }
        void Checkout(string serializedMessage)
        {
            var message = NativeMessageTester.CreateFromJSON(serializedMessage);

            Initialize();

            SetDefaultCartProducts(completion: () => {
                SaveCheckout(callback: (error) => {
                    if (error != null)
                    {
                        message.Respond(error.Description);
                        return;
                    }

                    CreateNativeCheckout();
                    message.Respond("");
                });
            });
        }
예제 #4
0
        void RepeatMessage(string serializedMessage)
        {
            var message = NativeMessageTester.CreateFromJSON(serializedMessage);

            message.Respond(message.Content);
        }