#Devonthedo88 - Tips
1 messages · Page 1 of 1 (latest)
Do I need to do a whole other payment intent to add tip?
@echo perch I'm sorry I don't follow what question you have
The highlighted section tells you that in the US you can capture more than the original amount for tips
you say the same sentence, with no info
you create a PaymentIntent for $30. You confirm it with your Terminal reader. Then when you go to capture, you capture $35 and you have a $5 tip
im using JS
const paymentIntent = await stripe.paymentIntents.create({
customer: data.customer,
setup_future_usage: "off_session",
amount: data.amount,
currency: "USD",
automatic_payment_methods: {
enabled: true,
},
});
return { clientSecret: paymentIntent.client_secret, Payment: paymentIntent };
});```
So there is there i create the payment intent.
then to add tip I do exports.capture = functions.https.onCall(async (data, context) => { const capture = await stripe.paymentIntents.capture( "pi_3KeS3RFXkUN0aehr0Jio4ZiK", { amount_to_capture: 1800, } ); return { status: capture.status }; });
Right
just to clarify: are you using Terminal with a physical reader?
No
Im making a uber type app
so I want to make a chrage for the trip but be able to add a tip
cool that's the problem you linked to a Terminal-specific doc
it's impossible to add a tip after the fact in your case, we don't support it. So you'll have to either authorize more in advance, or do a separate payment for th tip
is there a way if the card is not catptured in like 3 hours to auto charge.
no
Okay dokie thanks
Sure!
Is there a way to get all the uncaptured charges? and maybe at the end of the night a function submits them
we don't have a filter for captured so you have to use https://stripe.com/docs/api/charges/list and filter on your end
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.