phonepe (#52)
All checks were successful
Deploy FitLien services to Dev / Deploy to Dev (push) Successful in 3m17s

Co-authored-by: AllenTJ7 <163137620+AllenTJ7@users.noreply.github.com>
Reviewed-on: #52
This commit is contained in:
Allen T J 2025-05-27 18:46:11 +00:00
parent d9cd772f6e
commit 7482b20526

View File

@ -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