#Vortixz

1 messages · Page 1 of 1 (latest)

mellow fogBOT
cunning compass
#

Can you tell me more about what you are trying to figure out at the moment? I can see if my colleagues who are more knowledgable there are online but it will be helpful to ask specific questions when seeing if they can help now

austere atlas
#

Yes i'll try to explain it. So the firebase extension basically listens for me to write a document to the database. Then it immediatly appends more values to that document, for example the paymentIntentClientSecret. Now when the page renders for the first time it does this. But i'm stuck with getting the new values back.

#

I'm thinking of using the firebase onSnapshot method but this method also listens to the creation of the document but I want it to only listen to the update. I'm looking for a certain flow which ensures that I'm always getting the updated values back (to prevent empty client secrets etc.)

cunning compass
#

Gotcha, thanks for the clarification. Reaching out to my colleagues to see if they are online. Otherwise you can open a ticket with us and they can get to it when they are in

austere atlas
#

thank you very much

sharp timber
austere atlas
#

hey, yeah thats stripe/firestore-stripe-payments@0.3.2

sharp timber
#

And you're calling the createCheckoutSession function? What params do you pass?

austere atlas
#

i'll show you how i've done it

sharp timber
#

Please do

austere atlas
#

i tweaked a lot of this code and im trying to rework it so it might not be 100% correct but it wasn't in the first place. it's just to show the idea

#

this code was executed on the first render. it gets it values from the following method

sharp timber
#

I'm more interested in your server-side function that creates those params for the Payment Sheet

austere atlas
#

so i made the document and the i'd map through the checkout_sessions collection and get the 0'th index which is bad because

austere atlas
#

what i would essentially want is make the document, and listen to the update that the extension performs. and then retrieve these added values and call initPaymentSheet with it

sharp timber
austere atlas
#

yea you're right it really is more of a firebase Q but i was hoping that someone was experienced with the extension and firebase

#

onSnapshot also triggers when the document gets created

sharp timber
#

I am experienced with the extension, I help maintain it to an extent. But you aren't really using the extension

#

You're creating your documents directly, as opposed to using the createCheckoutSession the extension exposes

#

Which should handle this

austere atlas
#

i haven't read about this method

austere atlas
#

there's nothing about the createCheckoutSession there. And this is basically what the extension does. By adding a document to the firestore it creates a checkout session

#

the extension listens to the created document and appends credentials like the payment intent client secret. i only need to fetch that updated document

#

using onsnapshot would also trigger when I make the document, so its not certain that the extension has already added the new values

sharp timber
#

I guess you'd want a modified type in this instance

austere atlas
#

YES that's it. I must have read over this

#

can you help me implement this code using the initPaymentSheet or is that not possible?

sharp timber
#

I can try help with any specific issues you encounter, I can't write code for you

austere atlas
#

I completely understand, I assume those issues should be directly associated with Stripe?

sharp timber
#

Not sure what you mean

austere atlas
#

Let's say I'm having issues with getting the values from the onSnapShot into the initPayment() is that something you could assist me with. Or only if the issue is related to Stripe

sharp timber
#

As I said, I can try. But you need to try and implement it yourself at least and come back with any specific issues/errors

austere atlas
#

Okay ill do that. Thank you for your help!

#

Hey, i managed to make it work using relatively few code and personally i think it's a really clean way of setting up Stripe's payment sheet using RN and the FB extension. It would've really helped me if there would've been a little more documentation regarding this.\

#

I'll share the code in case you'd like to take a look

sharp timber
#

Feel free to open a PR on the repository if you think the documentation can be improved! I'd be happy to take a look

#

Glad to hear you're unblocked 🎉

austere atlas
#

Oh sorry i sent it here

sharp timber
#

Looks good!