Skip to content

Commit

Permalink
update app base url
Browse files Browse the repository at this point in the history
  • Loading branch information
AkshayaFoiger committed Sep 11, 2024
1 parent a7e0d35 commit 87b27f3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/lib/env.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const env = createEnv({
NEXT_PUBLIC_ENV: z
.enum(["development", "test", "staging", "production"])
.default("development"),
NEXT_PUBLIC_BASE_URL: z.string().default("https://saleor.app.hyperswitch.io")
},

/*
Expand Down Expand Up @@ -70,5 +71,6 @@ export const env = createEnv({
HYPERSWITCH_PROD_BASE_URL: process.env.HYPERSWITCH_PROD_BASE_URL,
JUSPAY_SANDBOX_BASE_URL: process.env.JUSPAY_SANDBOX_BASE_URL,
JUSPAY_PROD_BASE_URL: process.env.JUSPAY_PROD_BASE_URL,
NEXT_PUBLIC_BASE_URL: process.env.BASE_URL
},
});
19 changes: 10 additions & 9 deletions src/pages/api/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,33 @@ import { transactionChargeRequestedSyncWebhook } from "./webhooks/saleor/transac
import { transactionRefundRequestedSyncWebhook } from "./webhooks/saleor/transaction-refund-requested";
import { transactionCancelationRequestedSyncWebhook } from "./webhooks/saleor/transaction-cancelation-requested";
import { transactionProcessSessionSyncWebhook } from "./webhooks/saleor/transaction-process-session";
import { env } from "@/lib/env.mjs";

export default createManifestHandler({
async manifestFactory(context) {
const manifest: AppManifest = {
id: "app.saleor.juspay",
name: "Juspay",
about: packageJson.description,
tokenTargetUrl: `${context.appBaseUrl}/api/register`,
appUrl: `${context.appBaseUrl}`,
tokenTargetUrl: `${env.NEXT_PUBLIC_BASE_URL}/api/register`,
appUrl: `${env.NEXT_PUBLIC_BASE_URL}`,
permissions: ["HANDLE_PAYMENTS"],
version: packageJson.version,
requiredSaleorVersion: ">=3.14.0",
homepageUrl: "https://github.com/juspay/hyperswitch-saleor-payment-app",
supportUrl: "https://github.com/juspay/hyperswitch-saleor-payment-app/issues",
brand: {
logo: {
default: `${context.appBaseUrl}/logo.png`,
default: `${env.NEXT_PUBLIC_BASE_URL}/logo.png`,
},
},
webhooks: [
paymentGatewayInitializeSessionSyncWebhook.getWebhookManifest(context.appBaseUrl),
transactionInitializeSessionSyncWebhook.getWebhookManifest(context.appBaseUrl),
transactionChargeRequestedSyncWebhook.getWebhookManifest(context.appBaseUrl),
transactionCancelationRequestedSyncWebhook.getWebhookManifest(context.appBaseUrl),
transactionRefundRequestedSyncWebhook.getWebhookManifest(context.appBaseUrl),
transactionProcessSessionSyncWebhook.getWebhookManifest(context.appBaseUrl),
paymentGatewayInitializeSessionSyncWebhook.getWebhookManifest(env.NEXT_PUBLIC_BASE_URL),
transactionInitializeSessionSyncWebhook.getWebhookManifest(env.NEXT_PUBLIC_BASE_URL),
transactionChargeRequestedSyncWebhook.getWebhookManifest(env.NEXT_PUBLIC_BASE_URL),
transactionCancelationRequestedSyncWebhook.getWebhookManifest(env.NEXT_PUBLIC_BASE_URL),
transactionRefundRequestedSyncWebhook.getWebhookManifest(env.NEXT_PUBLIC_BASE_URL),
transactionProcessSessionSyncWebhook.getWebhookManifest(env.NEXT_PUBLIC_BASE_URL),
],
extensions: [],
};
Expand Down

0 comments on commit 87b27f3

Please sign in to comment.