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| Variable | Description |
|---|---|
DB_HOST | PostgreSQL host |
DB_PORT | Port (defaults to 5432) |
DB_USER | User |
DB_PASSWORD | Password |
DB_NAME | Database 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| Variable | Description |
|---|---|
PUBLIC_BASE_URL | Public URL of your API (no trailing slash) |