A comprehensive Node.js implementation for Global Payments payment processing and transaction reporting using Express.js and the Global Payments Node.js SDK.
- Node.js 18+
- npm
- Global Payments Portico credentials (
PUBLIC_API_KEY,SECRET_API_KEY)
Copy .env.sample to .env and add your credentials:
PUBLIC_API_KEY=pkapi_cert_your_key_here
SECRET_API_KEY=skapi_cert_your_key_herenpm install./run.shOr manually:
npm startThe application will start on http://localhost:8000
Open your browser to:
- Web Interface: http://localhost:8000/index.html
- Get Public Key: http://localhost:8000/config
- Reporting Config: http://localhost:8000/api/reports?action=config
- Process card payments with hosted fields tokenization
- Support for billing address verification (AVS)
- Real-time payment processing with Global Payments Portico API
- Search and filter transactions
- Export data (JSON, CSV, XML)
- Generate settlement, dispute, and deposit reports
- Transaction analytics and summaries
Get Configuration
curl http://localhost:8000/configProcess Payment
curl -X POST http://localhost:8000/process-payment \
-d "payment_token=YOUR_TOKEN" \
-d "billing_zip=12345" \
-d "amount=25.00"See REPORTING_README.md for complete reporting API documentation.
Quick Example - Search Transactions
curl "http://localhost:8000/api/reports?action=search&start_date=2025-09-01&page_size=10"nodejs/
├── server.js # Main Express application
├── reports.js # Reporting API endpoints
├── reporting-service.js # Reporting service logic
├── index.html # Payment form UI
├── package.json # Node.js dependencies
├── .env # Your credentials (not in git)
├── .env.sample # Credential template
├── README.md # This file
└── REPORTING_README.md # Reporting API documentation
- Open http://localhost:8000/index.html in your browser
- Use test card:
4012002000060016 - Enter any future expiration date
- Enter CVV:
123 - Enter billing ZIP code
- Click "Pay $10.00"
After processing payments, search for them:
curl "http://localhost:8000/api/reports?action=search&page_size=20"Export transactions to CSV:
curl "http://localhost:8000/api/reports?action=export&format=csv&start_date=2025-09-01" -o transactions.csv| Card Type | Number | CVV | Expiry |
|---|---|---|---|
| Visa | 4012002000060016 | 123 | Any future date |
| Mastercard | 5473500000000014 | 123 | Any future date |
| Amex | 372700699251018 | 1234 | Any future date |
- Process a payment using the web interface
- Verify transaction appears in reporting:
curl "http://localhost:8000/api/reports?action=search" - Get transaction details:
curl "http://localhost:8000/api/reports?action=detail&transaction_id=TRN_xxx"
| Variable | Required | Description |
|---|---|---|
PUBLIC_API_KEY |
Yes | Portico public key for payment processing |
SECRET_API_KEY |
Yes | Portico secret key for payment processing |
PORT |
No | Server port (default: 8000) |
Port already in use?
# Use a different port:
PORT=8080 npm startMissing credentials error?
- Ensure
.envfile exists in thenodejs/directory - Verify all required credentials are set
- Check for trailing spaces in credential values
Payment processing fails?
- Verify
PUBLIC_API_KEYandSECRET_API_KEYare correct - Ensure using test credentials for test environment
npm install fails?
- Ensure Node.js 18+ is installed:
node --version - Remove
node_modulesand retry:rm -rf node_modules && npm install
- Payment Processing: See API Endpoints section above
- Transaction Reporting: See REPORTING_README.md
- Global Payments Docs: https://developer.globalpayments.com
For issues or questions:
- Global Payments Developer Portal: https://developer.globalpayments.com
- SDK Documentation: https://github.com/globalpayments/nodejs-sdk