The environment option passed in medusa-config.ts is silently ignored because the package reads this.options_.enviornment (misspelled) instead of this.options_.environment.
Location: dist/core/authorizenet-base.js, lines 12 and 44
// Line 12
this.options_.enviornment === "production" ? "AAA201051" : "AAA198606";
// Line 44
return this.options_.enviornment === "production"
? authorizenet_1.Constants.endpoint.production
: authorizenet_1.Constants.endpoint.sandbox;
Impact: Every merchant passing environment: "production" in their config is actually hitting the sandbox API endpoint. Production Accept.js nonces are rejected by the sandbox endpoint, causing silent payment failures — orders are
created in Medusa but payment is never captured.
Workaround: Pass both spellings in medusa-config.ts:
options: {
api_login_id: process.env.AUTHORIZE_NET_API_LOGIN_ID,
transaction_key: process.env.AUTHORIZE_NET_TRANSACTION_KEY,
capture: true,
environment: "production",
enviornment: "production", // workaround for typo in package
}
Fix: Rename enviornment to environment in src/core/authorizenet-base.ts (two occurrences).
Version: payment-authorizenet-medusa@1.0.1
The environment option passed in medusa-config.ts is silently ignored because the package reads this.options_.enviornment (misspelled) instead of this.options_.environment.
Location: dist/core/authorizenet-base.js, lines 12 and 44
// Line 12
this.options_.enviornment === "production" ? "AAA201051" : "AAA198606";
// Line 44
return this.options_.enviornment === "production"
? authorizenet_1.Constants.endpoint.production
: authorizenet_1.Constants.endpoint.sandbox;
Impact: Every merchant passing environment: "production" in their config is actually hitting the sandbox API endpoint. Production Accept.js nonces are rejected by the sandbox endpoint, causing silent payment failures — orders are
created in Medusa but payment is never captured.
Workaround: Pass both spellings in medusa-config.ts:
options: {
api_login_id: process.env.AUTHORIZE_NET_API_LOGIN_ID,
transaction_key: process.env.AUTHORIZE_NET_TRANSACTION_KEY,
capture: true,
environment: "production",
enviornment: "production", // workaround for typo in package
}
Fix: Rename enviornment to environment in src/core/authorizenet-base.ts (two occurrences).
Version: payment-authorizenet-medusa@1.0.1