(stripeCustomerId: string)
| 71 | }); |
| 72 | |
| 73 | export async function getPaymentMethods(stripeCustomerId: string) { |
| 74 | const customer = await stripe.customers.retrieve(stripeCustomerId); |
| 75 | |
| 76 | if (customer.deleted) { |
| 77 | return undefined; |
| 78 | } |
| 79 | |
| 80 | return await stripe.paymentMethods.list({ |
| 81 | customer: stripeCustomerId, |
| 82 | type: "card", |
| 83 | }); |
| 84 | } |
| 85 | |
| 86 | export function usdToCents(usd: number | Decimal) { |
| 87 | const cents = Math.round(Number(usd) * 100); |
no outgoing calls
no test coverage detected