functions-samples
functions-samples copied to clipboard
Stripe sample addPaymentMethodDetails is missing some logic
See https://github.com/firebase/functions-samples/blob/7eb43734bb88fb9ba9e859ae558f72b185377f28/stripe/functions/index.js#L61
In that line, paymentMethod.customer returned from stripe.paymentMethods.retrieve() may be a string, null, or a Customer object. The code should treat each of those cases separately when creating the setupIntent from it. Noticed that while porting it over to Typescript.