@@ -231,6 +231,9 @@ export const GiftCardPurchaseScene: React.FC<Props> = props => {
231231 const [ amountText , setAmountText ] = React . useState < string > (
232232 hasFixedDenominations ? String ( sortedDenominations [ 0 ] ) : ''
233233 )
234+ const [ amountInputError , setAmountInputError ] = React . useState <
235+ string | undefined
236+ > ( )
234237
235238 // Update selection when denominations become available (e.g., after brand fetch)
236239 React . useEffect ( ( ) => {
@@ -247,6 +250,7 @@ export const GiftCardPurchaseScene: React.FC<Props> = props => {
247250 setMinimumWarning ( null )
248251 setProductUnavailable ( false )
249252 setError ( null )
253+ setAmountInputError ( undefined )
250254
251255 // Only allow numbers and decimal point
252256 const cleaned = text . replace ( / [ ^ 0 - 9 . ] / g, '' )
@@ -262,12 +266,38 @@ export const GiftCardPurchaseScene: React.FC<Props> = props => {
262266 }
263267 } )
264268
269+ // Validate amount on blur for variable range cards
270+ const handleAmountBlur = useHandler ( ( ) => {
271+ if ( ! hasVariableRange || amountText === '' ) return
272+
273+ const parsed = parseFloat ( amountText )
274+ if ( isNaN ( parsed ) ) return
275+
276+ const fiatSymbol = getFiatSymbol ( brand . currency )
277+ if ( parsed < minVal ) {
278+ setAmountInputError (
279+ sprintf (
280+ lstrings . card_amount_min_error_message_1s ,
281+ `${ fiatSymbol } ${ minVal } `
282+ )
283+ )
284+ } else if ( parsed > maxVal ) {
285+ setAmountInputError (
286+ sprintf (
287+ lstrings . card_amount_max_error_message_1s ,
288+ `${ fiatSymbol } ${ maxVal } `
289+ )
290+ )
291+ }
292+ } )
293+
265294 // Handle MAX button press
266295 const handleMaxPress = useHandler ( ( ) => {
267296 if ( hasVariableRange ) {
268297 setMinimumWarning ( null )
269298 setProductUnavailable ( false )
270299 setError ( null )
300+ setAmountInputError ( undefined )
271301 setAmountText ( String ( maxVal ) )
272302 setSelectedAmount ( maxVal )
273303 }
@@ -732,10 +762,13 @@ export const GiftCardPurchaseScene: React.FC<Props> = props => {
732762 < FilledTextInput
733763 value = { amountText }
734764 onChangeText = { handleAmountChange }
765+ onBlur = { handleAmountBlur }
735766 keyboardType = "decimal-pad"
767+ returnKeyType = "done"
736768 placeholder = { `${ minVal } ${ brand . currency } - ${ maxVal } ${ brand . currency } ` }
737769 clearIcon
738770 textsizeRem = { 1.5 }
771+ error = { amountInputError }
739772 />
740773 < EdgeTouchableOpacity
741774 style = { styles . maxButton }
0 commit comments