what: - enables a button to create a payment link when a payment delta is present - api to delete order payment collection - adds a pending amount to payment collections Note: Not the happiest with the decision on when to create a payment collection and when not to. The code should programatically create or delete payment collections currently to generate the right collection for the payment delta. Adding a more specific flow to create and manage a payment collection will help reduce this burden from the code path and onto CX/merchant. Another issue I found is that the payment collection status doesn't get updated when payment is complete as it still gets stuck to "authorized" state https://github.com/user-attachments/assets/037a10f9-3621-43c2-94ba-1ada4b0a041b
37 lines
980 B
TypeScript
37 lines
980 B
TypeScript
import inject from "@medusajs/admin-vite-plugin"
|
|
import react from "@vitejs/plugin-react"
|
|
import { defineConfig, loadEnv } from "vite"
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig(({ mode }) => {
|
|
const env = loadEnv(mode, process.cwd())
|
|
|
|
const BASE = env.VITE_MEDUSA_BASE || "/"
|
|
const BACKEND_URL = env.VITE_MEDUSA_BACKEND_URL || "http://localhost:9000"
|
|
const STOREFRONT_URL =
|
|
env.VITE_MEDUSA_STOREFRONT_URL || "http://localhost:8000"
|
|
|
|
/**
|
|
* Add this to your .env file to specify the project to load admin extensions from.
|
|
*/
|
|
const MEDUSA_PROJECT = env.VITE_MEDUSA_PROJECT || null
|
|
const sources = MEDUSA_PROJECT ? [MEDUSA_PROJECT] : []
|
|
|
|
return {
|
|
plugins: [
|
|
react(),
|
|
inject({
|
|
sources,
|
|
}),
|
|
],
|
|
define: {
|
|
__BASE__: JSON.stringify(BASE),
|
|
__BACKEND_URL__: JSON.stringify(BACKEND_URL),
|
|
__STOREFRONT_URL__: JSON.stringify(STOREFRONT_URL),
|
|
},
|
|
server: {
|
|
open: true,
|
|
},
|
|
}
|
|
})
|