#barney-laurance_api

1 messages ¡ Page 1 of 1 (latest)

noble bobcatBOT
#

👋 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/1367822383385149450

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

shadow salmon
#

You'd omit the setup_future_usage param on the intent and use a Customer Session to render a 'save' checkbox

willow flint
#

When the customer does not tick the box to save payment details I would prefer to honour their instruction by not saving the details. Currently they are saved and attached to the customer when we confirm, so we have to avoid presenting them to the customer when they look at saved cards, and I feel we need to implement something to search through the customer records and detach all these cards that the customer didn't want saved. If we can avoid saving them in the first place that would be much better.

Btw our application code is all public on github so happy to share links to any relavent parts.

shadow salmon
#

Sounds like you're setting s_f_u then which will save irregardless of the checkbox. Got an example?

willow flint
#

You'd omit the setup_future_usage param on the intent and use a Customer Session to render a 'save' checkbox

Thanks but at the time we create the intent we don't know if the customer is going to tick the "Save payment details for future purchases" box or not. If they do tick it then we do want to save it.

shadow salmon
#

Sure, which is the flow that the guide I linked outlines

#
  • Create a payment without s_f_u
  • Configure the Payment Element to allow customer to save the details if they want
  • If they check the box, it's saved, otherwise it's discarded post payment
willow flint
shadow salmon
shadow salmon
#

Or at least that is set somehow

willow flint
#

OK thank you - sounds like we just need to change it to null here then https://github.com/thebiggive/donate-frontend/blob/273e57eb2adb5710dddcd2737e566fa1c606b62b/src/app/stripe.service.ts#L172 . I'll try that. It's a while since we worked on this area of the site, I feel like we had problems doing that before in the case when the customer did want to save the card, but I just tested now on my local and it does look like the tickbox still appears.

Am I right to think that if we set that to null then Stripe should attach the PM to the customer if and only if they tick the box?

GitHub

Front-end web app to discover campaigns on the Big Give & donate to them - thebiggive/donate-frontend

shadow salmon
#

sounds like we just need to change it to null here then
Yes, if you pass a value there that will take precedence over the customer facing checkbox and we'll save regardless

Am I right to think that if we set that to null then Stripe should attach the PM to the customer if and only if they tick the box?
Yes, as outlined here

Learn how to save the customer's payment method when you confirm a PaymentIntent.

willow flint
#

Great I will try adjusting that thank you. Then we'll just need to do a one-off job to clear the PMs we've saved that we can't use.

#

If they tick the box how does stripe know whether to save the card for on session or off session use?

shadow salmon
willow flint
shadow salmon
willow flint
#

I 'm going to test that out. Would you like me to let you know later / next week if it all seems to work?

My tech lead Noel might join the discussion here later as well.

Thanks again ynnoj.