fix(dashboard, fulfilment): fulfilment providers enabled check (#9415)
**What** - hide disabled fulfilment providers on the admin - check if the fulfilment provider has an identifier when loading providers --- FIXES CC-549
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
ModulesSdkTypes,
|
||||
} from "@medusajs/framework/types"
|
||||
import { Lifetime, asFunction, asValue } from "awilix"
|
||||
import { MedusaError } from "@medusajs/utils"
|
||||
|
||||
import { PaymentProviderService } from "@services"
|
||||
import * as providers from "../providers"
|
||||
@@ -13,6 +14,13 @@ import * as providers from "../providers"
|
||||
const PROVIDER_REGISTRATION_KEY = "payment_providers"
|
||||
|
||||
const registrationFn = async (klass, container, pluginOptions) => {
|
||||
if (!klass?.PROVIDER) {
|
||||
throw new MedusaError(
|
||||
MedusaError.Types.INVALID_ARGUMENT,
|
||||
`Trying to register a payment provider without a provider identifier.`
|
||||
)
|
||||
}
|
||||
|
||||
const key = `pp_${klass.PROVIDER}_${pluginOptions.id}`
|
||||
|
||||
container.register({
|
||||
|
||||
Reference in New Issue
Block a user