22
33import { useCallback , useEffect , useState } from "react" ;
44import { LoadingButton } from "@mui/lab" ;
5- import { Box , Card , CardContent , CardHeader , TextField , Alert , Typography , IconButton , Tooltip , Checkbox , FormControlLabel , Stepper , Step , StepLabel , Chip , Table , TableBody , TableRow , TableCell , Divider , Button } from "@mui/material" ;
5+ import { Box , Card , CardContent , CardHeader , TextField , Alert , Typography , IconButton , Tooltip , Stepper , Step , StepLabel , Chip , Table , TableBody , TableRow , TableCell , Divider , Button } from "@mui/material" ;
66import ContentCopyIcon from "@mui/icons-material/ContentCopy" ;
77import Grid from "@mui/material/Grid2" ;
88import { createPaymentSession , exchangePaymentForCardToken } from "@/integrations/checkout" ;
@@ -94,10 +94,6 @@ export default function AddCardPage() {
9494 // Flag indicating whether the user has clicked "Start checkout"
9595 const [ formReady , setFormReady ] = useState ( false ) ;
9696
97- // Explicit consent to store card details
98- const [ consentGiven , setConsentGiven ] = useState ( false ) ;
99- const [ consentRecordedAt , setConsentRecordedAt ] = useState < string | null > ( null ) ;
100-
10197 /**
10298 * Retrieve the Dwolla Customer ID from session storage.
10399 * This ID was stored in the previous step (create-customer page).
@@ -456,19 +452,6 @@ export default function AddCardPage() {
456452 </ Grid >
457453 </ Grid >
458454
459- < FormControlLabel
460- control = {
461- < Checkbox
462- checked = { consentGiven }
463- onChange = { ( e ) => setConsentGiven ( e . target . checked ) }
464- name = "consent"
465- color = "primary"
466- />
467- }
468- label = "I consent to storing my card details to complete payouts."
469- sx = { { mb : 1 } }
470- />
471-
472455 < LoadingButton
473456 type = "button"
474457 fullWidth
@@ -477,15 +460,11 @@ export default function AddCardPage() {
477460 ! amount ||
478461 Number ( amount ) <= 0 ||
479462 Object . values ( billing ) . some ( ( v ) => ! v ) ||
480- formReady ||
481- ! consentGiven
463+ formReady
482464 }
483465 size = "large"
484466 variant = "contained"
485467 onClick = { ( ) => {
486- const timestamp = new Date ( ) . toISOString ( ) ;
487- setConsentRecordedAt ( timestamp ) ;
488- logEvent ( `Consent recorded at ${ timestamp } . Proceeding to checkout...` , "success" ) ;
489468 setFormReady ( true ) ;
490469 } }
491470 sx = { { mt : 2 } }
@@ -527,7 +506,7 @@ export default function AddCardPage() {
527506 </ Box >
528507
529508 { /* Events log */ }
530- { ( events . length > 0 || consentRecordedAt || cardFundingSource || transfer ) && (
509+ { ( events . length > 0 || cardFundingSource || transfer ) && (
531510 < Card sx = { { p : 3 , mt : 2 } } >
532511 < Typography variant = "h6" sx = { { mb : 2 } } >
533512 Events log
0 commit comments