#thomas_58040-firebase-comparison

1 messages · Page 1 of 1 (latest)

amber ermineBOT
subtle saddle
#

Hi 👋 I'm not too familiar with exactly what that code is doing, but it looks to me like it is looking at the Subscription to see if that object has a default_payment_method set, and if so is doing something to update the Customer record to also use the payment method referenced there, possibly as the Customer's new default payment method.

viral apex
#
  const customer = payment_method.customer as string;
  const { name, phone, address } = payment_method.billing_details;
  await stripe.customers.update(customer, { name, phone, address });

It's like updating the name and the phone and address. I know this isn't Stripe maintained anymore, but I was just curious if there was an obvious reason why an operation like this would be needed.

subtle saddle
#

The only scenario that comes to mind offhand, is if you created a Customer object with bare minimum information (those objects have no or very few required fields) and are then updating the Customer object later based off of information they provided during checkout.

viral apex
#

Ohh, that does make sense I guess. Thanks! Hmm. Ok, Interesting. It also calls it out as an "costly operation". Does Stripe charge money for these types of updates.

subtle saddle
#

No, updating objects via our API does not incur a cost.

viral apex
#

Cool, thanks for the help.

subtle saddle
#

Any time!

#

thomas_58040-firebase-comparison