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

[Bug] useCrossmintOrder.initializeAndPrepareOrder does not forward projectId parameter in request payload #257

Open
iAmAdamReid opened this issue Aug 8, 2023 · 0 comments

Comments

@iAmAdamReid
Copy link

iAmAdamReid commented Aug 8, 2023

Package versions:

"@crossmint/client-sdk-base": "^1.0.1-alpha.4",
"@crossmint/client-sdk-react-ui": "^1.0.1-alpha.4"

When using embedded checkout CrossmintPaymentElement, this error is always returned:

{"error":true,"message":"projectId must be specified"}

I can verify that a valid projectId is being provided as a prop to the CrossmintPaymentElement component.

However, when I inspect the Network tab in the browser I see this:

method: POST
URL: https://staging.crossmint.com/api/checkout/initialize-order
Request payload: {
  clientId: [REDACTED]
  emailTo: [REDACTED]
  mintConfig: [REDACTED]
  checkoutType: "EMBEDDED",
};

I can verify that the CrossmintPaymentElement is making this request to initialize the iframe:

method: GET
url: https://staging.crossmint.com/sdk/paymentElement
params: {
  clientId: [REDACTED]
  recipient: [REDACTED]
  mintConfig: [REDACTED]
  projectId: [REDACTED]
}

So it appears that whatever calls are being made in the iframe are failing to forward the projectId to the API, which results in order initialization failure because the API requires a projectId.

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

1 participant