Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkout error product is not published for this customer #753

Open
sppzglou opened this issue Oct 28, 2023 · 1 comment
Open

Checkout error product is not published for this customer #753

sppzglou opened this issue Oct 28, 2023 · 1 comment

Comments

@sppzglou
Copy link

my method is that:

fun getCheckoutUrl(graphQlId: String, emit: (String?, Exception?) -> Unit) {
val input = Storefront.CheckoutCreateInput()
.setLineItemsInput(
Input.value(
listOf(
Storefront.CheckoutLineItemInput(1, ID(graphQlId))
)
)
)

    val query = Storefront.mutation { mutationQuery ->
        mutationQuery.checkoutCreate(input) { createPayloadQuery ->
            createPayloadQuery.checkout { checkoutQuery ->
                checkoutQuery.webUrl()
            }.checkoutUserErrors { userErrorQuery ->
                userErrorQuery.field().message()
            }
        }
    }

    graph.mutateGraph(query).enqueue { result ->
        if (result is GraphCallResult.Success) {
            val errors = result.response.errors
            val userErrors =
                result.response.data?.checkoutCreate?.checkoutUserErrors?.map { it.message }
            if (errors.isNotEmpty()) {
                emit(null, Exception(errors.first().message()))
            } else if (userErrors?.isNotEmpty() == true) {
                emit(null, Exception(userErrors.first()))
            } else {
                emit(result.response.data?.checkoutCreate?.checkout?.webUrl, null)
            }
        } else {
            emit(null, Exception((result as GraphCallResult.Failure).error.message))
        }
    }
}

on result.response.data?.checkoutCreate?.checkoutUserErrors I received this error "Variant the product is not published for this customer."
on the same product/variant on web shopify site the checkout works without any error.

Στιγμιότυπο οθόνης 2023-10-28, 11 50 35 μμ
@Varghese1987
Copy link

We are also facing the same issue. However, after some time, this error resolves itself, and we are able to check out the same product through the Mobile Buy SDK. It would be great if someone could help us identify the root cause of this issue and provide a corrective action. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants