@goweekdays/core 1.1.2 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2025,7 +2025,7 @@ declare function useInvoiceRepo(): {
|
|
|
2025
2025
|
|
|
2026
2026
|
declare function useInvoiceService(): {
|
|
2027
2027
|
processOverDueInvoices: (BATCH_SIZE?: number, MAX_RETRIES?: number) => Promise<void>;
|
|
2028
|
-
paypalPaidInvoiceWebhookHandler: (invoiceId: string
|
|
2028
|
+
paypalPaidInvoiceWebhookHandler: (invoiceId: string) => Promise<"Payment processed successfully." | undefined>;
|
|
2029
2029
|
};
|
|
2030
2030
|
|
|
2031
2031
|
declare function useInvoiceController(): {
|
package/dist/index.js
CHANGED
|
@@ -24945,13 +24945,10 @@ function useInvoiceService() {
|
|
|
24945
24945
|
});
|
|
24946
24946
|
}
|
|
24947
24947
|
}
|
|
24948
|
-
async function paypalPaidInvoiceWebhookHandler(invoiceId
|
|
24948
|
+
async function paypalPaidInvoiceWebhookHandler(invoiceId) {
|
|
24949
24949
|
if (!invoiceId) {
|
|
24950
24950
|
throw new import_utils84.BadRequestError("Invoice ID is required.");
|
|
24951
24951
|
}
|
|
24952
|
-
if (!status) {
|
|
24953
|
-
throw new import_utils84.BadRequestError("Status is required.");
|
|
24954
|
-
}
|
|
24955
24952
|
const session = import_utils84.useAtlas.getClient()?.startSession();
|
|
24956
24953
|
if (!session) {
|
|
24957
24954
|
import_utils84.logger.log({
|
|
@@ -25130,8 +25127,7 @@ function useInvoiceController() {
|
|
|
25130
25127
|
const invoiceId = req.body.resource.id ?? "";
|
|
25131
25128
|
const status = req.body.resource.status ?? "";
|
|
25132
25129
|
const validation = import_joi28.default.object({
|
|
25133
|
-
invoiceId: import_joi28.default.string().required()
|
|
25134
|
-
status: import_joi28.default.string().valid("PAID").required()
|
|
25130
|
+
invoiceId: import_joi28.default.string().required()
|
|
25135
25131
|
});
|
|
25136
25132
|
const { error } = validation.validate({ invoiceId, status });
|
|
25137
25133
|
if (error) {
|
|
@@ -25139,7 +25135,7 @@ function useInvoiceController() {
|
|
|
25139
25135
|
return;
|
|
25140
25136
|
}
|
|
25141
25137
|
try {
|
|
25142
|
-
await paypalPaidInvoiceWebhookHandler(invoiceId
|
|
25138
|
+
await paypalPaidInvoiceWebhookHandler(invoiceId);
|
|
25143
25139
|
res.status(200).json({ message: "Webhook processed successfully." });
|
|
25144
25140
|
return;
|
|
25145
25141
|
} catch (error2) {
|