fix(checkout): surface Transak order status on sale SALE_SUCCESS event - #2951
Draft
allan-almeida-imtbl wants to merge 2 commits into
Draft
allan-almeida-imtbl wants to merge 2 commits into
allan-almeida-imtbl wants to merge 2 commits into
Conversation
The sale widget card path emits SALE_SUCCESS as soon as Transak reports
PROCESSING (payment captured, mint not yet settled — typically a couple of
minutes). The host payload was {paymentMethod, transactions, tokenIds,
transactionId} with no field to tell PROCESSING from COMPLETED; the handler
already builds orderStatus but only forwarded transactionId.
Add an optional `status` field to the SaleSuccess event payload and thread the
Transak order status through sendSuccessEvent -> sendSaleSuccessEvent, so
integrators can distinguish a still-processing sale from a settled one and
reconcile settlement server-side using transactionId. Additive and backward
compatible (crypto payments, which settle synchronously, leave status undefined).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
View your CI Pipeline Execution ↗ for commit 84c1ba4
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The sale widget's card path emits
SALE_SUCCESSas soon as Transak reports PROCESSING — the card payment is captured but the mint has not settled yet (settlement takes ~2–3 min). The host payload is{ paymentMethod, transactions, tokenIds, transactionId }with no field to distinguish PROCESSING from COMPLETED, so integrators are told "success" while the order is still processing and can't tell the two apart.Root cause in
widgets/sale/views/PayWithCard.tsx:onOrderCompletedis wired to the same handler asonOrderProcessing, so the success path fires onTRANSAK_ORDER_SUCCESSFUL+ statusPROCESSING.detailsobject that already containsorderStatus, but onlydetails.transactionIdis forwarded —orderStatusis dropped before the event.Change (additive, non-breaking)
statusfield to the publicSaleSuccessevent type (checkout-sdk).useSaleEvents.sendSuccessEvent→SaleWidgetEvents.sendSaleSuccessEvent→ the hostSALE_SUCCESSpayload.Integrators can branch on
status('PROCESSING'vs'COMPLETED') and reconcile settlement server-side viatransactionId. Crypto payments (synchronous) leavestatusundefined, so existing consumers are unaffected.Not in scope (separate, breaking)
Does not change when success fires or the auto-close-on-PROCESSING behaviour — those alter existing semantics and need their own breaking change / product decision. This PR is the minimal, backward-compatible unblock.
Impact
The premature-success behaviour affects every live card-checkout integrator, not just one — e.g. Ubisoft/Fates, Chess Universe, Gods Unchained, TokenTrove, Striker Manager (per checkout analytics).
Tests
checkout-sdktypecheck passes;checkout-widgetstypecheck clean. No behavioural change to existing flows.🤖 Generated with Claude Code