#brometheus_api

1 messages ยท Page 1 of 1 (latest)

rapid ledgeBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1255633885648388249

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

prisma bone
#

๐Ÿ‘‹ Hi! I'm an engineer, new to working with Stripe within my company, so might be posting a bunch in the near future

sick crystal
#

There's no way to add custom form-level validation as far as I know, but you could use Radar to block transactions from certain area codes. Not sure if that solves your problem though.

prisma bone
#

Hmm, ok, thanks.

As I have additional Stripe questions, do you recommend I ask in this thread? Or create new threads

#

And for bug reports / feature requests, should that go here? Or to Customer Support

sick crystal
#

If you have a new question and the thread is open, you can just ask here. We close threads after ~20 to 30 minutes of idleness, so as long as the thread's open, you're welcome to ask here.

Bug reports go here. Feature requests go to support ( https://support.stripe.com/contact/email )

#

P.s. Thanks for checking in about norms! We are able to be most helpful when folks are mindful about how the server is organized.

prisma bone
#

Thanks! A few more questions coming your way then

We expect our customers to only have one payment method on file at a time (and don't want to deal with storing / managing alternate or old payment methods at this time)

We do a combination of payment_intents for on-session purchases, new subscriptions (which create payment_intents), and setup_intents (to modify saved payment method to be used later for off-session payments, for either subscription monthly payments or for some payment_intents we trigger later for other reasons). We use Stripe Elements (Payment & Address elements) + BE calls/webhooks.

I have a webhook on "payment_intent.succeeded" | "setup_intent.succeeded" that looks for the customer's most recently created payment method, and stores that as the customer's default payment method. (and also copies the billing address from that payment method onto the customer as their billing address)

  1. Is there any way to configure the payment_intent / setup_intent element to perform this action for me, instead of relying on a webhook to do this?
  2. We query this with:
    payment_methods = await stripe.Customer.list_payment_methods_async(
        customer=customer_id
    )

    latest_payment_method = payment_methods.data[0]
  • is there a better / safer way to do this? Feels a bit error prone in case the [0] item (most recently created) isn't that same one that was just used on the successful payment_intent
sick crystal
#

Fair point about that being a little error prone. That being said, the only way to add a new Payment Method as the default would be to make another API call, and the soonest you could do that would be when promise returned by the Payment Element resolves, which could be error prone in its own way (e.g. what happens if the customer closes the window or has a network error while confirming the new Payment Method?).

For that reason, I'd say it's probably better to use payment_method.attached, since that will always occur when a new Payment Method is added to a Customer: https://docs.stripe.com/api/events/types#event_types-payment_method.attached