File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ import { useStripePayment } from '@/hooks/useStripePayment';
55import { usePaymentMethods } from '@/hooks/usePaymentMethods' ;
66import { useToast } from '@/hooks/use-toast' ;
77import { CampaignFormData } from './useCampaignFormState' ;
8+ import { functions } from '@/lib/firebase' ;
9+ import { httpsCallable } from 'firebase/functions' ;
810
911export const useCampaignFormSubmission = (
1012 formData : CampaignFormData ,
@@ -85,8 +87,6 @@ export const useCampaignFormSubmission = (
8587 await new Promise ( resolve => setTimeout ( resolve , 500 ) ) ;
8688
8789 // Récupérer les données fraîches via Firebase
88- const { functions } = await import ( '@/lib/firebase' ) ;
89- const { httpsCallable } = await import ( 'firebase/functions' ) ;
9090 const getPaymentMethods = httpsCallable ( functions , 'stripeGetPaymentMethods' ) ;
9191 const freshCardsResponse = await getPaymentMethods ( { userEmail : user ?. email } ) ;
9292 const freshCardsData = freshCardsResponse . data as { paymentMethods ?: any [ ] } ;
Original file line number Diff line number Diff line change 11
22import { PaymentDistribution } from './types' ;
33import { EmailService } from '../emailService' ;
4+ import { functions } from '@/lib/firebase' ;
5+ import { httpsCallable } from 'firebase/functions' ;
46
57// 🆕 NOUVEAU : Service Stripe Connect pour transfers automatiques
68export const processStripeTransfers = async (
@@ -35,8 +37,6 @@ export const processStripeTransfers = async (
3537 console . log ( `💸 Création transfer pour ${ payment . affiliateName } - ${ payment . totalCommission } €` ) ;
3638
3739 // Créer le transfer Stripe via Firebase
38- const { functions } = await import ( '@/lib/firebase' ) ;
39- const { httpsCallable } = await import ( 'firebase/functions' ) ;
4040 const createTransfer = httpsCallable ( functions , 'stripeCreateTransfer' ) ;
4141
4242 const transferResult = await createTransfer ( {
You can’t perform that action at this time.
0 commit comments