{"id":26901612,"url":"https://github.com/ingameltd/node-przelewy24","last_synced_at":"2025-07-18T14:32:28.218Z","repository":{"id":40289604,"uuid":"240296318","full_name":"ingameltd/node-przelewy24","owner":"ingameltd","description":"A simple library for connecting Przelewy24 written in Typescript","archived":false,"fork":false,"pushed_at":"2023-12-11T19:52:53.000Z","size":528,"stargazers_count":20,"open_issues_count":8,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-10T06:11:17.320Z","etag":null,"topics":["library","nodejs","p24","przelewy24","ts","typescript"],"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/ingameltd.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}},"created_at":"2020-02-13T15:39:17.000Z","updated_at":"2024-07-23T17:37:15.000Z","dependencies_parsed_at":"2023-02-06T07:46:02.261Z","dependency_job_id":null,"html_url":"https://github.com/ingameltd/node-przelewy24","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingameltd%2Fnode-przelewy24","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingameltd%2Fnode-przelewy24/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingameltd%2Fnode-przelewy24/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ingameltd%2Fnode-przelewy24/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ingameltd","download_url":"https://codeload.github.com/ingameltd/node-przelewy24/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246612494,"owners_count":20805354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["library","nodejs","p24","przelewy24","ts","typescript"],"created_at":"2025-04-01T08:54:45.595Z","updated_at":"2025-04-01T08:54:46.226Z","avatar_url":"https://github.com/ingameltd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Przelewy24 for NodeJS\n\n![Build](https://github.com/ingameltd/node-przelewy24/workflows/Build/badge.svg) ![](https://img.shields.io/github/license/ingameltd/node-przelewy24) ![](https://img.shields.io/npm/v/@ingameltd/node-przelewy24) ![](https://img.shields.io/github/last-commit/ingameltd/node-przelewy24)\n\nNodeJS Library for [**Przelewy24**](https://przelewy24.pl/). This library is written in Typescript to provide\nbest typesafety.\n\nThis library provides an elegant way to create/verify transactions easily.\n\n**Note: Now this library uses the new REST API availiable in [here](https://developers.przelewy24.pl/index.php?en).**\n\n\u003e Previous legacy API support is still availiable in **v1.1.1**\n\u003e Future versions will support new REST API only, If you use legacy API please use that version\n\n## Documentation\n\nDocumentation can be in read [here](https://ingameltd.github.io/node-przelewy24).\n\n## Installation\n\n```bash\nnpm install --save @ingameltd/node-przelewy24\n```\n\n## Typescript\n\n### Importing\n\n```typescript\nimport {\n  P24,\n  Order,\n  Currency,\n  Country,\n  Language,\n  NotificationRequest,\n  Verification\n} from \"@ingameltd/node-przelewy24\";\n```\n\n### Initialization\n\n- **merchantId** : ID given by P24\n- **posId** : Given by P24(often this referes to Merchant ID)\n- **apiKey** : API Key from p24 panel(Klucz do raportów)\n- **crcKey** : CRC value obtained from p24 panel\n\n```typescript\nconst p24 = new P24(\n  merchantId, \n  posId,\n  apiKey,\n  crcKey, \n  { \n    sandbox: false // enable or disable sandbox\n  }\n);\n```\n\n### Testing access to P24\n\n```typescript\nconst result = await p24.testAccess();\nconsole.log(result); // true on success or an error being throw P24Error\n```\n\n### Get payment link\n\nPrepare following details to initiate a payment\n\n```typescript\nconst order: Order = {\n  sessionId: \"c837e1a3-c5a3-4e89-adf1-05faffd8913b\",\n  amount: 1000, // Transaction amount expressed in lowest currency unit, e.g. 1.23 PLN = 123\n  currency: Currency.PLN,\n  description: \"test order\",\n  email: \"john.doe@example.com\",\n  country: Country.Poland,\n  language: Language.PL,\n  urlReturn: \"http://myawesomeapp.com/continue\",\n  urlStatus: \"http://myawesomeapp.com/p24callback\", // callback to get notification\n  timeLimit: 15, // 15min\n  encoding: Encoding.UTF8,\n}\nconst result = await p24.createTransaction(order)\nconsole.log(result) // prints a valid url to pay the payment or throws an error\n```\n\n### Verify Notification\n\nP24 system will send you a notification to the `urlStatus` provided in\ntransaction order. You need to **verify** this Notification request before actually **Verify Transaction**\n\n```typescript\nconst verify: NotificationRequest = req.body\nconst res = p24.verifyNotification(verify)\nconsole.log(res) // true when the Notification is valid\n```\n\n### Verifies a transaction with P24\n\nTo accept the payment to your merchant account, after validating the Notification\nrequest, you need to verify the transaction with P24 system. **If you don't do that the funds will not be transferred into your account**.\n\n```typescript\n// extract all information from callback request\nconst verifyRequest: Verification = {\n    amount: 1000,\n    currency: Currency.PLN,\n    orderId: 3030,\n    sessionId: 'c837e1a3-c5a3-4e89-adf1-05faffd8913b'\n}\n\nconst res = await p24.verifyTransaction(verifyRequest)\nconsole.log(res) // true on success otherwise P24Error\n```\n\n### Refund a requst\n\nTo refund the customer you need to open up a refund request\n\n```typescript\nconst ref = {\n  refundsUuid: '94c1fb0b-f40f-4201-b2a0-f4166839d06c',\n  requestId: 'afa379ac-c3ca-43d0-892f-e7a3f13ee4cc',\n  refunds: [\n    {\n        amount: 1000,\n        description: 'test',\n        orderId: 3030,\n        sessionId: 'c837e1a3-c5a3-4e89-adf1-05faffd8913b'\n    }\n  ],\n}\n\nconst result = await p24.refund(ref)\nconsole.log(result) // returns a SuccessResponse\u003cRefundResult[]\u003e where you can find about each refund request in array\n```\n\n### Validate IP\n\nLibrary provides method to validate IP addresses with P24 backends\n\n```typescript\nconst valid = Przelewy24.isIpValid(\"127.0.0.1\");\nconsole.log(valid); // output false if IP is not from p24\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fingameltd%2Fnode-przelewy24","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fingameltd%2Fnode-przelewy24","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fingameltd%2Fnode-przelewy24/lists"}