Skip to content

Bug: "environment" option misspelled as "enviornment" - production mode never activates #1

@FCraven

Description

@FCraven

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions