Events
Listen to embedded checkout events
You can subscribe to both payment and minting / asset delivery events.
See a live demo
See a live demo
Fill out the checkout below and observe the events on the right side. Enter a valid email address to receive the purchase receipt.
4242 4242 4242 4242
to trigger a successful payment.Event Types
Payment events notify of price changes and events happening while capturing the user’s payment (e.g. successful payments, rejected cards).
Adding Payment Events
Subscribe by adding an onEvent
handler to the CrossmintPaymentElement
.
See example
See example
The following example will log all events to the browser console. You can jump ahead to see some examples for capturing and reacting to specific events further below.
Types of Payment Events
Quotes
Quotes
Payments
Payments
Triggered when checkout is ready for payment.
Example response
Example response
Triggered when checkout preparation fails.
How to solve
How to solve
The most common cause is a missing email address.
You can render an email input field to the CrossmintPaymentElement
by setting the emailInputOptions
prop to { show: true }
. If you collect email elsewhere in your application you can set recipient.email
programmatically.
Example response
Example response
Triggered when checkout is ready for payment.
Example response
Example response
Triggered when payment has been successfully authorized.
(Payment capture occurs after transaction:fulfillment.succeeded
)
Example response
Example response
orderIdentifier
returned in the response is used to subscribe to minting events.Triggered if a user’s card has been rejected.
Example response
Example response
4000 0000 0000 4954
Triggered if a user cancelled the payment or closed the checkout.
Payment events notify of price changes and events happening while capturing the user’s payment (e.g. successful payments, rejected cards).
Adding Payment Events
Subscribe by adding an onEvent
handler to the CrossmintPaymentElement
.
See example
See example
The following example will log all events to the browser console. You can jump ahead to see some examples for capturing and reacting to specific events further below.
Types of Payment Events
Quotes
Quotes
Payments
Payments
Triggered when checkout is ready for payment.
Example response
Example response
Triggered when checkout preparation fails.
How to solve
How to solve
The most common cause is a missing email address.
You can render an email input field to the CrossmintPaymentElement
by setting the emailInputOptions
prop to { show: true }
. If you collect email elsewhere in your application you can set recipient.email
programmatically.
Example response
Example response
Triggered when checkout is ready for payment.
Example response
Example response
Triggered when payment has been successfully authorized.
(Payment capture occurs after transaction:fulfillment.succeeded
)
Example response
Example response
orderIdentifier
returned in the response is used to subscribe to minting events.Triggered if a user’s card has been rejected.
Example response
Example response
4000 0000 0000 4954
Triggered if a user cancelled the payment or closed the checkout.
Minting events are triggered only after a payment has been successful captured. They notify of the status of the NFT mint and delivery (e.g. beginning the minting process, delivering the token to the user).
Adding Minting events
Minting events are not sent to the onEvent
handler of the CrossmintPaymentElement
. Instead, you must set them up using the code below
How to subscribe to minting events
How to subscribe to minting events
You can subscribe by passing the orderIdentifier
returned in the payment:process.succeedded
event to the Minting
component below.
Types of Minting Events
Orders
Orders
Transactions
Transactions
Triggered when an NFT has been delivered successfully.
txId
in the
response will be valid.Example response
Example response
Triggered when minting the NFT fails.
One scenario when this may fire is if the last NFT is sold between the time payment is sent and Crossmint attempts to make the purchase.
Example response
Example response
Errors
Errors
Error parsing parameter mintConfig
.
How to solve
How to solve
The value of the mintConfig
must be an object type. Ensure you are passing in a valid object.
The param paymentMethod
must be a string
How to solve
How to solve
paymentMethod
only accepts a string value. Ensure that you are passing in a string containing one of these possible values: “fiat”, “ETH, or “SOL”.
The email value passed into the recipient.email
property is invalid.
How to solve
How to solve
Ensure that a valid email address is being passed.
The provided collectionId
does not exist.
How to solve
How to solve
Ensure that you are using the correct collectionId
. Common causes for this error include:
- using the wrong environment
e.g.environment="staging"
with a productioncollectionId
or vice versa - using the
projectId
instead of thecollectionId
The collection associated with the provided collectionId
does not have a minting contract registered.
How to solve
How to solve
Register a smart contract in the developer console.