Skip to content

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

Description

@iAmAdamReid

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions