Im using react js and firebase firestore and it gives this error
Unhandled Rejection (FirebaseError): Function DocumentReference.set() called with invalid data. Unsupported field value: undefined (found in document users/tDJ1zI9JWwakZdq5CkFh/orders/pi_1ILaCRDbKBqU3OnKnhbGH0Dv)
here’s the code that is giving error according to the chrome
}).then(({ paymentIntent }) => {
51 | // paymentIntent = payment confirmation
52 |
> 53 | db.collection('users').doc(user?.uid).collection('orders').doc(paymentIntent.id).set({
| ^ 54 | basket: basket,
55 | amount: paymentIntent.amount,
56 | created: paymentIntent.created
event.preventDefault();
44 | setProcessing(true);
45 |
> 46 | const payload = await stripe.confirmCardPayment(clientSecret, {
| ^ 47 | payment_method: {
48 | card: elements.getElement(CardElement)
49 | }
db is the firebase details like api key and stuff.
here is an image of that error