Week 8 Issue and Resolution

Title : Issue Current and Resolution
Author : Sampurna Adhikari
This week i was able to run the app on IOS as well. The error was simple , Previously the Folder was named as Advanced Studio which prevented the building of the IOS, and Android handles that space but for IOS it was a different case and then when i changed the Folder to AdvancedStudio it was installed and the app ran smoothly . via npx expo run:ios 



The next error was with the Stripe Onboarding for the users who are signed in. Before i was able to continue with Stripe Onboarding as a Food Donor and when i try to do the same for Food Receiver i was unable to proceed and the error was

 LOG Connecting with: {"email": "sampurna009@mailinator.com", "userId": "PnDfo6QYeuemGvBF50xm1gpNNyU2"} LOG Status: 500 [React] ' Stripe Connect Error:', [Error: role is not defined] LOG Response: {"error":"role is not defined"} ERROR Stripe Connect Error: [Error: role is not defined] Code: StripeConnectButton.js 32 | const data = JSON.parse(text); 33 | > 34 | if (!res.ok) throw new Error(data.error || "Failed to create Stripe account"); | ^ 35 | 36 | if (data.onboardingUrl) { 37 | Alert.alert("Stripe Onboarding", "Opening Stripe setup page..."); Call Stack handleConnectStripe (app/components/StripeConnectButton.js:34:35).   ??


 
when creating a Stripe Connect account, i should also provide the user's role which was a crucial point on the app as i have two users and by doing this i was able to resolve the problem. 

Straight from Terminal Log

📍 POST /api/stripe/create-connected-account
POST /api/stripe/create-connected-account
Received: {
  userId: 'PnDfo6QYeuemGvBF50xm1gpNNyR2',
  email: 'sampurna009@mailinator.com',
  role: 'Food Receiver'
}
Stripe account created: acct_1SQRDiD8zblCawgi
 Saved Stripe ID in users/PnDfo6QYeuemGvBF50xm1gpNNyU2
Onboarding link created: https://connect.stripe.com/setup/e/acct_1SQRDiD8zblCawgi/zDiuv3m8jU7a
emulator IOS Screenshot for Stripe onboarding


^C



Comments

Popular posts from this blog

Week 3 Activity

Week-5 Report (Food NextDoor)

Research: Reducing Food Waste with Smart Apps