phonepe (#44)
All checks were successful
Deploy FitLien services to Dev / Deploy to Dev (push) Successful in 4m21s
All checks were successful
Deploy FitLien services to Dev / Deploy to Dev (push) Successful in 4m21s
Co-authored-by: AllenTJ7 <163137620+AllenTJ7@users.noreply.github.com> Reviewed-on: #44
This commit is contained in:
parent
d3cc6b3710
commit
916293e8b1
@ -54,7 +54,7 @@ export class InvoiceService {
|
||||
|
||||
doc.setFontSize(20);
|
||||
doc.setFont('helvetica', 'bold');
|
||||
doc.text(data.businessName, 20, 20);
|
||||
doc.text(data.businessName, 13, 20);
|
||||
|
||||
doc.setFontSize(12);
|
||||
doc.setFont('helvetica', 'normal');
|
||||
@ -66,10 +66,10 @@ export class InvoiceService {
|
||||
|
||||
if (addressLines.length <= 2) {
|
||||
for (let i = 0; i < addressLines.length; i++) {
|
||||
doc.text(addressLines[i], 20, 30 + (i * lineHeight));
|
||||
doc.text(addressLines[i], 13, 30 + (i * lineHeight));
|
||||
}
|
||||
} else {
|
||||
doc.text(addressLines[0], 20, 30);
|
||||
doc.text(addressLines[0], 13, 30);
|
||||
|
||||
let secondLine = addressLines[1];
|
||||
if (secondLine.length > 3) {
|
||||
@ -77,7 +77,7 @@ export class InvoiceService {
|
||||
} else {
|
||||
secondLine += '...';
|
||||
}
|
||||
doc.text(secondLine, 20, 35);
|
||||
doc.text(secondLine, 13, 35);
|
||||
}
|
||||
|
||||
const gstYPosition = 40;
|
||||
@ -97,10 +97,10 @@ export class InvoiceService {
|
||||
doc.line(20, 45, 190, 45);
|
||||
|
||||
doc.setFontSize(12);
|
||||
const receiptToBoxX = 15;
|
||||
const receiptToBoxX = 13;
|
||||
const receiptToBoxY = 55;
|
||||
const receiptToBoxWidth = 175;
|
||||
const receiptToBoxHeight = 45;
|
||||
const receiptToBoxWidth = 140;
|
||||
const receiptToBoxHeight = 40;
|
||||
|
||||
doc.setDrawColor(0, 0, 0);
|
||||
doc.setLineWidth(0.5);
|
||||
@ -166,12 +166,12 @@ export class InvoiceService {
|
||||
|
||||
const paymentY = hasGst ? finalY + 50 : finalY + 20;
|
||||
|
||||
doc.line(20, 45, 190, 45);
|
||||
doc.line(13, 45, 190, 45);
|
||||
|
||||
const boxX = 15;
|
||||
const boxX = 13;
|
||||
const boxY = paymentY - 5;
|
||||
const boxWidth = 175;
|
||||
const boxHeight = 45;
|
||||
const boxWidth = 140;
|
||||
const boxHeight = 40;
|
||||
|
||||
doc.setDrawColor(0, 0, 0);
|
||||
doc.setLineWidth(0.5);
|
||||
@ -181,8 +181,8 @@ export class InvoiceService {
|
||||
doc.text('Payment Information:', 20, paymentY);
|
||||
|
||||
doc.setFont('helvetica', 'normal');
|
||||
doc.text(`Transaction ID: ${data.transactionId}`, 20, paymentY + 10);
|
||||
doc.text(`Payment Method: ${data.paymentMethod}`, 20, paymentY + 20);
|
||||
doc.text(`Transaction ID: ${data.transactionId}`, 18, paymentY + 10);
|
||||
doc.text(`Payment Method: ${data.paymentMethod}`, 18, paymentY + 20);
|
||||
doc.text(`Payment Date: ${formattedDate}`, 20, paymentY + 30);
|
||||
|
||||
doc.setFontSize(12);
|
||||
|
||||
@ -154,7 +154,7 @@ export const phonePeWebhook = onRequest({
|
||||
|
||||
logger.info(`Fetching user data for userId: ${userId}`);
|
||||
const userDoc = await admin.firestore()
|
||||
.collection('client_profiles')
|
||||
.collection('users')
|
||||
.doc(userId)
|
||||
.get();
|
||||
if (userDoc.exists) {
|
||||
@ -245,7 +245,7 @@ export const phonePeWebhook = onRequest({
|
||||
customerName: userData?.displayName || `${membershipData?.fields?.['first-name'] || ''} ${membershipData?.fields?.['last-name'] || ''}`.trim(),
|
||||
phoneNumber: membershipData?.fields?.['phone-number'] || orderData.metaInfo?.phoneNumber || '',
|
||||
email: membershipData?.fields?.['email'] || '',
|
||||
planName: orderData.metaInfo?.planName || subscriptionName || paymentType,
|
||||
planName: orderData.metaInfo?.planName || subscriptionName,
|
||||
amount: orderData.amount,
|
||||
transactionId: payload.orderId,
|
||||
paymentDate: new Date(),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user