A comprehensive Java implementation for Global Payments payment processing and transaction reporting using Jakarta EE and the Global Payments SDK.
- Java 17+
- Maven 3.8+
- 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_heremvn clean install./run.shOr manually:
mvn cargo:runThe 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/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/reports?action=search&start_date=2025-09-01&page_size=10"java/
├── src/main/java/com/globalpayments/example/
│ ├── ProcessPaymentServlet.java # Payment processing endpoint
│ ├── ReportsController.java # Reporting API endpoints
│ ├── ReportingService.java # Reporting service logic
│ └── CorsFilter.java # CORS support
├── src/main/webapp/
│ ├── index.html # Payment form UI
│ └── WEB-INF/web.xml # Servlet configuration
├── pom.xml # Maven 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/reports?action=search&page_size=20"Export transactions to CSV:
curl "http://localhost:8000/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/reports?action=search" - Get transaction details:
curl "http://localhost:8000/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 already in use?
# Change the port in run.sh or use:
mvn cargo:run -Dcargo.servlet.port=8080Missing credentials error?
- Ensure
.envfile exists in thejava/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
Build fails?
Verify Java 17+: java -version. Verify Maven 3.8+: mvn -version.
- 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/java-sdk