Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

221
Vistas
where to call onPlanPurchased( ) method after it is in events.js or does it gets automatically called?

My idea is to make a wallet collection in database which I will create manually through wix velo code. After a pricing plan is purchased by the user where to do I call onPlanPurchased( ) method to add the amount in the wallet

import wixData from 'wix-data';

export function wixPaidPlans_onPlanPurchased(event) {
  if (event.order.price.amount === 0) {
     let orderData = {
       "title": "Free plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData);
  } else {
     let orderData = {
       "title": "Regular plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData); 
  }
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

The event handlers that you add to the events.js file in the backed are called automatically by Wix. So, in your case, when a plan is purchased the wixPaidPlans_onPlanPurchased() function will be called and it will receive information about the plan that was purchased in the event argument that is passed to it.

Side point: I think the event you are using is being deprecated and you should use the one from wix-pricing-plans instead.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda