@@ -33,10 +33,13 @@ export const GiftCardDetailsCard: React.FC<Props> = ({ action }) => {
3333 const theme = useTheme ( )
3434 const styles = getStyles ( theme )
3535
36- // Backward compat: Prior versions stored the quoteId in the `orderId` field
37- // of EdgeTxActionGiftCard. Once edge-core-js adds an explicit `quoteId`
38- // field, prefer that and fall back to `orderId` for older transactions.
39- const quoteId = action . orderId
36+ // Backward compat: Prior versions stored the quoteId in the orderId field.
37+ // Detect legacy transactions by checking whether the explicit quoteId field
38+ // is populated. If missing, fall back to orderId which held the quoteId.
39+ const quoteId = action . quoteId ?? action . orderId
40+ const productId = action . productId
41+ // orderId is only meaningful when quoteId is separately populated (new format)
42+ const orderId = action . quoteId != null ? action . orderId : undefined
4043
4144 const handleRedeemPress = useHandler ( ( ) => {
4245 if ( redemption ?. url != null ) {
@@ -67,11 +70,17 @@ export const GiftCardDetailsCard: React.FC<Props> = ({ action }) => {
6770 `${ lstrings . string_amount } : ${ amountDisplay } ` ,
6871 `${ lstrings . gift_card_quote_id_label } : ${ quoteId } `
6972 ]
73+ if ( productId != null ) {
74+ lines . push ( `${ lstrings . gift_card_product_id_label } : ${ productId } ` )
75+ }
76+ if ( orderId != null ) {
77+ lines . push ( `${ lstrings . gift_card_order_id_label } : ${ orderId } ` )
78+ }
7079 if ( redemption ?. code != null ) {
7180 lines . push ( `${ lstrings . gift_card_security_code } : ${ redemption . code } ` )
7281 }
7382 return lines . join ( '\n' )
74- } , [ card . name , amountDisplay , quoteId , redemption ?. code ] )
83+ } , [ card . name , amountDisplay , quoteId , productId , orderId , redemption ?. code ] )
7584
7685 const handleCopyAll = useHandler ( ( ) => {
7786 triggerHaptic ( 'impactLight' )
@@ -96,6 +105,26 @@ export const GiftCardDetailsCard: React.FC<Props> = ({ action }) => {
96105
97106 < EdgeRow title = { lstrings . gift_card_quote_id_label } body = { quoteId } />
98107
108+ { productId != null ? (
109+ < >
110+ < DividerLineUi4 />
111+ < EdgeRow
112+ title = { lstrings . gift_card_product_id_label }
113+ body = { productId }
114+ />
115+ </ >
116+ ) : null }
117+
118+ { orderId != null ? (
119+ < >
120+ < DividerLineUi4 />
121+ < EdgeRow
122+ title = { lstrings . gift_card_order_id_label }
123+ body = { orderId }
124+ />
125+ </ >
126+ ) : null }
127+
99128 { redemption ?. code != null ? (
100129 < >
101130 < DividerLineUi4 />
0 commit comments