@goweekdays/core 1.1.0 → 1.1.2
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 +12 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -2032,6 +2032,7 @@ declare function useInvoiceController(): {
|
|
|
2032
2032
|
getBySubscriptionId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2033
2033
|
getByNumber: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2034
2034
|
getByDueDateStatus: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2035
|
+
paidInvoiceWebhookHandler: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
2035
2036
|
};
|
|
2036
2037
|
|
|
2037
2038
|
declare const TPaymentMethod: z.ZodEnum<["CARD", "DIRECT_DEBIT", "VIRTUAL_ACCOUNT", "EWALLET", "OVER_THE_COUNTER", "QR_CODE", "PAYPAL"]>;
|
package/dist/index.js
CHANGED
|
@@ -24960,6 +24960,7 @@ function useInvoiceService() {
|
|
|
24960
24960
|
});
|
|
24961
24961
|
return;
|
|
24962
24962
|
}
|
|
24963
|
+
session.startTransaction();
|
|
24963
24964
|
try {
|
|
24964
24965
|
const invoice = await getByTransactionId(invoiceId);
|
|
24965
24966
|
if (!invoice) {
|
|
@@ -24970,7 +24971,6 @@ function useInvoiceService() {
|
|
|
24970
24971
|
"Subscription ID is missing in invoice metadata."
|
|
24971
24972
|
);
|
|
24972
24973
|
}
|
|
24973
|
-
session?.startTransaction();
|
|
24974
24974
|
const subscription = await getById(invoice.metadata.subscriptionId);
|
|
24975
24975
|
if (!subscription) {
|
|
24976
24976
|
throw new import_utils84.NotFoundError("Subscription not found.");
|
|
@@ -25022,13 +25022,14 @@ function useInvoiceService() {
|
|
|
25022
25022
|
await session.commitTransaction();
|
|
25023
25023
|
return "Payment processed successfully.";
|
|
25024
25024
|
} catch (error) {
|
|
25025
|
-
session
|
|
25025
|
+
session.abortTransaction();
|
|
25026
25026
|
import_utils84.logger.log({
|
|
25027
25027
|
level: "error",
|
|
25028
25028
|
message: String(error)
|
|
25029
25029
|
});
|
|
25030
|
+
throw error;
|
|
25030
25031
|
} finally {
|
|
25031
|
-
session
|
|
25032
|
+
session.endSession();
|
|
25032
25033
|
}
|
|
25033
25034
|
}
|
|
25034
25035
|
return {
|
|
@@ -25149,7 +25150,8 @@ function useInvoiceController() {
|
|
|
25149
25150
|
return {
|
|
25150
25151
|
getBySubscriptionId,
|
|
25151
25152
|
getByNumber,
|
|
25152
|
-
getByDueDateStatus
|
|
25153
|
+
getByDueDateStatus,
|
|
25154
|
+
paidInvoiceWebhookHandler
|
|
25153
25155
|
};
|
|
25154
25156
|
}
|
|
25155
25157
|
|