#tap - react native

1 messages · Page 1 of 1 (latest)

summer mason
#

You linked to a guide that refers to CHeckout, but you're discussing payment intents. Are you trying to use checkout, or are you trying to build a custom integration using the payment sheet?

#

Since you're describing payment intents and the payment sheet, i assume you're aiming for the custom integration

#

which is specific to the RN + custom payment flow

#

you need to build an endpoint to supply the app with a payment intent client secret plus customer/ephemeral key

inland magnet
#

yes yes! I'm on the same guide, i just hadnt navigated to the RN specific version when i linked it in the first msg.

I have an endpoint created which successfully create payment intents that display on the payment screen of the Stripe dashboard.

The fetchSheetParams is giving me trouble as Idk what API_URL I should be passing it.

#

For reference:

#

const fetchPaymentSheetParams = async () => {
const response = await fetch(${API_URL}/payment-sheet, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
});
const { paymentIntent, ephemeralKey, customer } = await response.json();

summer mason
#

Gotcha, well I wasnt sure because the snippet you references earlier uses the /checkout endpoint

#

API_URL here is just the root of your backend API/server

#

Oh i see, i missed the other section 🤦‍♂️

#

I think that might be a bug in the docs snippets

#

that should probably be calling {API_URL}/payment-sheet as created in the previous step

inland magnet
#

heard heard! let me give that a shot

#

you da best

summer mason
#

👍

#

let me know if that get it going

inland magnet
#

yargggg im not sure if im getting the right api_url. this is my first venture into this world

summer mason
#

How is your backend running?

inland magnet
#

would i not be calling the stripe api?

summer mason
#

Are you able to hit the endpoint your created manually?

#

No, that's your own api, where you create that /payment-sheet endpoint

inland magnet
#

when the user clicks checkout, an order doc is created and stored in my firebase db.

(this that follows is setup through Stripe's firebase extension) cloud functions listen to that db and creates a paymentIntent i the stripe dashboard. This paymentIntent's status is 'requires_payment_method'

#

I have all the info I need (paymentIntent, ephemeralKey, customer) saved in the db. I just need to present a payment screen and get their card info. I'll hopefully set up saving payment methods later

#

so NO, i do not access the endpoint manually :/

summer mason
#

I unfortunately don't really understand how that works

#

Do you have a server/backend you control outside of firebase?

#

or can you create an explicit endpoint to access that set of data somehow>

#

You need to get those to your client application for this to work

inland magnet
#

heard. I've got no more GOOD questions just yet. Thanks for all your help.

#

oo! wait one more. let me replicate this error

#

brb