{"id":50852201,"url":"https://github.com/developeregrem/payment-core","last_synced_at":"2026-06-14T14:31:37.370Z","repository":{"id":362483907,"uuid":"1257085548","full_name":"developeregrem/payment-core","owner":"developeregrem","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-04T11:20:35.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-04T13:13:00.981Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/developeregrem.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":"2026-06-02T10:56:07.000Z","updated_at":"2026-06-04T11:20:04.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/developeregrem/payment-core","commit_stats":null,"previous_names":["developeregrem/payment-core"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/developeregrem/payment-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developeregrem%2Fpayment-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developeregrem%2Fpayment-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developeregrem%2Fpayment-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developeregrem%2Fpayment-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developeregrem","download_url":"https://codeload.github.com/developeregrem/payment-core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developeregrem%2Fpayment-core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34324004,"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-14T02:00:07.365Z","response_time":62,"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":[],"created_at":"2026-06-14T14:31:36.676Z","updated_at":"2026-06-14T14:31:37.365Z","avatar_url":"https://github.com/developeregrem.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fewohbee/payment-core\n\nProvider-agnostic payment module with a Payactive adapter, packaged as a Symfony\nbundle so it can be reused by multiple apps.\n\n## What's inside\n\n- `PaymentCoreBundle` — registers all services, the autoconfiguration tags and the Doctrine mapping\n- `Provider/` — `PaymentProviderInterface` + `PaymentProviderRegistry`\n- `Webhook/` — `WebhookHandlerInterface` + `WebhookHandlerRegistry`\n- `Service/PaymentService` — `initiate()`, `syncStatus()`, `findPending()`, `processWebhook()`\n- `Command/ReconcilePendingPaymentsCommand` — `payment:reconcile-pending` (cron)\n- `Command/SandboxTestCommand` — `payment:sandbox-test` (manual sandbox driver)\n- `Dto/`, `Enum/`, `Event/`, `Exception/`\n- `Adapter/Payactive/` — `PayactiveProvider`, `PayactiveClient`, `PayactiveWebhookHandler`\n- `Entity/PaymentTransaction` + `Repository/PaymentTransactionRepository`\n\nThe opaque link to the host domain is `PaymentTransaction.externalReference`\n(no FK to host entities — keeps the package decoupled). Subscribe to\n`PaymentSettledEvent` / `PaymentFailedEvent` / `PaymentCancelledEvent` /\n`PaymentRefundedEvent` in the host app to react to status changes.\n\n## Install\n\nAdd the VCS repository and require the package in the consuming app's `composer.json`:\n\n```json\n{\n    \"repositories\": [\n        { \"type\": \"vcs\", \"url\": \"https://github.com/developeregrem/payment-core\" }\n    ],\n    \"require\": {\n        \"fewohbee/payment-core\": \"^0.1\"\n    }\n}\n```\n\n```sh\ncomposer require fewohbee/payment-core\n```\n\n## Wire it up\n\n1. **Register the bundle** in `config/bundles.php`:\n\n   ```php\n   return [\n       // ...\n       Fewohbee\\PaymentCore\\PaymentCoreBundle::class =\u003e ['all' =\u003e true],\n   ];\n   ```\n\n   That alone provides all services, the `app.payment.provider` /\n   `app.payment.webhook_handler` autoconfiguration tags **and** the Doctrine ORM\n   mapping for `PaymentTransaction`. No service copy-paste, no `doctrine.yaml`\n   mapping entry required.\n\n2. **Env vars** (the bundle config defaults to these):\n\n   ```dotenv\n   PAYMENT_PROVIDER=payactive\n   PAYACTIVE_API_BASE_URL=https://api.sandbox.payactive.app\n   PAYACTIVE_API_KEY=...\n   PAYACTIVE_WEBHOOK_SECRET=...\n   ```\n\n   To override without env vars, add `config/packages/payment_core.yaml`:\n\n   ```yaml\n   payment_core:\n       active_provider: payactive\n       payactive:\n           api_key: '%env(PAYACTIVE_API_KEY)%'\n           base_url: '%env(PAYACTIVE_API_BASE_URL)%'\n           webhook_secret: '%env(PAYACTIVE_WEBHOOK_SECRET)%'\n   ```\n\n3. **Generate a migration** in the host app (`doctrine:migrations:diff`) — the\n   `payment_transactions` table lives in the host app's schema. The package does\n   not ship migrations.\n\n4. **Webhook endpoint (optional)** — the package ships `processWebhook()` and the\n   Payactive HMAC handler but no controller route. Apps that want push updates\n   add a thin controller calling `PaymentService::processWebhook($providerId, $request)`\n   (outside the firewall; the HMAC signature is the authentication). The handler\n   maps `payment.initiated`, `payment.settled` and `payment.failed`\n   (`payment.cancelled` / `payment.refunded` are mapped forward-compatibly).\n\n\u003e A reference YAML snippet still lives in [`config/services.dist.yaml`](config/services.dist.yaml)\n\u003e for non-Flex setups that cannot register the bundle — prefer the bundle.\n\n## Status sync\n\nPayactive has no redirect-back; status is resolved by polling\n(`payment:reconcile-pending`, cron) and/or the webhook handler. Keep the cron\nrunning as a safety net even when the webhook is wired.\n\n**Known limitation:** polling stops once a transaction reaches a terminal status\n(e.g. `SETTLED`). A refund/chargeback that happens *after* settlement is not\nre-detected by polling; rely on a `payment.refunded` webhook (if your account\nemits it) or handle it manually. See the integration plan for the open\nprovider questions.\n\n## Tests\n\n```sh\ncomposer install\nvendor/bin/phpunit\n```\n\n## License\n\nProprietary — all rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperegrem%2Fpayment-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloperegrem%2Fpayment-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloperegrem%2Fpayment-core/lists"}