( customer: string | Stripe.Customer | Stripe.DeletedCustomer | null | undefined )
| 20 | * `customer` field (id string, full `Customer`, or `DeletedCustomer`). |
| 21 | */ |
| 22 | export function getCustomerId( |
| 23 | customer: string | Stripe.Customer | Stripe.DeletedCustomer | null | undefined |
| 24 | ): string | undefined { |
| 25 | if (!customer) return undefined |
| 26 | return typeof customer === 'string' ? customer : customer.id |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Resolve a subscription's default payment method with fallback to the |