#joelalcedo-add-tip

1 messages · Page 1 of 1 (latest)

solar ridge
#

Hi there

hollow mirage
#

hi bismarck!

solar ridge
#

There is no way public way to do this exactly at the moment. The best thing to do would basically be to use auth & capture to authorize a higher amount and then capture the amount + tip. That said, I'd recommend reaching out to our Support team (https://support.stripe.com/contact/login) and ask if your account might be applicable for a feature that would accomplish this.

hollow mirage
#

i'm thinking i would do something like this...

const paymentIntent = await stripe.paymentIntents.update(
  'pi_3LMJxHGR0hudtWsC0kDo5tMW',
   amount: newAmount,
   "amount_details": {
    "tip": {newAmount-oldAmount}
  },

);
#

but if i update the payment intent in this fashion the payment would have to still be pending right?

solar ridge
#

That won't work for online payments. Tipping is currently only supported for in-person payments.

hollow mirage
#

ahh

#

ok, so based on your suggestion, the idea is to authorize the payment first, then when the activity is complete, if the user chooses to leave a tip or not, the payment is captured at that time

#

based on my payment flow that would work quite well, but how to flag the payment intent as pending until some point in the future?

#

let's say the payment is made on september 8th, and the event happens on the 10th at 8:30AM. is there a way to tell the payment intent not to capture until the user performs some action on the 10th?

solar ridge
#

You would need to make it clear to your customer that you are authorizing for a greater amount than whatever you are charging for the product.

#

Yep

#

Authorizations hold for 7 days

hollow mirage
#

ok that makes a lot of sense, i will take a closer look.
my understanding is that authorizations hold for 7 days but could be longer eg. if there's a custom flow that would require a quicker or longer hold, right?

solar ridge
#

The authorization can be held for up to 7 days

#

Then it will automatically be released

hollow mirage
#

i see, would it be possible to hold an authorization for more than 7 days in any circumstance?

#

if not, are there any other approaches to leaving a tip beyond associating it with the original payment intent (e.g. creating another payment intent) that could be a good workaround?

solar ridge
#

Yep that would be the other thing to do

#

Store the card details and then charge again later for the tip

hollow mirage
#

is there a way to use the same card details as the original card used for the other payment intent, so i don't have to create another payment form to make the experience a seamless one for the customer?

solar ridge
#

Yep

#

Which integration flow are you using

#

(How are you charging them the first time?)

hollow mirage
#

stripe.paymentIntents.create --> get client secret & ephemeral key --> display payment sheet --> confirm payment

#

i guess in the charge id i would have the card details used for the payment?

cursive ivy
#

not really no

#

a Charge id ch_123 is just the id of the "payment record"

hollow mirage
#

ahh

cursive ivy
#

It really depends how you are planning to approach all of this, whether you charge upfront or just save card details for later, etc.

hollow mirage
#

i set it up so there is a customer account and payment method that is saved b y using setup_future_usage...after looking at my payment intent that is emitted in my webhook, i see there is a "payment_method": "pm_1LfolKGR0hudtWsC5idow1Us", object - would i use that? i think 100% of the time based on my payment flow because setup_future_usage: 'off_session', is hardcoded into the payment intent created there will always be an associated payment method i can refer back to....would that be how it works?

cursive ivy
#

yes

hollow mirage
#

in other words, could i pass "payment_method" from one payment intent object into another payment intent that serves as the tip?

hollow mirage
#

i see. ok, this is super helpful. one final ask - is there a way to charge as quickly as possible, i.e. not authorize for the full 7 days?

cursive ivy
#

The default is to charge immediately

#

the "authorization for 7 days" is a feature you opt into explicitly with code. So if you don't want to do that, you just don't really

hollow mirage
#

hey - sorry for the delayed response - really appreciate you and bismarck's help here! you guys rock!