#tap - react native
1 messages · Page 1 of 1 (latest)
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
In which case you should refer to this version of that guide: https://stripe.com/docs/payments/accept-a-payment?platform=react-native&ui=payment-sheet#react-native-add-server-endpoint
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
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();
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
yargggg im not sure if im getting the right api_url. this is my first venture into this world
How is your backend running?
would i not be calling the stripe api?
Are you able to hit the endpoint your created manually?
No, that's your own api, where you create that /payment-sheet endpoint
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 :/