#yeet_api
1 messages · Page 1 of 1 (latest)
đź‘‹ Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đź”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1390184383624908961
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
const handleReaderPayment = async () => {
console.log('[Stripe] Starting handleReaderPayment');
if (!reader) {
console.log('[Stripe] ❌ No reader connected');
return Alert.alert('Error', 'No reader connected');
}
setLoading(true);
console.log('[Stripe] Fetching PaymentIntent…');
const intentData = await fetchPaymentIntent('reader');
if (!intentData) {
console.log('[Stripe] ❌ Failed to fetch PaymentIntent');
setLoading(false);
return Alert.alert('Error', 'Failed to create PaymentIntent');
}
const { id: intentId, clientSecret } = intentData;
console.log('[Stripe] clientSecret:', clientSecret);
console.log('[Stripe] intentId:', intentId);
console.log('[Stripe] Collecting payment method from reader…');
const { paymentIntent: collectedIntent, error: collectError } =
await collectPaymentMethod(clientSecret, {
payment_intent_id: intentId,
});
if (collectError || !collectedIntent) {
console.log('[Stripe] ❌ collectPaymentMethod failed:', collectError?.message);
setLoading(false);
return finalizePayment(collectError || new Error('Collection failed'), null);
}
console.log('[Stripe] Collected Intent:', JSON.stringify(collectedIntent, null, 2));
console.log('[Stripe] Collected Intent ID:', collectedIntent?.id);
console.log('[Stripe] Collected Intent Status:', collectedIntent?.status);
console.log('[Stripe] Processing payment…');
const { paymentIntent: processedIntent, error: processError } =
await processPayment(collectedIntent);
if (processError) {
console.log('[Stripe] ❌ processPayment failed:', processError.message);
} else {
console.log('[Stripe] âś… Payment processed successfully:', processedIntent?.id);
}
await finalizePayment(processError, processedIntent?.id);
};
thats my handle reader payment function to activate the tap to pay with my m2 reader
here are my logs:
[Stripe] Server response: {"data": {"clientSecret": "pi_3RgeVwBo2H3RxTBK2jHk836P_secret_dl40X312WswG2msm0Y0psVHxE", "id": "pi_3RgeVwBo2H3RxTBK2jHk836P"}, "error": false, "message": ""}
(NOBRIDGE) LOG [Stripe] âś… Received PaymentIntent: {"clientSecret": "pi_3RgeVwBo2H3RxTBK2jHk836P_secret_dl40X312WswG2msm0Y0psVHxE", "id": "pi_3RgeVwBo2H3RxTBK2jHk836P"}
(NOBRIDGE) LOG [Stripe] clientSecret: pi_3RgeVwBo2H3RxTBK2jHk836P_secret_dl40X312WswG2msm0Y0psVHxE
(NOBRIDGE) LOG [Stripe] intentId: pi_3RgeVwBo2H3RxTBK2jHk836P
(NOBRIDGE) LOG [Stripe] Collecting payment method from reader…
(NOBRIDGE) LOG [Stripe] ❌ collectPaymentMethod failed: You must provide paymentIntent.
(NOBRIDGE) LOG [Stripe] Finalizing payment…
(NOBRIDGE) LOG [Stripe] ❌ Stripe payment error: You must provide paymentIntent.
heres the documentation
Hi @tulip quail I'll be with you shortly
okay
https://stripe.dev/stripe-terminal-react-native/api-reference/types/CollectPaymentMethodParams.html the collectPaymentMethod function expect you to pass in a payment intent object, not just the payment intent id.
Documentation for @stripe/stripe-terminal-react-native
here's the example code https://docs.stripe.com/terminal/payments/collect-card-payment?terminal-sdk-platform=react-native#collect-payment
okay so is the screenshot i showed wrong?
payment_intent_id: intentId,
});```
This is your code, this is not what the function expects
in the screenshot i showed in the docs, it says collectpaymentmethod takes a request and options. it says the request is the only required field and that the request is the client secret, not intent
when i put a payment intent like how you showed, it takes the tap payment but then the payment never processes. i tried two different cards
it just gets stuck at processing payment log
Can you share with me the link to the doc?
Are you using react-native SDK or JS SDK?
react-native
The doc that you are reading is for JS SDK.
oh okay
so i think the mistake im making
in my backend im returning specific fields of my intent
resp := JSONResponse{
Error: false,
Data: map[string]string{
"id": intent.ID,
"clientSecret": intent.ClientSecret,
},
}
i should just return the whole intent and then pass that?
You can call retrievePaymentIntent on your react-native app to get the payment intent object and pass it to collectPaymentMethod
so i had tried that. when i tap the card it taps successfully but then the object still says that a payment was never read. and then when i pass it processPayment with the intent that was returned, it just stays there indefinitely and doesn't process
Ok, I think we discussed this earlier this week and I advised you to try again with a different card. Did you get a chance try it out?
ya i got 3 different cards now.
none of them work
and i used them earlier in the day for food and groceries and it worked there
Hmm, do you have another reader that you can use?
no i just bought this one
You can do a factory reset on it and try again?