Skip to content

Environment variables

The library does not read .env. The variables live in your consumer API and you inject them into PaymentsModule.forRoot() when building each gateway's config (see Configuration).

This page lists only the common ones (the database). The variables specific to each gateway are documented on its page:

Database (PostgreSQL)

These are your own TypeORM connection's; the library only relies on that DataSource.

ini
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=payments
VariableDescription
DB_HOSTPostgreSQL host
DB_PORTPort (defaults to 5432)
DB_USERUser
DB_PASSWORDPassword
DB_NAMEDatabase name

Public URL

PaymentsModule.forRoot() needs public_base_url: the public URL of your API, which the library uses for the browser round-trips (Redsys's redirect page and PayPal's return_url). See Configuration.

ini
PUBLIC_BASE_URL=https://your-domain.com   # locally: http://localhost:3000
VariableDescription
PUBLIC_BASE_URLPublic URL of your API (no trailing slash)