Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
Angular y Stripe: expansión de la recuperación de clientes para obtener fuentes

Estoy tratando de integrar Angular 8 con Stripe. Al leer la documentación, vi que necesito expandir la recuperación del Cliente para obtener los datos de las Fuentes , pero aún no obtuve:

clientes.ts

 // Read the stripe customer ID from firestore, or create a new one if missing export const getOrCreateCustomer = async (uid: string) => { const user = await getUser(uid); const customerId = user && user.stripeCustomerId; const listOptions = {limit: 100}; // If missing customerID, create it if (!customerId) { return createCustomer(uid); } else { const params = stripe.customers.listSources(customerId, listOptions); // -> this is my start approach, but I don't know how to include it into Customer Retrieve const customer = stripe.customers.retrieve(customerId); console.log(customer); return customer; } };

fuentes.ts

 // Attaches a payment source to a stripe customer account. export const attachSource = async (uid: string, source: string) => { const customer = await getOrCreateCustomer(uid); const existingSource = customer.sources.data.filter((s) => s.id === source).pop();// -> here there is an error if (existingSource) { return existingSource; } else { await stripe.customers.createSource(customer.id, { source }); return await stripe.customers.update(customer.id, { default_source: source }); } };

Como no pude expandir la recuperación del Cliente, el archivo source.ts muestra el error:

La propiedad 'fuentes' no existe en el tipo 'Respuesta | (DeletedCustomer & { lastResponse: { headers: { [key: string]: string; }; requestId: string; statusCode: number; apiVersion?: string; idempotencyKey?: string; stripeAccount?: string; }; })'. La propiedad 'fuentes' no existe en el tipo 'DeletedCustomer & { lastResponse: { headers: { [key: string]: string; }; ID de solicitud: cadena; código de estado: número; apiVersion?: cadena; clave de idempotencia?: cadena; stripeCuenta?: cadena; }; }'.ts(2339)

Encontré en una publicación algo similar, pero en PHP, que menciona sobre tarjetas. Pero no entendí si sería lo mismo que estoy buscando (además, no explica cómo obtener los datos que necesito).

¿Cómo puedo hacer esto?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!