feat(MED-100): update montonio redirect

This commit is contained in:
2025-07-24 08:02:13 +03:00
parent 8633ac4bce
commit e59ad6af00
11 changed files with 261 additions and 166 deletions

View File

@@ -30,7 +30,7 @@ export class MontonioOrderHandlerService {
locale: string;
merchantReference: string;
}) {
const token = jwt.sign({
const params = {
accessKey,
description,
currency,
@@ -38,16 +38,17 @@ export class MontonioOrderHandlerService {
locale,
// 15 minutes
expiresAt: new Date(Date.now() + 15 * 60 * 1000).toISOString(),
notificationUrl,
returnUrl,
notificationUrl: notificationUrl.replace("localhost", "webhook.site"),
returnUrl: returnUrl.replace("localhost", "webhook.site"),
askAdditionalInfo: false,
merchantReference,
type: "one_time",
}, secretKey, {
};
const token = jwt.sign(params, secretKey, {
algorithm: "HS256",
expiresIn: "10m",
});
try {
const { data } = await axios.post(`${apiUrl}/api/payment-links`, { data: token });
return data.url;