{"_id":"@amanbel/payment-verifier-sdk","_rev":"3-ca41aa8d10c7ddbf94e0996bb2ff4862","name":"@amanbel/payment-verifier-sdk","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@amanbel/payment-verifier-sdk","version":"1.0.0","keywords":["ethiopia","ethiopian","payment","payments","telebirr","cbe","abyssinia","verification"],"author":{"name":"Your Name"},"license":"MIT","_id":"@amanbel/payment-verifier-sdk@1.0.0","maintainers":[{"name":"amanbel","email":"amanuel11belachew@gmail.com"}],"dist":{"shasum":"fffd7ab7d69b1618f16800adf29802366e3068e8","tarball":"https://registry.npmjs.org/@amanbel/payment-verifier-sdk/-/payment-verifier-sdk-1.0.0.tgz","fileCount":43,"integrity":"sha512-1p8tK++Bmj2dWbHpPoNGCQ6CGpvlb/8jWpw3DobzgXn5FayTfnoEXeht0bRCCCuSpOIZFCTarRwK4l7l1e5QTQ==","signatures":[{"sig":"MEUCIG0Ka+cKebETkugP09xpaKaE7Y0aPR6xrZn/gRSWQ5ZdAiEAsrMMSAcW4LIl19MRUikmN1A8XB7rOCSl7YatsRSYnhk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":40019},"main":"./dist/index.js","type":"commonjs","types":"./dist/index.d.ts","scripts":{"test":"echo \"Tests not configured yet\"","build":"tsc","clean":"rm -rf dist","prepare":"npm run build"},"_npmUser":{"name":"amanbel","email":"amanuel11belachew@gmail.com"},"_npmVersion":"11.5.2","description":"Ethiopian payment transaction verification SDK for Telebirr, CBE and Bank of Abyssinia.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"axios":"^1.12.2","cheerio":"^1.1.2","@amanbel/payment-verifier-sdk":"file:amanbel-payment-verifier-sdk-1.0.0.tgz"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^24.9.1"},"_npmOperationalInternal":{"tmp":"tmp/payment-verifier-sdk_1.0.0_1788638462153_0.04243223321065703","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@amanbel/payment-verifier-sdk","version":"1.0.1","keywords":["ethiopia","ethiopian","payment","payments","telebirr","cbe","abyssinia","verification"],"author":{"name":"Your Name"},"license":"MIT","_id":"@amanbel/payment-verifier-sdk@1.0.1","maintainers":[{"name":"amanbel","email":"amanuel11belachew@gmail.com"}],"dist":{"shasum":"ebe3d49bfb66d7f789294cf58222c6dd123398bf","tarball":"https://registry.npmjs.org/@amanbel/payment-verifier-sdk/-/payment-verifier-sdk-1.0.1.tgz","fileCount":43,"integrity":"sha512-LDHDUcyjTNpV7YLDlo1FAzaTOmA03Jc/039py2VIxx54CpJb4JlAKXk0vwamchFaSiMwXkAsiaTk1TKr+bHanA==","signatures":[{"sig":"MEUCIDoG9mYgLeqBqVdzkDS9asdu854WtzRDdT5UgFdlCxviAiEAxxzrEIwHXHoXBjHXTAIULtkIF6NU9hDH36xdc+c5C1U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":39935},"main":"./dist/index.js","type":"commonjs","types":"./dist/index.d.ts","scripts":{"test":"echo \"Tests not configured yet\"","build":"tsc","clean":"rm -rf dist","prepare":"npm run build"},"_npmUser":{"name":"amanbel","email":"amanuel11belachew@gmail.com"},"_npmVersion":"11.5.2","description":"Ethiopian payment transaction verification SDK for Telebirr, CBE and Bank of Abyssinia.","directories":{},"_nodeVersion":"22.14.0","dependencies":{"axios":"^1.12.2","cheerio":"^1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.9.3","@types/node":"^24.9.1"},"_npmOperationalInternal":{"tmp":"tmp/payment-verifier-sdk_1.0.1_1788646491367_0.998717815491647","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@amanbel/payment-verifier-sdk","version":"1.0.2","description":"Ethiopian payment transaction verification SDK for Telebirr, CBE and Bank of Abyssinia.","keywords":["ethiopia","ethiopian","payment","payments","telebirr","cbe","abyssinia","verification"],"license":"MIT","author":{"name":"Your Name"},"type":"commonjs","main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"build":"tsc","clean":"rm -rf dist","prepare":"npm run build","test":"echo \"Tests not configured yet\""},"dependencies":{"axios":"^1.12.2","cheerio":"^1.1.2"},"devDependencies":{"@types/node":"^24.9.1","typescript":"^5.9.3"},"_id":"@amanbel/payment-verifier-sdk@1.0.2","_nodeVersion":"22.14.0","_npmVersion":"11.5.2","dist":{"integrity":"sha512-juCpW4WJ+FuhTOKVCLux/99VLxIS3VkRg0n/5qbe32nU3HGu6nJmZBTtqTcVIl4nM4eZuNBK6QmoA8YK6tIIDg==","shasum":"8f011a3d4eca153307d78f8480689d4c8035f884","tarball":"https://registry.npmjs.org/@amanbel/payment-verifier-sdk/-/payment-verifier-sdk-1.0.2.tgz","fileCount":43,"unpackedSize":39903,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDSWQAzWdiuK1NYnKxUNKu5hvPsBOnPYR1b6eI+dcgtEAIhALCgS7K7l3dfI/nPpEFkWbnRFXooHqkFbEyDvPMFQvaa"}]},"_npmUser":{"name":"amanbel","email":"amanuel11belachew@gmail.com"},"directories":{},"maintainers":[{"name":"amanbel","email":"amanuel11belachew@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/payment-verifier-sdk_1.0.2_1788722693366_0.07102681699019442"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-05T20:01:01.931Z","modified":"2026-09-06T19:24:53.662Z","1.0.0":"2026-09-05T20:01:02.295Z","1.0.1":"2026-09-05T22:14:51.485Z","1.0.2":"2026-09-06T19:24:53.503Z"},"author":{"name":"Your Name"},"license":"MIT","keywords":["ethiopia","ethiopian","payment","payments","telebirr","cbe","abyssinia","verification"],"description":"Ethiopian payment transaction verification SDK for Telebirr, CBE and Bank of Abyssinia.","maintainers":[{"name":"amanbel","email":"amanuel11belachew@gmail.com"}],"readme":"# Ethiopian Payment Verifier\r\n\r\nA Node.js/TypeScript SDK for verifying Ethiopian payment transactions.\r\n\r\nCurrently supported providers:\r\n\r\n- Telebirr\r\n- Commercial Bank of Ethiopia (CBE)\r\n- Bank of Abyssinia\r\n- More Comming Soon\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @amanbel/ethiopian-payment-verifier\r\n```\r\n\r\n## Usage\r\n\r\nThe package provides a simple `PaymentVerifier` class that allows you to\r\nverify payment transactions from supported Ethiopian payment providers.\r\n\r\n### 1. Import the PaymentVerifier\r\n\r\n```ts\r\nimport { PaymentVerifier } from \"ethiopian-payment-verifier\";\r\n```\r\n\r\n### 2. Create an instance\r\n\r\nCreate a `PaymentVerifier` instance. No API URLs or provider configuration\r\nare required.\r\n\r\n```ts\r\nconst paymentVerifier = new PaymentVerifier();\r\n```\r\n\r\n### 3. Verify a payment\r\n\r\nUse the `verify()` method and provide the payment provider and transaction\r\nnumber.\r\n\r\n#### Telebirr\r\n\r\n```ts\r\nconst result = await paymentVerifier.verify({\r\n  provider: \"telebirr\",\r\n  transactionNumber: \"YOUR_TRANSACTION_NUMBER\",\r\n});\r\n```\r\n\r\n#### CBE\r\n\r\n```ts\r\nconst result = await paymentVerifier.verify({\r\n  provider: \"cbe\",\r\n  transactionNumber: \"YOUR_RECEIPT_NUMBER\",\r\n});\r\n```\r\n\r\n#### Bank of Abyssinia\r\n\r\n```ts\r\nconst result = await paymentVerifier.verify({\r\n  provider: \"abyssinia\",\r\n  transactionNumber: \"YOUR_TRANSACTION_NUMBER\",\r\n});\r\n```\r\n\r\n### 4. Handle the verification result\r\n\r\nThe `verify()` method returns a result that indicates whether the payment\r\nwas successfully verified.\r\n\r\n```ts\r\nif (result.success) {\r\n  console.log(\"Payment verified successfully\");\r\n  console.log(result.data);\r\n} else {\r\n  console.error(\"Payment verification failed\");\r\n  console.error(result.error);\r\n}\r\n```\r\n\r\n### Complete Example\r\n\r\n```ts\r\nimport { PaymentVerifier } from \"ethiopian-payment-verifier\";\r\n\r\nasync function verifyPayment() {\r\n  const paymentVerifier = new PaymentVerifier();\r\n\r\n  const result = await paymentVerifier.verify({\r\n    provider: \"telebirr\",\r\n    transactionNumber: \"YOUR_TRANSACTION_NUMBER\",\r\n  });\r\n\r\n  if (result.success) {\r\n    console.log(\"Payment verified successfully\");\r\n\r\n    console.log(\"Payer:\", result.data.payerName);\r\n    console.log(\"Amount:\", result.data.totalPaidAmount);\r\n    console.log(\"Transaction:\", result.data.invoiceNo);\r\n    console.log(\"Payment Date:\", result.data.paymentDate);\r\n    console.log(\"Payment Provider:\", result.data.payedFrom);\r\n  } else {\r\n    console.error(\"Payment verification failed:\");\r\n    console.error(result.error.message);\r\n  }\r\n}\r\n\r\nverifyPayment();\r\n```\r\n\r\n## Supported Payment Providers\r\n\r\nThe following payment providers are currently supported:\r\n\r\n| Provider          | Value       |\r\n| ----------------- | ----------- |\r\n| Telebirr          | `telebirr`  |\r\n| CBE               | `cbe`       |\r\n| Bank of Abyssinia | `abyssinia` |\r\n\r\n## Transaction Data\r\n\r\nWhen a payment is successfully verified, the `data` property contains\r\nstandardized transaction information regardless of the payment provider.\r\n\r\n```ts\r\n{\r\n  payerName: string;\r\n  payerTelebirrNo: string;\r\n  transactionStatus: string;\r\n  invoiceNo: string;\r\n  paymentDate: string;\r\n  paymentReciever: string;\r\n  settledAmount: string;\r\n  serviceFee: string;\r\n  serviceFeeVAT: string;\r\n  totalPaidAmount: string;\r\n  paymentReason: string;\r\n  paymentChannel: string;\r\n  payedFrom: string;\r\n}\r\n```\r\n\r\nThis allows your application to work with different payment providers\r\nusing the same data structure.\r\n\r\nFor example:\r\n\r\n```ts\r\nif (result.success) {\r\n  const payment = result.data;\r\n\r\n  if (payment.transactionStatus === \"success\") {\r\n    console.log(`Received ${payment.totalPaidAmount}`);\r\n  }\r\n}\r\n```\r\n\r\n## Using a Different Provider\r\n\r\nThe same `PaymentVerifier` instance can be used to verify payments from\r\ndifferent providers.\r\n\r\n```ts\r\nconst paymentVerifier = new PaymentVerifier();\r\n\r\nconst telebirrPayment = await paymentVerifier.verify({\r\n  provider: \"telebirr\",\r\n  transactionNumber: \"TELEBIRR_TRANSACTION\",\r\n});\r\n\r\nconst cbePayment = await paymentVerifier.verify({\r\n  provider: \"cbe\",\r\n  transactionNumber: \"CBE_RECEIPT_NUMBER\",\r\n});\r\n\r\nconst abyssiniaPayment = await paymentVerifier.verify({\r\n  provider: \"abyssinia\",\r\n  transactionNumber: \"ABYSSINIA_TRANSACTION\",\r\n});\r\n```\r\n\r\n## Error Handling\r\n\r\nA failed verification does not require you to catch an exception in normal\r\nusage. The result will contain `success: false` and an error.\r\n\r\n```ts\r\nconst result = await paymentVerifier.verify({\r\n  provider: \"cbe\",\r\n  transactionNumber: \"INVALID_TRANSACTION\",\r\n});\r\n\r\nif (!result.success) {\r\n  console.log(result.error.message);\r\n}\r\n```\r\n\r\nYou can also use `try/catch` to handle unexpected errors:\r\n\r\n```ts\r\ntry {\r\n  const result = await paymentVerifier.verify({\r\n    provider: \"telebirr\",\r\n    transactionNumber: \"YOUR_TRANSACTION_NUMBER\",\r\n  });\r\n\r\n  if (result.success) {\r\n    console.log(result.data);\r\n  } else {\r\n    console.error(result.error.message);\r\n  }\r\n} catch (error) {\r\n  console.error(\"Unexpected error:\", error);\r\n}\r\n```\r\n","readmeFilename":"README.md"}