#spanila
1 messages ยท Page 1 of 1 (latest)
how about adding another card?
You'd follow the same Setup Intent flow to allow users to add multiple PMs
but i thought i will be using setupintent only in case user doesnt have payment method already
so i can create paymentintent
so first time user pays i create customer, setupintent add payment method, clone it into connected account and create paymentintent for direct charge
or what to do when the first one expires?
We do handle automatic updates for cards expiring in certian circumstances: https://stripe.com/docs/payments/cards/overview#automatic-card-updates
and if i want to add another card, we need to do ui ourselves?
but i thought i will be using setupintent only in case user doesnt have payment method already
You'd utilise a Setup Intent in any scenario where you want to add a new PM, regardless of whether they have an existing PM or not
How are you allowing customers to add cards today?
basicaly only by hitting "pay" button.
Ok, but I mean which UIs/APIs?
I guess via the Payment Sheet, so you can just re-use that same flow to allow customers to add additional PMs
Is there a specific concern or something preventing you from doing that?
yes its regarding that shared platform customers that complicates everything i think
i cant save the info automaticaly, i need the setupintent to do it on platform customer right?
so i cant use paymentintent to manage cards in any way
Yes, you'd create/confirm a SetupIntent on the platform to generate the pm_xxx object which can be cloned between accounts. See: https://stripe.com/docs/payments/payment-methods/connect
ok and then i would somehow disable card management in PaymentSheet, and add button to add new card elsewhere for instance?
and that button will call new setupintent for platform customer...
AFAIK, you can't disable card management (removal) in the Payment Sheet currently if you're using Customer objects
i see, but when i clone customer, create paymentintent and then user removes card, it will be right there on next paymentintent
Hmm, is that not likely the new card saved during the payment? Can you share an example PI? Curious to see what parameters you use on creation
paymentIntent = await stripe.paymentIntents.create({
amount: amount,
currency: 'usd',
customer: clonedCustomer? clonedCustomer.id : null,
automatic_payment_methods: {enabled: true},
application_fee_amount: fee,
use_stripe_sdk: true,
capture_method: 'manual',
setup_future_usage: 'on_session',
description: event.course.name + ' ' + U.formatDatetime(event.datetime, event.trainer?.user?.timezone),
metadata: {
eventID: event.id,
userID: self.user.id,
eventAttendanceType: U.getEventUserAttendanceTypeByCode(params.eventAttendanceType),
}
}, stripeOptions);
const stripeOptions = {
stripeAccount: trainerUser.paymentInfo.connectedAccountID,
apiVersion: CONFIG('stripe_api_version')
};
but this will be called ONLY if customer has paymentMethod attached.
otherwise i generate this
setupIntent = await stripe.setupIntents.create({
customer: user.paymentInfo.customerID,
automatic_payment_methods: {
enabled: true,
},
});
Right, but in the scenario you described you're:
- Presenting the Payment Sheet
- Customer deletes existing payment method(s)
- They complete the purchase with a new card
Because of the setup_future_usage parameter you pass on PI creation, the PM used during that payment will also be saved separate to the Setup Intent
yes, that may be a mishup on my part. we already tried this and i cant really use paymentintent to store cards as paymentmethod lives in connected account and customer is platform.
s_f_u essentially allows you to save payment details during a payment with a PI, separate to a SI where there's no actual initial payment (you're just saving the card)
and if the card attaches itself into cloned customer, i cant copy it to platform customer
Then you need to remove the s_f_u parameter
Assuming you're correctly saved/setup the card on the platform with a Setup Intent and cloned it to the connected account, s_f_u is redundant
ok, i understand, removing it...
Especially in your Connect scenario as you describe it
so we have adding the first card solved i think. it should work via initial payment.
by using setupintent and only after that using paymentintent
and now the adding another or removing cards - can i use some sdk view for this, or do i need to do ui with list of paymentmethods with option to remove and button to add another?
I believe the Customer Sheet should help here: https://stripe.com/docs/elements/customer-sheet?platform=ios
The deletion aspect that is
The adding another PM would jsut be the same Setup Intent and Payment Sheet flow
yea i get it, for adding, i need another endpoint that generates setupintent ๐
ok last hurdle is then to not allow card management via payment sheet
Yeah as I said I don't think you can prevent that currently
yes, i found https://stackoverflow.com/questions/76182147/disable-stripe-card-editing-from-sdk-interface and you confirmed it
wel, i guess its just a ui bug, not affecting flow or anything.
we can say were "working on it" and when you implement it we can "fix" it ๐
That won't prevent customers from paying it just means that if they open the Payment Sheet and delete a card, then pay with a new card, that new card won't be saved
yes, they should use our ui when they want to save it. unfortunate but not deal breaker
and last question - when connected account creates refund - via web ui on stipe, we would like to return app_fee
is there any setting i can enable so its done automatically?
probably not, so does listening to event refund.create and then create feerefund sounds right?
No, you'd need to listen to charge.refunded events on your connected accounts and then refund the application fee manually: https://stripe.com/docs/api/fee_refunds/create
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
ok, other event then. that sounds better actually, what if it failed ofc... thank you very much for help. you saved me days!!!
you're welcome
you guys have too much stuff and options, hard to navigate the docs ๐