{"id":50946093,"url":"https://github.com/globalpayments-samples/php-payments-and-reporting","last_synced_at":"2026-06-17T20:07:33.608Z","repository":{"id":316076487,"uuid":"1008649735","full_name":"globalpayments-samples/php-payments-and-reporting","owner":"globalpayments-samples","description":"Card authentication and verification with comprehensive reporting using Global Payments SDK. Validate cards without charging, AVS/CVV checks, and transaction reporting with PCI-compliant implementation.","archived":false,"fork":false,"pushed_at":"2025-11-07T16:17:40.000Z","size":142,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-07T18:20:26.524Z","etag":null,"topics":["authentication","avs","card-verification","cvv","global-payments","pci-compliant","reporting","sdk","transaction-reporting"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/globalpayments-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-25T22:02:03.000Z","updated_at":"2025-11-07T16:17:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"3ef5e8cd-576b-4c42-86a9-1a78dc4a92f8","html_url":"https://github.com/globalpayments-samples/php-payments-and-reporting","commit_stats":null,"previous_names":["globalpayments-samples/php-payments-and-reporting"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/globalpayments-samples/php-payments-and-reporting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globalpayments-samples%2Fphp-payments-and-reporting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globalpayments-samples%2Fphp-payments-and-reporting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globalpayments-samples%2Fphp-payments-and-reporting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globalpayments-samples%2Fphp-payments-and-reporting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/globalpayments-samples","download_url":"https://codeload.github.com/globalpayments-samples/php-payments-and-reporting/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globalpayments-samples%2Fphp-payments-and-reporting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34463586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","avs","card-verification","cvv","global-payments","pci-compliant","reporting","sdk","transaction-reporting"],"created_at":"2026-06-17T20:07:32.856Z","updated_at":"2026-06-17T20:07:33.594Z","avatar_url":"https://github.com/globalpayments-samples.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Global Payments GP-API Integration - Production MVP\n\nA comprehensive card verification and payment processing solution built with GP-API Drop-In UI and the GlobalPayments PHP SDK, featuring real-time transaction monitoring, secure payment processing, and professional dashboard interfaces.\n\n[View in CodeSandbox](https://githubbox.com/globalpayments-samples/php-payments-and-reporting).\n\n## Table of Contents\n\n- [Features](#features)\n- [Quick Start](#quick-start)\n- [Project Structure](#project-structure)\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Usage](#usage)\n- [API Documentation](#api-documentation)\n- [Testing](#testing)\n- [Security](#security)\n- [Deployment](#deployment)\n- [Contributing](#contributing)\n\n## Features\n\n### Core Functionality\n- **Card Verification**: Zero-charge validation with AVS/CVV checks\n- **Payment Processing**: Secure payment transactions via GP-API Drop-In UI\n- **Transaction Dashboard**: Real-time monitoring with filtering and export capabilities\n- **Multi-format Support**: CSV export, detailed transaction views, and comprehensive reporting\n\n### Technical Features\n- **Modern Architecture**: Clean separation of concerns with PSR-4 autoloading\n- **Comprehensive Testing**: PHPUnit test suite with 100% pass rate (17 tests, 128 assertions)\n- **Security First**: Input validation, secure tokenization, and error handling\n- **Production Ready**: Proper logging, monitoring, and deployment configuration\n\n## Quick Start Linux/MacOS\n\n### Prerequisites\n- PHP 8.0 or higher\n- Composer\n- Global Payments GP-API sandbox account and app credentials\n\n### Installation\n\n1. **Clone the repository:**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd card-authentication\n   ```\n\n2. **Install dependencies:**\n   ```bash\n   composer install\n   ```\n\n3. **Configure environment:**\n   ```bash\n   cp .env.example .env\n   # Edit .env with your GP-API app credentials\n   ```\n\n4. **Start development server:**\n   ```bash\n   php -S localhost:8000 router.php\n   ```\n\n5. **Access the application:**\n   ```\n   http://localhost:8000\n   ```\n\n## Quick Start Windows\n\nFor Windows users who need to set up the complete development environment:\n\n### Prerequisites Installation\n\n1. **Install PHP 8.0+:**\n   - Download from [php.net/downloads](https://www.php.net/downloads.php)\n   - Choose \"Thread Safe\" version for Windows\n   - Extract to `C:\\php` (or your preferred location)\n   - Add `C:\\php` to your Windows PATH environment variable\n\n2. **Install Composer:**\n   - Download from [getcomposer.org](https://getcomposer.org/download/)\n   - Run the Windows installer (Composer-Setup.exe)\n   - This will automatically add Composer to your PATH\n\n3. **Verify Installation:**\n   ```powershell\n   php --version\n   composer --version\n   ```\n\n### Project Setup\n\n1. **Clone and setup:**\n   ```powershell\n   git clone \u003crepository-url\u003e\n   cd card-authentication\n   composer install\n   ```\n\n2. **Configure environment:**\n   ```powershell\n   Copy-Item .env.example .env\n   # Edit .env file with your GP-API credentials using notepad or your preferred editor\n   notepad .env\n   ```\n\n3. **Start development server:**\n   ```powershell\n   php -S localhost:8000 router.php\n   ```\n\n4. **Test the setup:**\n   - Navigate to http://localhost:8000\n   - Run tests: `composer test`\n   - Check logs: `Get-Content logs\\*.log -Tail 10`\n\n## Project Structure\n\n```\ncard-authentication/\n├── docs/                          # Documentation\n│   ├── API.md                     # API documentation\n│   ├── DEPLOYMENT.md              # Deployment guide\n│   └── ARCHITECTURE.md            # System architecture\n├── public/                        # Web root (frontend files)\n│   ├── index.html                 # Main navigation hub\n│   ├── card-verification.html     # Card verification interface\n│   ├── payment.html               # Payment processing interface\n│   ├── dashboard.html             # Transaction monitoring dashboard\n│   ├── assets/                    # Static assets\n│   └── css/                       # Stylesheets\n│       ├── index.css\n│       └── dashboard.css\n├── src/                           # PHP source code\n│   ├── TransactionReporter.php    # Transaction management and reporting\n│   ├── ErrorHandler.php           # Error handling utilities\n│   └── Logger.php                 # Logging utilities\n├── api/                           # API endpoints\n│   ├── config.php                 # SDK configuration\n│   ├── verify-card.php            # Card verification endpoint\n│   ├── process-payment.php        # Payment processing endpoint\n│   ├── get-access-token.php       # Access token endpoint\n│   └── transactions-api.php       # Transaction data API\n├── tests/                         # PHPUnit tests\n│   ├── TransactionReporterTest.php\n│   └── TransactionReporterIntegrationTest.php\n├── .env.example                   # Environment configuration template\n├── composer.json                  # PHP dependencies and scripts\n├── phpunit.xml                    # Test configuration\n├── router.php                     # Development server router\n├── docker-compose.yml             # Docker configuration\n├── Dockerfile                     # Docker build configuration\n└── README.md                      # This file\n```\n\n## Installation\n\n### System Requirements\n- **PHP**: 8.0 or higher with extensions:\n  - `curl`\n  - `json`\n  - `mbstring`\n  - `openssl`\n- **Composer**: Latest version\n- **Web Server**: Apache, Nginx, or PHP built-in server\n\n### Step-by-Step Setup\n\n1. **Environment Setup:**\n   ```bash\n   # Create environment file\n   cp .env.example .env\n   \n   # Configure your GP-API credentials in .env:\n   GP_API_APP_ID=your_app_id_here\n   GP_API_APP_KEY=your_app_key_here\n   GP_API_ENVIRONMENT=sandbox\n   ```\n\n2. **Install Dependencies:**\n   ```bash\n   composer install --optimize-autoloader\n   ```\n\n3. **Verify Installation:**\n   ```bash\n   # Run tests to ensure everything is working\n   composer test\n   ```\n\n## Configuration\n\n### Environment Variables\n\n| Variable | Description | Required | Default |\n|----------|-------------|----------|---------|\n| `GP_API_APP_ID` | GP-API application ID | Yes | - |\n| `GP_API_APP_KEY` | GP-API application key | Yes | - |\n| `GP_API_ENVIRONMENT` | GP-API environment (sandbox/production) | Yes | `sandbox` |\n| `ENABLE_REQUEST_LOGGING` | Enable detailed API request logging | No | `false` |\n\n### Logging Configuration\n\nLogs are stored in the `logs/` directory with the following structure:\n- `transaction-errors.log` - Transaction processing errors\n- `system-YYYY-MM-DD.log` - General system logs\n- `payment-YYYY-MM-DD.log` - Payment processing logs\n- `transactions-YYYY-MM-DD.json` - Transaction data storage\n\n## Usage\n\n### Card Verification\n\n1. Navigate to `http://localhost:8000/public/card-verification.html`\n2. Enter test card details (provided on the page)\n3. Submit for zero-charge verification\n4. View results including AVS/CVV validation\n\n### Payment Processing\n\n1. Navigate to `http://localhost:8000/public/payment.html`\n2. Enter payment amount and card details\n3. Process secure payment through GlobalPayments\n4. Monitor results in real-time\n\n### Transaction Monitoring\n\n1. Navigate to `http://localhost:8000/public/dashboard.html`\n2. View all transactions with filtering options\n3. Export data to CSV format\n4. Access detailed transaction information\n\n### Test Cards\n\nUse these GlobalPayments test cards for development:\n\n| Card Number | Type | CVV | Exp | Expected Result |\n|-------------|------|-----|-----|-----------------|\n| 4000000000000002 | Visa | 123 | 12/25 | Approved |\n| 5400000000000005 | MasterCard | 123 | 12/25 | Approved |\n| 370000000000002 | Amex | 1234 | 12/25 | Approved |\n| 4000000000000010 | Visa | 123 | 12/25 | Declined |\n\n## API Documentation\n\n### Endpoints\n\n#### Card Verification\n```\nPOST /api/verify-card.php\nContent-Type: application/json\n\n{\n  \"number\": \"4000000000000002\",\n  \"exp_month\": \"12\",\n  \"exp_year\": \"25\",\n  \"cvv\": \"123\",\n  \"zip\": \"12345\"\n}\n```\n\n#### Payment Processing\n```\nPOST /api/process-payment.php\nContent-Type: application/json\n\n{\n  \"amount\": \"10.99\",\n  \"currency\": \"USD\",\n  \"number\": \"4000000000000002\",\n  \"exp_month\": \"12\",\n  \"exp_year\": \"25\",\n  \"cvv\": \"123\"\n}\n```\n\n#### Transaction Data\n```\nGET /api/transactions-api.php?limit=50\u0026start_date=2025-01-01\u0026end_date=2025-01-31\n```\n\nFor complete API documentation, see [docs/API.md](docs/API.md).\n\n## Testing\n\n### Running Tests\n\n```bash\n# Run all tests\ncomposer test\n\n# Run with coverage\ncomposer test:coverage\n\n# Run specific test file\n./vendor/bin/phpunit tests/TransactionReporterTest.php\n\n# Run with verbose output\n./vendor/bin/phpunit --verbose --testdox\n```\n\n### Test Coverage\n\nCurrent test coverage:\n- **17 test cases** with **128 assertions**\n- **100% pass rate**\n- Coverage includes unit tests, integration tests, and edge cases\n\n## Security\n\n### Security Measures Implemented\n\n- **Input Validation**: All user inputs are validated and sanitized\n- **Secure Tokenization**: No sensitive card data is stored locally\n- **API Security**: Proper headers and authentication\n- **Error Handling**: No sensitive information exposed in errors\n- **Transaction Filtering**: Only genuine API transactions displayed\n\n### Best Practices\n\n- Keep your `.env` file secure and never commit it to version control\n- Regularly rotate API keys\n- Monitor logs for suspicious activity\n- Use HTTPS in production environments\n- Keep dependencies updated\n\n## Deployment\n\n### Production Deployment\n\n1. **Environment Setup:**\n   ```bash\n   # Use production API credentials\n   SECRET_API_KEY=prod_secret_key\n   SERVICE_URL=https://api2.heartlandportico.com\n   ENABLE_REQUEST_LOGGING=false\n   ```\n\n2. **Optimize for Production:**\n   ```bash\n   composer install --no-dev --optimize-autoloader\n   ```\n\n3. **Web Server Configuration:**\n   - Set document root to project directory\n   - Configure HTTPS with valid SSL certificate\n   - Set appropriate file permissions\n   - Configure log rotation\n\nFor detailed deployment instructions, see [docs/DEPLOYMENT.md](docs/DEPLOYMENT.md).\n\n### Docker Deployment\n\n```bash\n# Build and run with Docker\ndocker-compose up -d\n\n# Or using Docker directly\ndocker build -t heartland-payment .\ndocker run -p 8000:8000 heartland-payment\n```\n\n## Contributing\n\n### Development Workflow\n\n1. **Clone and Setup:**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd card-authentication\n   composer install\n   ```\n\n2. **Create Feature Branch:**\n   ```bash\n   git checkout -b feature/your-feature-name\n   ```\n\n3. **Development:**\n   - Write code following PSR-12 standards\n   - Add tests for new functionality\n   - Update documentation as needed\n\n4. **Testing:**\n   ```bash\n   composer test\n   composer lint\n   ```\n\n5. **Submit Pull Request:**\n   - Ensure all tests pass\n   - Include comprehensive description\n   - Reference any related issues\n\n### Code Standards\n\n- Follow PSR-12 coding standards\n- Use meaningful variable and function names\n- Include PHPDoc comments for all public methods\n- Write tests for all new functionality\n- Keep security as a top priority\n\n## Support\n\n### Troubleshooting\n\nCommon issues and solutions:\n\n1. **API Connection Issues:**\n   - Verify credentials in `.env` file\n   - Check network connectivity\n   - Ensure API endpoints are accessible\n\n2. **Test Failures:**\n   - Run `composer dump-autoload`\n   - Check file permissions on `logs/` directory\n   - Verify all dependencies are installed\n\n3. **Performance Issues:**\n   - Enable PHP OPcache in production\n   - Optimize Composer autoloader\n   - Monitor system resources\n\n### Getting Help\n\n- Check the [documentation](docs/)\n- Review the [test results](test-results.xml)\n- Examine application logs in the `logs/` directory\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n## Changelog\n\n### Version 1.0.0 (Current MVP)\n- Complete card verification system\n- Secure payment processing with GlobalPayments SDK\n- Real-time transaction dashboard\n- Comprehensive test suite\n- Production-ready architecture\n- Professional documentation\n\n---\n\n**Built with GlobalPayments PHP SDK** | **Production Ready** | **Comprehensive Testing**","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobalpayments-samples%2Fphp-payments-and-reporting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobalpayments-samples%2Fphp-payments-and-reporting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobalpayments-samples%2Fphp-payments-and-reporting/lists"}