feat(MED-85): update webhook url to have public path in test env
This commit is contained in:
4
.env
4
.env
@@ -66,3 +66,7 @@ NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=
|
||||
NEXT_PUBLIC_MONTONIO_ACCESS_KEY=7da5d7fa-3383-4997-9435-46aa818f4ead
|
||||
MONTONIO_SECRET_KEY=rNZkzwxOiH93mzkdV53AvhSsbGidrgO2Kl5lE/IT7cvo
|
||||
MONTONIO_API_URL=https://sandbox-stargate.montonio.com
|
||||
|
||||
# MEDUSA
|
||||
MEDUSA_BACKEND_URL=http://localhost:9000
|
||||
MEDUSA_BACKEND_PUBLIC_URL=http://localhost:9000
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
# https://app.supabase.com/project/_/settings/api
|
||||
NEXT_PUBLIC_SUPABASE_URL=your-project-url
|
||||
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
|
||||
NEXT_PUBLIC_SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
|
||||
SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
|
||||
|
||||
MEDIPOST_URL=your-medipost-url
|
||||
MEDIPOST_USER=your-medipost-user
|
||||
|
||||
@@ -8,14 +8,14 @@ import { StoreCartLineItem, StoreProductVariant } from '@medusajs/types';
|
||||
import { MontonioOrderHandlerService } from '@/packages/billing/montonio/src';
|
||||
import { requireUserInServerComponent } from '../server/require-user-in-server-component';
|
||||
|
||||
const medusaBackendUrl = process.env.MEDUSA_BACKEND_URL!;
|
||||
const medusaBackendPublicUrl = process.env.MEDUSA_BACKEND_PUBLIC_URL!;
|
||||
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL!;
|
||||
|
||||
const env = z
|
||||
.object({
|
||||
medusaBackendUrl: z
|
||||
medusaBackendPublicUrl: z
|
||||
.string({
|
||||
required_error: 'MEDUSA_BACKEND_URL is required',
|
||||
required_error: 'MEDUSA_BACKEND_PUBLIC_URL is required',
|
||||
})
|
||||
.min(1),
|
||||
siteUrl: z
|
||||
@@ -25,7 +25,7 @@ const env = z
|
||||
.min(1),
|
||||
})
|
||||
.parse({
|
||||
medusaBackendUrl,
|
||||
medusaBackendPublicUrl,
|
||||
siteUrl,
|
||||
});
|
||||
|
||||
@@ -81,7 +81,7 @@ export async function handleNavigateToPayment({ language, paymentSessionId }: {
|
||||
}
|
||||
|
||||
const paymentLink = await new MontonioOrderHandlerService().getMontonioPaymentLink({
|
||||
notificationUrl: `${env.medusaBackendUrl}/api/billing/webhook`,
|
||||
notificationUrl: `${env.medusaBackendPublicUrl}/hooks/payment/montonio_montonio`,
|
||||
returnUrl: `${env.siteUrl}/home/cart/montonio-callback`,
|
||||
amount: cart.total,
|
||||
currency: cart.currency_code.toUpperCase(),
|
||||
|
||||
Reference in New Issue
Block a user