functions-samples icon indicating copy to clipboard operation
functions-samples copied to clipboard

Stripe sample addPaymentMethodDetails is missing some logic

Open garyo opened this issue 5 years ago • 0 comments

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.

garyo avatar Sep 29 '20 19:09 garyo