phonepe #54
| @ -172,6 +172,7 @@ export const phonePeWebhook = onRequest({ | ||||
|                   let paymentType = orderData.metaInfo?.paymentType || 'Gym Membership'; | ||||
|                   let trainerId = orderData.metaInfo?.trainerId; | ||||
|                   let trainerData = null; | ||||
|                   let emailCustomer = membershipData?.fields?.['email'] || membershipData?.fields?.['Email Address']; | ||||
| 
 | ||||
|                   const discountPercentage = orderData.metaInfo?.discount || 0; | ||||
|                   const hasDiscount = discountPercentage > 0; | ||||
| @ -308,7 +309,7 @@ export const phonePeWebhook = onRequest({ | ||||
| 
 | ||||
|                   const formattedDate = format(new Date(), 'dd/MM/yyyy'); | ||||
| 
 | ||||
|                   if (membershipData?.fields?.['email']) { | ||||
|                   if (emailCustomer) { | ||||
|                     logger.info(`Preparing to send invoice email to customer: ${membershipData?.fields?.['email']}`); | ||||
|                     try { | ||||
|                       const emailSubject = isFreeplan | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user