Skip to content

Upgrade Crossmint’s Embedded Checkout to V3 #1391

@duyhiep2703

Description

@duyhiep2703

Hey, I’m trying to upgrade Crossmint’s Embedded Checkout to V3, but the payment form is showing the error “Execution reverted. Reason: Error (NFT is invalid)” after rendering. In version V2, it was still working normally and I was able to complete the payment. Am I doing something wrong?

Here’s the V2 code:

<CrossmintPaymentElement_DEPRECATED
  projectId={CROSSMINT_PROJECT_ID}
  collectionId={currencySellOrder(currencyName)}
  environment={IS_DEV_MODE ? 'staging' : 'production'}
  onEvent={(event) => {
    handleCallbackCrossMint(event);
  }}
  cardWalletPaymentMethods={'none'}
  mintConfig={crossMintDataConfig}
  recipient={{
    email: 'email@gmail.com',
  }}
  whPassThroughArgs={JSON.stringify({
    internalTxId: crossmintData?.internalTxId,
  })}
/>

Here’s the V3 code:

<CrossmintEmbeddedCheckout
  lineItems={[
    {
      collectionLocator: `crossmint:${currencySellOrder(currencyName)}`,
      callData: crossMintDataConfig,
    },
  ]}
  recipient={{
    email: 'email@gmail.com',
  }}
  payment={{
    crypto: {
      enabled: false,
    },
    fiat: {
      enabled: true,
      defaultCurrency: 'usd',
      allowedMethods: {
        card: true,
        applePay: false,
        googlePay: false,
      },
    },
  }}
/>

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