{"_id":"@dallotech/nestjs-khalti","_rev":"2-48e5587e6385a43ec38e26e78ccc4e02","name":"@dallotech/nestjs-khalti","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.0":{"name":"@dallotech/nestjs-khalti","version":"0.0.0","description":"This is simple wrapper for Khalti Payment. It supports ePayment Gateway(NEW) and transaction verification, but later more will be added. Just ping us or open pull request and contribute :)","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rimraf dist && tsc","prepublish":"npm run build"},"keywords":["nestjs","khalti","api","dallotech"],"author":{"name":"Dallo Tech Pvt. Ltd."},"license":"MIT","devDependencies":{"@nestjs/axios":"^3.0.0","@nestjs/common":"^10.2.7","@types/node":"^20.8.6","rimraf":"^5.0.5","rxjs":"^7.8.1","crypto-js":"^4.1.1"},"gitHead":"402bf8449f69c322ba9cef3126905615aa26fb10","_id":"@dallotech/nestjs-khalti@0.0.0","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-cMMPHertOcFm76h3ZDdWFB6QE+gCjNiQivWsvrnQUwtD5ex0KY9pZqSXyfvJn1E60BBvekfVuQB53EZ1ywBnCw==","shasum":"3398fe942108cc27d82866acea7ed02e7143b650","tarball":"https://registry.npmjs.org/@dallotech/nestjs-khalti/-/nestjs-khalti-0.0.0.tgz","fileCount":24,"unpackedSize":31000,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBwIpaCk3EgHRpPD0xqeTMaDr0xhdCHKFSmG9/oS6O+wIhANEePoJ6fvi/6eommUKNf0balNxf3PAhkjPlVPBljelY"}]},"_npmUser":{"name":"sagarsishir51","email":"sagar.sishir51@gmail.com"},"directories":{},"maintainers":[{"name":"sagarsishir51","email":"sagar.sishir51@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-khalti_0.0.0_1701422688324_0.8331317024512248"},"_hasShrinkwrap":false},"0.0.1":{"name":"@dallotech/nestjs-khalti","version":"0.0.1","description":"This is simple wrapper for Khalti Payment. It supports ePayment Gateway(NEW) and transaction verification, but later more will be added. Just ping us or open pull request and contribute :)","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rimraf dist && tsc","prepublish":"npm run build"},"keywords":["nestjs","khalti","api","dallotech"],"author":{"name":"Dallo Tech Pvt. Ltd."},"license":"MIT","devDependencies":{"@nestjs/axios":"^3.0.0","@nestjs/common":"^10.2.7","@types/node":"^20.8.6","rimraf":"^5.0.5","rxjs":"^7.8.1","crypto-js":"^4.1.1"},"gitHead":"020d98508f6d9c20d2a88f8226ee0670af4489b3","_id":"@dallotech/nestjs-khalti@0.0.1","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-3lgk3nXnr6L8AH5pAl02gdX5ygYD5S+LtsACZ17vk4xiKuOiht/EsBIqtiCQqcNTXDjg/RPdDxVDrQPiWwATxg==","shasum":"8bc7c988fb6028fcf15597e9cda7e65186058445","tarball":"https://registry.npmjs.org/@dallotech/nestjs-khalti/-/nestjs-khalti-0.0.1.tgz","fileCount":24,"unpackedSize":32120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDGmEWgtffLKshJoXaP97iFx4pS2woCa3cbIIP7WuLUsAiAFen5heQECFMeKGNv4bQGx2m5CW+BbdrETnztkk+fEmA=="}]},"_npmUser":{"name":"sagarsishir51","email":"sagar.sishir51@gmail.com"},"directories":{},"maintainers":[{"name":"sagarsishir51","email":"sagar.sishir51@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-khalti_0.0.1_1707728661195_0.14994374259968835"},"_hasShrinkwrap":false},"0.0.2":{"name":"@dallotech/nestjs-khalti","version":"0.0.2","description":"This is simple wrapper for Khalti Payment. It supports ePayment Gateway(NEW) and transaction verification, but later more will be added. Just ping us or open pull request and contribute :)","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rimraf dist && tsc","prepublish":"npm run build"},"keywords":["nestjs","khalti","api","dallotech"],"author":{"name":"Dallo Tech Pvt. Ltd."},"license":"MIT","devDependencies":{"@nestjs/axios":"^3.0.0","@nestjs/common":"^10.2.7","@types/node":"^20.8.6","rimraf":"^5.0.5","rxjs":"^7.8.1","crypto-js":"^4.1.1"},"gitHead":"2bd141187bc3ce50ca77c0abf636791a89794057","_id":"@dallotech/nestjs-khalti@0.0.2","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-ytQZsk4KT4s8tORIOGbNgyUyWJajpT5FSpozvZdkTWTycPJNa9zkgoNK9RGymjPNX8G/DfbAsGp3U4crzVNVRw==","shasum":"4e2ef4532ee78ca8b85664e79de97ba7556d7da4","tarball":"https://registry.npmjs.org/@dallotech/nestjs-khalti/-/nestjs-khalti-0.0.2.tgz","fileCount":24,"unpackedSize":31143,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGbUdWSuhbPiAqYpnhtYPcTm2G4piMc0WlwlXbZ2nYk5AiAfAG7nPi1Mfrx+2mOc09HLKjG53wjsKRB1XZvAZ2iLCQ=="}]},"_npmUser":{"name":"sagarsishir51","email":"sagar.sishir51@gmail.com"},"directories":{},"maintainers":[{"name":"sagarsishir51","email":"sagar.sishir51@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nestjs-khalti_0.0.2_1707815960955_0.30892397310933783"},"_hasShrinkwrap":false}},"time":{"created":"2023-12-01T09:24:48.210Z","0.0.0":"2023-12-01T09:24:48.516Z","modified":"2024-02-13T09:19:21.276Z","0.0.1":"2024-02-12T09:04:21.372Z","0.0.2":"2024-02-13T09:19:21.113Z"},"maintainers":[{"name":"sagarsishir51","email":"sagar.sishir51@gmail.com"}],"description":"This is simple wrapper for Khalti Payment. It supports ePayment Gateway(NEW) and transaction verification, but later more will be added. Just ping us or open pull request and contribute :)","keywords":["nestjs","khalti","api","dallotech"],"author":{"name":"Dallo Tech Pvt. Ltd."},"license":"MIT","readme":"## Introduction\nThis is simple wrapper for Khalti Payment. It supports ePayment Gateway(NEW) and transaction verification, but later more will be added. Just ping us or open pull request and contribute :)\n## Installation\n\n```bash\n$ npm i --save @dallotech/nestjs-khalti \n$ yarn add @dallotech/nestjs-khalti \n```\n\n#### Importing module Async\n\n```typescript\nimport { KhaltiModule } from '@dallotech/nestjs-khalti';\n@Module({\n  imports: [\n      KhaltiModule.registerAsync({\n          imports: [ConfigModule],\n          inject: [ConfigService],\n          useFactory: (configService: ConfigService<AllConfig>) => ({\n              secretKey: configService.get(\"----your key-----\", {infer: true}),\n              //optional if different key is required for EPayment flow\n              secretKeyEPayment: configService.get(\"----your key-----\", {infer: true}),\n              paymentMode: configService.get(\"----your key-----\", {infer: true}),\n          })\n      }),\n  ],\n  providers: [],\n  exports: [],\n})\nexport class YourModule {}\n```\n#### Calling Init Method to initialize payment for ePayment Gateway(NEW)\n\n```typescript\nimport { KhaltiService,KhaltiRequestDto } from '@dallotech/nestjs-khalti';\n\n@Injectable()\nexport class YourService {\n  constructor(private khaltiService: KhaltiService) {}\n    \n    async initPayment(){\n        //...your code\n        //amount needs to be in paisa for khalti\n        const khaltiRequestDto: KhaltiRequestDto = {\n            amount: 10*100,\n            purchaseOrderId: 0,\n            purchaseOrderName: 0,\n            returnUrl: 'return url of frontend',\n            websiteUrl: 'url of frontend'\n        };\n        const initData = await this.khaltiService.init(khaltiRequestDto);\n        //...use initData where required as use case\n    \n  }\n}\n```\n\n#### Calling LookUp Method for ePayment Gateway(NEW)\n\n```typescript\nimport { KhaltiService } from '@dallotech/nestjs-khalti';\n\n@Injectable()\nexport class YourService {\n  constructor(private khaltiService: KhaltiService) {}\n    \n    async verifyPayment(data){\n        //...your code\n        const {pidx} = data;\n        const response = await this.khaltiService.verify({pidx});\n        //..your code can verify the response data with your business logic and response format\n  }\n}\n```\n\n#### Calling transaction verification for Khalti\n\n```typescript\nimport { KhaltiService } from '@dallotech/nestjs-khalti';\n\n@Injectable()\nexport class YourService {\n  constructor(private khaltiService: KhaltiService) {}\n    \n    async verifyPayment(data){\n        //...your code\n        const {token,amount} = data;\n        //amount needs to be in paisa for khalti\n        const response = await this.khaltiService.verify({token,amount:amount*100});\n        //..your code can verify the response data with your business logic and response format\n  }\n}\n```\n\n## License\n\nThis package is MIT licensed.\n","readmeFilename":"README.md"}