js
js copied to clipboard
Checkout widget transaction hash
[Dashboard/Portal] Feature: Return transaction hash in Checkout Widget iframe events
Notes for the reviewer
- The checkout widget iframe now includes a
transactionsarray in bothsuccessanderrorpostMessageevents. - This array contains
{ chainId, transactionHash }objects for all relevant on-chain transactions. - For
errorevents, thetransactionsarray may contain partial data if the error occurred mid-flow. - Documentation for the iframe integration has been updated to reflect these changes.
- A new example HTML file (
TRANSACTION_HASH_EXAMPLE.html) is included for easy testing.
How to test
- Open
apps/dashboard/src/app/bridge/checkout-widget/TRANSACTION_HASH_EXAMPLE.htmlin a browser. - Perform a successful checkout and observe the
transactionsarray in the success event log on the right. - Trigger an error (e.g., by using an invalid payment method or insufficient funds) and observe the
transactionsarray (if any) in the error event log.
PR-Codex overview
This PR adds transaction hash information to the checkout widget iframe's success and error events, enabling developers to track on-chain transactions associated with payments made through the widget.
Detailed summary
- Updated
onSuccessandonErrorhandlers inCheckoutWidgetEmbed.client.tsxto include transaction hashes. - Enhanced documentation in
page.mdxwith examples for success and error events. - Created
TRANSACTION_HASH_EXAMPLE.htmlto demonstrate event logging. - Added changeset in
.changeset/checkout-widget-transaction-hash.mdfor release notes.
✨ Ask PR-Codex anything about this PR by commenting with
/codex {your question}