{"id":50946118,"url":"https://github.com/globalpayments-samples/reporting-service","last_synced_at":"2026-06-17T20:07:37.024Z","repository":{"id":319096338,"uuid":"1066359116","full_name":"globalpayments-samples/reporting-service","owner":"globalpayments-samples","description":"Transaction reporting and analytics service for Global Payments. Interactive search, filtering, export capabilities (CSV/JSON/XML) with real-time data visualization.","archived":false,"fork":false,"pushed_at":"2026-04-13T17:58:47.000Z","size":260,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-13T19:22:00.137Z","etag":null,"topics":["analytics","api","csv","dashboard","data-export","global-payments","json","reporting","transaction-search"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","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":"LICENSE","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-09-29T11:29:06.000Z","updated_at":"2026-04-03T18:37:24.000Z","dependencies_parsed_at":"2025-10-18T03:28:03.341Z","dependency_job_id":"2195e132-e066-4a0f-8a2c-7b9b354b86da","html_url":"https://github.com/globalpayments-samples/reporting-service","commit_stats":null,"previous_names":["globalpayments-samples/reporting-service"],"tags_count":0,"template":false,"template_full_name":"globalpayments-samples/starter-template","purl":"pkg:github/globalpayments-samples/reporting-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globalpayments-samples%2Freporting-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globalpayments-samples%2Freporting-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globalpayments-samples%2Freporting-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globalpayments-samples%2Freporting-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/globalpayments-samples","download_url":"https://codeload.github.com/globalpayments-samples/reporting-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/globalpayments-samples%2Freporting-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34463588,"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":["analytics","api","csv","dashboard","data-export","global-payments","json","reporting","transaction-search"],"created_at":"2026-06-17T20:07:36.115Z","updated_at":"2026-06-17T20:07:37.015Z","avatar_url":"https://github.com/globalpayments-samples.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reporting Service\n\nA complete transaction reporting service built on the Global Payments Portico gateway. Developers can search, filter, and export transaction data through an interactive web UI and REST API, covering settlements, disputes, deposits, and batch details — alongside live credit card payment processing. All implementations use the official Global Payments SDK (dual config: `PorticoConfig` for payments, `GpApiConfig` for reporting).\n\nAvailable in six languages: PHP, Node.js, .NET, Java, Python, and Go.\n\n---\n\n## Available Implementations\n\n| Language | Framework | SDK Version |\n|----------|-----------|-------------|\n| [**PHP**](./php/) | Built-in Server | globalpayments/php-sdk ^13.1 |\n| [**Node.js**](./nodejs/) | Express.js | globalpayments-api ^3.10.6 |\n| [**.NET**](./dotnet/) | ASP.NET Core | GlobalPayments.Api 9.0.16 |\n| [**Java**](./java/) | Jakarta Servlet | globalpayments-sdk 14.2.20 |\n| [**Python**](./python/) | Flask | globalpayments | latest |\n| [**Go**](./go/) | net/http | globalpayments-go | latest |\n\n---\n\n## How It Works\n\nThe service exposes two categories of endpoints under a three-tab UI:\n\n1. **Payment processing** — charge a card using Portico hosted fields (`POST /process-payment`)\n2. **Transaction reporting** — search and export transaction history via the Reporting SDK (`GET /api/reports?action=...`)\n\n```\nBrowser (three-tab UI)\n  │\n  ├─ Tab 1: Payment Form\n  │   ├─ GET /config ─────► publicApiKey for globalpayments.js initialization\n  │   └─ POST /process-payment ─────► SDK: CreditCardData.charge().execute()\n  │\n  ├─ Tab 2: API Documentation\n  │   └─ Built-in reference for all reporting endpoints\n  │\n  └─ Tab 3: Transaction Report\n      └─ GET /api/reports?action=search|detail|settlement|export|summary|declines\n          └─ SDK: ReportingService queries via Portico\n```\n\n---\n\n## Prerequisites\n\n- Global Payments developer account with Portico credentials — [Sign up at developer.globalpayments.com](https://developer.globalpayments.com)\n- Two API keys from your Portico account:\n  - `PUBLIC_API_KEY` — prefixed `pkapi_cert_...` (sandbox)\n  - `SECRET_API_KEY` — prefixed `skapi_cert_...` (sandbox)\n- Docker (for multi-service setup), or a local runtime for your chosen language\n\n---\n\n## Quick Start\n\n### 1. Clone the repository\n\n```bash\ngit clone https://github.com/globalpayments-samples/reporting-service.git\ncd reporting-service\n```\n\n### 2. Choose a language and configure credentials\n\n```bash\ncd nodejs    # or php, dotnet, java, python, go\ncp .env.sample .env\n```\n\nEdit `.env`:\n\n```env\nPUBLIC_API_KEY=pkapi_cert_your_key_here\nSECRET_API_KEY=skapi_cert_your_key_here\n```\n\n### 3. Install and run\n\n**PHP:**\n```bash\ncomposer install\nphp -S localhost:8003\n```\n\n**Node.js:**\n```bash\nnpm install\nnpm start\n```\n\n**.NET:**\n```bash\ndotnet restore\ndotnet run\n```\n\n**Java:**\n```bash\nmvn clean package\nmvn cargo:run\n```\n\n**Python:**\n```bash\npip install -r requirements.txt\npython app.py\n```\n\n**Go:**\n```bash\ngo mod download\ngo run main.go\n```\n\n### 4. Explore the UI\n\nOpen the app (e.g. http://localhost:8001) and navigate the three tabs:\n\n- **Payment Form** — process a test transaction\n- **Reporting Documentation** — browse all available report endpoints\n- **Transaction Report** — search, filter, and export transaction history\n\n---\n\n## Docker Setup\n\nRun all six language implementations simultaneously:\n\n```bash\ncp .env.sample .env\n# Edit .env with your credentials, then:\ndocker-compose up\n```\n\nIndividual services:\n\n```bash\ndocker-compose up nodejs    # http://localhost:8001\ndocker-compose up python    # http://localhost:8002\ndocker-compose up php       # http://localhost:8003\ndocker-compose up java      # http://localhost:8004\ndocker-compose up go        # http://localhost:8005\ndocker-compose up dotnet    # http://localhost:8006\n```\n\nRun integration tests:\n\n```bash\ndocker-compose --profile testing up\n```\n\n---\n\n## API Endpoints\n\n### `GET /config`\n\nReturns the public API key for globalpayments.js initialization on the payment form.\n\n**Response:**\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"publicApiKey\": \"pkapi_cert_...\"\n  }\n}\n```\n\n---\n\n### `POST /process-payment`\n\nProcesses a credit card charge using a tokenized payment reference from the hosted fields form.\n\n**Request body:**\n```json\n{\n  \"payment_token\": \"supt_...\",\n  \"amount\": \"19.99\",\n  \"billing_zip\": \"30303\"\n}\n```\n\n**Success (`200`):**\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"transactionId\": \"1234567890\",\n    \"responseCode\": \"00\",\n    \"responseMessage\": \"Approved\"\n  }\n}\n```\n\n---\n\n### `GET /api/reports`\n\nAll reporting actions use a single endpoint with an `action` query parameter.\n\n#### `action=search` — Search transactions\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `start_date` | No | `YYYY-MM-DD` |\n| `end_date` | No | `YYYY-MM-DD` |\n| `transaction_id` | No | Exact transaction ID |\n| `status` | No | Transaction status filter |\n| `payment_type` | No | Payment method type |\n| `amount_min` | No | Minimum amount |\n| `amount_max` | No | Maximum amount |\n| `card_last_four` | No | Last 4 digits of card |\n| `page` | No | Page number (default: `1`) |\n| `page_size` | No | Results per page (max: `100`) |\n\n**Example:** `GET /api/reports?action=search\u0026start_date=2025-01-01\u0026end_date=2025-01-31`\n\n---\n\n#### `action=detail` — Get transaction details\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `transaction_id` | Yes | Transaction ID to look up |\n\n**Example:** `GET /api/reports?action=detail\u0026transaction_id=1234567890`\n\n---\n\n#### `action=settlement` — Settlement report\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `start_date` | No | `YYYY-MM-DD` |\n| `end_date` | No | `YYYY-MM-DD` |\n| `page` | No | Page number |\n| `page_size` | No | Results per page (max: `100`) |\n\n---\n\n#### `action=export` — Export transaction data\n\n| Parameter | Required | Description |\n|-----------|----------|-------------|\n| `format` | No | `json` (default), `csv`, or `xml` |\n| `start_date` | No | `YYYY-MM-DD` |\n| `end_date` | No | `YYYY-MM-DD` |\n| `transaction_id` | No | Filter by ID |\n| `status` | No | Filter by status |\n\n**Example:** `GET /api/reports?action=export\u0026format=csv\u0026start_date=2025-01-01`\n\n---\n\n#### `action=summary` — Transaction summary statistics\n\nReturns aggregate counts and totals across a time range.\n\n---\n\n#### `action=declines` — Declined transaction analysis\n\nReturns declined transactions with decline reason codes.\n\n---\n\n## Project Structure\n\n```\nreporting-service/\n├── index.html              # Shared frontend (three-tab UI)\n├── docker-compose.yml      # Multi-service Docker config\n├── Dockerfile.tests\n├── LICENSE\n├── README.md\n│\n├── php/                    # Port 8003\n│   ├── config.php          # GET /config\n│   ├── process-payment.php # POST /process-payment\n│   ├── reports.php         # GET /api/reports\n│   ├── reporting-service.php\n│   └── documentation.php\n│\n├── nodejs/                 # Port 8001\n│   ├── server.js           # /config, /process-payment\n│   ├── reports.js          # /api/reports router\n│   └── reporting-service.js\n│\n├── dotnet/                 # Port 8006\n│   └── Program.cs\n│\n├── java/                   # Port 8004\n│   └── src/\n│\n├── python/                 # Port 8002\n│   └── app.py\n│\n└── go/                     # Port 8005\n    └── main.go\n```\n\n---\n\n## Environment Variables\n\n| Variable | Description | Example |\n|----------|-------------|---------|\n| `PUBLIC_API_KEY` | Portico public key for hosted fields | `pkapi_cert_jKc1Ft...` |\n| `SECRET_API_KEY` | Portico secret key for server-side SDK | `skapi_cert_MTyM...` |\n\n---\n\n## Test Cards (Sandbox)\n\n| Brand | Card Number | CVV | Expiry |\n|-------|-------------|-----|--------|\n| Visa | 4012002000060016 | 123 | Any future |\n| Mastercard | 5473500000000014 | 123 | Any future |\n| Discover | 6011000990156527 | 123 | Any future |\n| Amex | 372700699251018 | 1234 | Any future |\n\n---\n\n## Troubleshooting\n\n**Reports return empty results**\nSandbox accounts may have limited transaction history. Process a test payment in Tab 1 first, then search for it in Tab 3.\n\n**`401 Unauthorized` from Portico**\nVerify `PUBLIC_API_KEY` and `SECRET_API_KEY` in `.env` match the `pkapi_cert_` / `skapi_cert_` format for sandbox.\n\n**`Invalid start_date format`**\nDates must be `YYYY-MM-DD`. Example: `2025-01-15`.\n\n**Port conflict**\nCheck which service is running (`lsof -i :8001`) and update the port in `docker-compose.yml`.\n\n## Community\n\n- 🌐 **Developer Portal** — [developer.globalpayments.com](https://developer.globalpayments.com)\n- 💬 **Discord** — [Join the community](https://discord.gg/myER9G9qkc)\n- 📋 **GitHub Discussions** — [github.com/orgs/globalpayments/discussions](https://github.com/orgs/globalpayments/discussions)\n- 📧 **Newsletter** — [Subscribe](https://www.globalpayments.com/en-gb/modals/newsletter)\n- 💼 **LinkedIn** — [Global Payments for Developers](https://www.linkedin.com/showcase/global-payments-for-developers/posts/?feedView=all)\n\nHave a question or found a bug? [Open an issue](https://github.com/globalpayments-samples/reporting-service/issues) or reach out at [communityexperience@globalpay.com](mailto:communityexperience@globalpay.com).\n\n---\n\n## License\n\nMIT — see [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobalpayments-samples%2Freporting-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglobalpayments-samples%2Freporting-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglobalpayments-samples%2Freporting-service/lists"}