{"id":41879136,"url":"https://github.com/MagdyAbouelnasr/ngx-hyperpay","last_synced_at":"2026-01-26T18:01:15.346Z","repository":{"id":332744697,"uuid":"1134555059","full_name":"MagdyAbouelnasr/ngx-hyperpay","owner":"MagdyAbouelnasr","description":"An Angular library for easy integration of the HyperPay payment gateway. This library provides a component that wraps the HyperPay COPYandPAY integration, making it simple to add a payment form to your Angular application.","archived":false,"fork":false,"pushed_at":"2026-01-22T13:09:31.000Z","size":349,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-22T23:56:54.814Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/MagdyAbouelnasr.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":"2026-01-14T21:58:32.000Z","updated_at":"2026-01-22T13:09:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/MagdyAbouelnasr/ngx-hyperpay","commit_stats":null,"previous_names":["magdyabouelnasr/ngx-hyperpay"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MagdyAbouelnasr/ngx-hyperpay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagdyAbouelnasr%2Fngx-hyperpay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagdyAbouelnasr%2Fngx-hyperpay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagdyAbouelnasr%2Fngx-hyperpay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagdyAbouelnasr%2Fngx-hyperpay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MagdyAbouelnasr","download_url":"https://codeload.github.com/MagdyAbouelnasr/ngx-hyperpay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagdyAbouelnasr%2Fngx-hyperpay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28784093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-01-25T13:00:20.521Z","updated_at":"2026-01-26T18:01:15.334Z","avatar_url":"https://github.com/MagdyAbouelnasr.png","language":"TypeScript","funding_links":[],"categories":["Security and Authentication"],"sub_categories":["Payments"],"readme":"# NGX-Hyperpay\n\nAn Angular library for easy integration of the HyperPay payment gateway. This library provides a component that wraps the HyperPay COPYandPAY integration, making it simple to add a payment form to your Angular application.\n\n## Installation\n\nInstall the package from npm:\n\n```bash\nnpm install ngx-hyperpay\n```\n\n## Backend Integration Required\n\n**Security Note:** Do NOT perform sensitive operations (like generating checkout IDs or querying payment status with authorization tokens) on the client-side.\n\n1.  **Generate Checkout ID**: Call your backend API to Request a `checkoutId` from HyperPay using your secret entityId and authorization token.\n2.  **Pass to Component**: Pass the received `checkoutId` to the `ngx-hyperpay` component.\n3.  **Handle Callback**: When the payment is complete, HyperPay redirects to your `shopperResultUrl`. The component will emit the `resourcePath` (or `id`).\n4.  **Verify Payment**: Send this `resourcePath` to your backend. Your backend should then query HyperPay's status API using this path to confirm the payment validity and status.\n\n## Usage\n\n1.  Import the `NgxHyperpayComponent` in your component or module:\n\n```typescript\nimport { NgxHyperpayComponent } from 'ngx-hyperpay';\n\n@Component({\n  selector: 'app-my-component',\n  standalone: true,\n  imports: [NgxHyperpayComponent],\n  template: `\n    \u003cngx-hyperpay\n      [checkoutId]=\"checkoutId\"\n      [brands]=\"'VISA MASTER MADA'\"\n      [mode]=\"'test'\"\n      [shopperResultUrl]=\"'https://your-domain.com/callback'\" \n      [redirectUrl]=\"'https://your-domain.com/home'\"\n      (onSuccess)=\"onPaymentSuccess($event)\"\n      (onFailure)=\"onPaymentFailure($event)\"\n      (onCancel)=\"onPaymentCancel($event)\"\n      (onError)=\"onPaymentError($event)\"\n    \u003e\u003c/ngx-hyperpay\u003e\n  `\n})\nexport class MyComponent {\n  checkoutId = 'YOUR_CHECKOUT_ID'; // Obtain this from your server\n\n  onPaymentSuccess(data: any) {\n    console.log('Payment successful:', data);\n  }\n\n  onPaymentFailure(data: any) {\n    console.log('Payment failed:', data);\n  }\n\n  onPaymentCancel(data: any) {\n    console.log('Payment cancelled:', data);\n  }\n\n  onPaymentError(error: any) {\n    console.error('An error occurred:', error);\n  }\n}\n```\n\n## API\n\n### Inputs\n\n| Input           | Type                  | Default          | Description                                                                                             |\n| --------------- | --------------------- | ---------------- | ------------------------------------------------------------------------------------------------------- |\n| `checkoutId`    | `string`              | **Required**     | The checkout ID obtained from your server-side integration with HyperPay.                               |\n| `brands`        | `string`              | `'VISA MASTER MADA'` | A space-separated list of payment brands to display (e.g., `'VISA MASTER AMEX'`).                       |\n| `mode`          | `'test'` \\| `'live'`    | `'test'`         | The mode for the HyperPay script. Use `'test'` for development and `'live'` for production.             |\n| `style`         | `'card'` \\| `'plain'`   | `'card'`         | The visual style of the payment form.                                                                   |\n| `locale`        | `'en'` \\| `'ar'`      | `'en'`           | The language of the payment widget.                                                                     |\n| `shopperResultUrl`| `string`              | `''`             | The custom callback URL to redirect to after payment. Overrides `redirectUrl` and default behavior.     |\n| `redirectUrl`   | `string`              | `''`             | The URL to redirect to after the payment. Defaults to the current URL.                                  |\n\n### Outputs\n\n| Output      | EventEmitter\u0026lt;any\u0026gt; | Description                                            |\n| ----------- | ---------------------- | ------------------------------------------------------ |\n| `onReady`   | `void`                 | Emitted when the HyperPay widget is ready.             |\n| `onSuccess` | `any`                  | Emitted when the payment is successful.                |\n| `onFailure` | `any`                  | Emitted when the payment fails.                        |\n| `onCancel`  | `any`                  | Emitted when the user cancels the payment.             |\n| `onError`   | `any`                  | Emitted when an error occurs (e.g., script fails to load). |\n| `getResourcePath`| `string`              | Emitted when `resourcePath` query parameter is found (decoded). |\n| `getRawResourcePath`| `string`              | Emitted when `resourcePath` query parameter is found (raw encoded). |\n| `getId` | `string` | Emitted when `id` query parameter is found (decoded). |\n| `getRawId` | `string` | Emitted when `id` query parameter is found (raw encoded). |\n\n## Development\n\nThis library was generated with [Angular CLI](https://github.com/angular/angular-cli).\n\n### Build\n\nRun `ng build ngx-hyperpay` to build the project. The build artifacts will be stored in the `dist/` directory.\n\n### Publishing\n\nAfter building your library with `ng build ngx-hyperpay`, go to the dist folder `cd dist/ngx-hyperpay` and run `npm publish`.\n\n## Repository\n\nThe source code is available on [GitLab](https://github.com/MagdyAbouelnasr/ngx-hyperpay).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMagdyAbouelnasr%2Fngx-hyperpay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMagdyAbouelnasr%2Fngx-hyperpay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMagdyAbouelnasr%2Fngx-hyperpay/lists"}