{"_id":"@bisham/payment-package","_rev":"6-ed1a2695cd4cf4f4364d60126464bf93","name":"@bisham/payment-package","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.0":{"name":"@bisham/payment-package","version":"0.0.0","description":"An Easy Plug and Play Package For Implementing Popular Nepalese Payment Provider into any App.","main":"dist/index.js","author":{"name":"bishamkunwor"},"scripts":{"dev":"nodemon lib/index.ts","build":"tsc"},"keywords":["esewa","khalti","connectips"],"license":"MIT","devDependencies":{"@types/node":"^20.4.9","nodemon":"^3.0.1","ts-node":"^10.9.1","typescript":"^5.1.6"},"dependencies":{"axios":"^1.4.0"},"engines":{"node":">=16.0.0","npm":">=8.0.0","yarn":"Please Use Npm.","pnpm":"Please Use Npm."},"gitHead":"6547ae6ff043f5fb772bc2cff3030f315109f5aa","_id":"@bisham/payment-package@0.0.0","_nodeVersion":"18.16.1","_npmVersion":"9.7.2","dist":{"integrity":"sha512-l1hBLxRXXw4k1geYWniFGysceYFLAylgxRUTWwTI0TFgnqeO2jT1RSqFbjTJq9RoVaeWFcZgd3KdZGsl9ABQDQ==","shasum":"4c20b86a3714cb8e773fd56df265bad8f61cdb83","tarball":"https://registry.npmjs.org/@bisham/payment-package/-/payment-package-0.0.0.tgz","fileCount":1,"unpackedSize":713,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDSX6g6NrI1Ob3nUCiBZNeju0sN0v14q9e0sbjjThz27AiEAyP7K+7IMfk7pIzdMnp21q8MjMTKeyVhGmhS9FOrlqAE="}]},"_npmUser":{"name":"bishamkunwor","email":"novelian.nova@gmail.com"},"directories":{},"maintainers":[{"name":"bishamkunwor","email":"novelian.nova@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/payment-package_0.0.0_1691780982094_0.8974062848417095"},"_hasShrinkwrap":false},"0.0.1":{"name":"@bisham/payment-package","version":"0.0.1","description":"An Easy Plug and Play Typed Package For Implementing Popular Nepalese Payment Provider into any App.","main":"dist/index.js","author":{"name":"bishamkunwor"},"scripts":{"dev":"nodemon lib/index.ts","build":"tsc"},"keywords":["esewa","khalti","connectips"],"license":"MIT","devDependencies":{"@types/node":"^20.4.9","nodemon":"^3.0.1","ts-node":"^10.9.1","typescript":"^5.1.6"},"dependencies":{"axios":"^1.4.0"},"engines":{"node":">=16.0.0","npm":">=8.0.0","yarn":"Please Use Npm.","pnpm":"Please Use Npm."},"gitHead":"8e0d4660ee9c6466ad5d460310ad1b5a18f33b84","types":"./dist/index.d.ts","_id":"@bisham/payment-package@0.0.1","_nodeVersion":"18.16.1","_npmVersion":"9.7.2","dist":{"integrity":"sha512-H0IONLz5w4auzT9NlW2eevao001xvRXXXGpKUtqKp9oJmLl6idot4GBs6IUfPyGE1PLYqkbskUoKhm6C2Eu66A==","shasum":"79a9f4b2bb507413a2de4271c2438a97305fb3db","tarball":"https://registry.npmjs.org/@bisham/payment-package/-/payment-package-0.0.1.tgz","fileCount":8,"unpackedSize":9928,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDMdqMOdVEqKeRoOZli+8ZyDkZpoy66xW11/KVKa7oHjAiACHBxh1vlrsSCCmCb7Qji1QG7qPu2RgHOY14DtcTVCZQ=="}]},"_npmUser":{"name":"bishamkunwor","email":"novelian.nova@gmail.com"},"directories":{},"maintainers":[{"name":"bishamkunwor","email":"novelian.nova@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/payment-package_0.0.1_1691827648354_0.4217012794735948"},"_hasShrinkwrap":false},"0.0.2":{"name":"@bisham/payment-package","version":"0.0.2","description":"An Easy Plug and Play Typed Package For Implementing Popular Nepalese Payment Provider into any App.","main":"dist/index.js","author":{"name":"bishamkunwor"},"scripts":{"dev":"nodemon lib/index.ts","build":"tsc"},"keywords":["esewa","khalti","connectips"],"license":"MIT","devDependencies":{"@types/node":"^20.4.9","nodemon":"^3.0.1","ts-node":"^10.9.1","typescript":"^5.1.6"},"dependencies":{"axios":"^1.4.0"},"engines":{"node":">=16.0.0","npm":">=8.0.0","yarn":"Please Use Npm.","pnpm":"Please Use Npm."},"gitHead":"0a2e6a615a7d935a5153a8c84a8828e20bcf9363","types":"./dist/index.d.ts","_id":"@bisham/payment-package@0.0.2","_nodeVersion":"18.16.1","_npmVersion":"9.7.2","dist":{"integrity":"sha512-NZcpWH7MzOhVbc7IFj9sMFUADD9w4ZhoOhmhnMiQL+KPg0MMVCvWhGyzXSgWynjFfA41dgOyf9HP/zOXJoTfNQ==","shasum":"3494607df2a20443b19bc026d61d1e3b7ee0f48d","tarball":"https://registry.npmjs.org/@bisham/payment-package/-/payment-package-0.0.2.tgz","fileCount":9,"unpackedSize":15010,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEkrA99F5c1fq5GBKkrekh0XZ1Ei+D9P4fCav9H3sqQCAiEA/fWON6to35kLQr4rpndSrNBGWh6EOU2yF7JwYA+AR24="}]},"_npmUser":{"name":"bishamkunwor","email":"novelian.nova@gmail.com"},"directories":{},"maintainers":[{"name":"bishamkunwor","email":"novelian.nova@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/payment-package_0.0.2_1691835022855_0.3992677894341261"},"_hasShrinkwrap":false},"0.0.3":{"name":"@bisham/payment-package","version":"0.0.3","description":"An Easy Plug and Play Typed Package For Implementing Popular Nepalese Payment Provider into any App.","main":"dist/index.js","types":"dist/index.ts","author":{"name":"Bisham Kunwor","email":"novelian.nova@gmail.com","url":"https://bishamkunwor.com.np"},"scripts":{"dev":"nodemon lib/index.ts","build":"tsc"},"keywords":["esewa","khalti","connectips"],"license":"MIT","devDependencies":{"@types/node":"^20.4.9","nodemon":"^3.0.1","ts-node":"^10.9.1","typescript":"^5.1.6"},"dependencies":{"axios":"^1.4.0"},"engines":{"node":">=16.0.0","npm":">=8.0.0","yarn":"Please Use Npm.","pnpm":"Please Use Npm."},"gitHead":"0a2e6a615a7d935a5153a8c84a8828e20bcf9363","_id":"@bisham/payment-package@0.0.3","_nodeVersion":"18.16.1","_npmVersion":"9.7.2","dist":{"integrity":"sha512-AWzZYmoAo72fSwOjqO2FqrjM6Mi7CeJuKIkKgOpVphm5MHJY+W1mj0NdRbDwPAVz/YqmZ8N4GeHMj9hYwZdLQg==","shasum":"49639f3bf09ce9139e09c1df56cf6406cbb4348d","tarball":"https://registry.npmjs.org/@bisham/payment-package/-/payment-package-0.0.3.tgz","fileCount":8,"unpackedSize":11699,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH+Sy/EU7LZNhTKNlXMP34wyxNZ9NZVUq0uCfUj07UJCAiBpEpO2ak33Ehrj7kz6GVYj/oTuI9lLTH0RlwoyU8l9Sw=="}]},"_npmUser":{"name":"bishamkunwor","email":"novelian.nova@gmail.com"},"directories":{},"maintainers":[{"name":"bishamkunwor","email":"novelian.nova@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/payment-package_0.0.3_1691856179737_0.8808906001001484"},"_hasShrinkwrap":false},"0.0.4":{"name":"@bisham/payment-package","version":"0.0.4","description":"An Easy Plug and Play Typed Package For Implementing Popular Nepalese Payment Provider into any App.","main":"dist/index.js","types":"dist/index.ts","author":{"name":"Bisham Kunwor","email":"novelian.nova@gmail.com","url":"https://bishamkunwor.com.np"},"scripts":{"dev":"concurrently \"tsc --watch\" \"nodemon dist/index.js\"","build":"tsc"},"keywords":["esewa","khalti","connectips"],"license":"MIT","devDependencies":{"@types/node":"^20.4.9","concurrently":"^8.2.0","nodemon":"^3.0.1","ts-node":"^10.9.1","typescript":"^5.1.6"},"dependencies":{"axios":"^1.4.0"},"engines":{"node":">=16.0.0","npm":">=8.0.0","yarn":"Please Use Npm.","pnpm":"Please Use Npm."},"gitHead":"7e9f1c3355d846e0ce04ffa4768932a216173090","_id":"@bisham/payment-package@0.0.4","_nodeVersion":"14.21.3","_npmVersion":"6.14.18","dist":{"integrity":"sha512-LC0GhBFCXDdb6GXDbEVEP2mqOC+h9lWD5yE2psi+IjBiqLlWEXw+aMaTHrC00AyTprJMv/yndqcuod4qm6908Q==","shasum":"5441dca52efb2b882dc1e456335d7e9f7477c6b4","tarball":"https://registry.npmjs.org/@bisham/payment-package/-/payment-package-0.0.4.tgz","fileCount":10,"unpackedSize":19459,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkqHvllYrnh38q020y28zTppT3sIFvZ8kc6JhZ+Fu16QIgJ4LsnchUunO0y3IWKCn5GdtBHO+vmbcPLdCHQ3ryfzo="}]},"_npmUser":{"name":"bishamkunwor","email":"novelian.nova@gmail.com"},"directories":{},"maintainers":[{"name":"bishamkunwor","email":"novelian.nova@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/payment-package_0.0.4_1692086591932_0.302990019608667"},"_hasShrinkwrap":false},"0.1.0":{"name":"@bisham/payment-package","version":"0.1.0","description":"An Easy Plug and Play Typed Package For Implementing Popular Nepalese Payment Provider into any App.","main":"dist/index.js","types":"dist/index.ts","author":{"name":"Bisham Kunwor","email":"novelian.nova@gmail.com","url":"https://bishamkunwor.com.np"},"scripts":{"dev":"concurrently \"tsc --watch\" \"nodemon dist/index.js\"","build":"tsc"},"keywords":["esewa","khalti","connectips"],"license":"MIT","devDependencies":{"@types/node":"^20.4.9","concurrently":"^8.2.0","nodemon":"^3.0.1","ts-node":"^10.9.1","typescript":"^5.1.6"},"dependencies":{"axios":"^1.4.0"},"engines":{"node":">=16.0.0","npm":">=8.0.0","yarn":"Please Use Npm.","pnpm":"Please Use Npm."},"_id":"@bisham/payment-package@0.1.0","gitHead":"3b89d3291bf7e8cd878e2435be72285a98d538d7","_nodeVersion":"18.16.1","_npmVersion":"9.8.0","dist":{"integrity":"sha512-8BU9CL+vbVHFES09IrNzs34KRvV81bkKNlVjwzC00jX8UzImXE2EfHHlUcu1ZgIVtjVokQRydEHyRZH5X727sg==","shasum":"4c94934a0738349c3529e196967dad3184b216ce","tarball":"https://registry.npmjs.org/@bisham/payment-package/-/payment-package-0.1.0.tgz","fileCount":10,"unpackedSize":26863,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID7gSxwOSZggsBIebK59NmF0OSHK2D2NIzDx3JNU75zFAiEAkFpefIv5COnRDP9OEjtZdUMEGJkxMom13E9X1fVzkXc="}]},"_npmUser":{"name":"bishamkunwor","email":"novelian.nova@gmail.com"},"directories":{},"maintainers":[{"name":"bishamkunwor","email":"novelian.nova@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/payment-package_0.1.0_1692185132422_0.846048237654337"},"_hasShrinkwrap":false},"1.0.0":{"name":"@bisham/payment-package","version":"1.0.0","description":"An Easy Plug and Play Typed Package For Implementing Popular Nepalese Payment Provider into any App.","main":"dist/index.js","types":"dist/index.ts","author":{"name":"Bisham Kunwor","email":"novelian.nova@gmail.com","url":"https://bishamkunwor.com.np"},"scripts":{"dev":"concurrently \"tsc --watch\" \"nodemon dist/index.js\"","build":"tsc"},"keywords":["esewa","khalti"],"repository":{"type":"git","url":"git+https://github.com/BishamKunwor/payment-package.git"},"bugs":{"url":"https://github.com/BishamKunwor/payment-package/issues"},"license":"MIT","devDependencies":{"@types/node":"^20.4.9","concurrently":"^8.2.0","nodemon":"^3.0.1","prettier":"^3.0.3","ts-node":"^10.9.1","typescript":"^5.1.6"},"engines":{"node":">=18.0.0","npm":">=9.0.0","yarn":"Please Use Npm.","pnpm":"Please Use Npm."},"gitHead":"c8b69478cbed57a0a9dbfccc6fd379c09129c397","homepage":"https://github.com/BishamKunwor/payment-package#readme","_id":"@bisham/payment-package@1.0.0","_nodeVersion":"18.16.1","_npmVersion":"9.7.2","dist":{"integrity":"sha512-Ie7lOw0mjXCk3ZU63kIxxgTR0K/rcSluhMnmiUMcShCsQCvj1IN8YUM1JBuqnJGAH6h97nAE26as1g08NZ6RLQ==","shasum":"721945f6bbe85d25d8c5c23de90e4e4eba5cf692","tarball":"https://registry.npmjs.org/@bisham/payment-package/-/payment-package-1.0.0.tgz","fileCount":10,"unpackedSize":36301,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICaZax9f+3PD/koVXdB0PCXLVEeV3o/94c/HyqwuD143AiEAzeZ+OZgkX+1PwBBuBrbIZ1dG7Y+FfsSq2gG5EOCBTkw="}]},"_npmUser":{"name":"bishamkunwor","email":"novelian.nova@gmail.com"},"directories":{},"maintainers":[{"name":"bishamkunwor","email":"novelian.nova@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/payment-package_1.0.0_1694190543070_0.6650145805733396"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-11T19:09:41.957Z","0.0.0":"2023-08-11T19:09:42.237Z","modified":"2023-09-08T16:29:03.701Z","0.0.1":"2023-08-12T08:07:28.577Z","0.0.2":"2023-08-12T10:10:23.085Z","0.0.3":"2023-08-12T16:02:59.943Z","0.0.4":"2023-08-15T08:03:12.126Z","0.1.0":"2023-08-16T11:25:32.582Z","1.0.0":"2023-09-08T16:29:03.467Z"},"maintainers":[{"name":"bishamkunwor","email":"novelian.nova@gmail.com"}],"description":"An Easy Plug and Play Typed Package For Implementing Popular Nepalese Payment Provider into any App.","keywords":["esewa","khalti"],"author":{"name":"Bisham Kunwor","email":"novelian.nova@gmail.com","url":"https://bishamkunwor.com.np"},"license":"MIT","readme":"# Payment Package Docs\n\n**Note: From V1.0.0, this Package can only be Used with `node version` ≥ `18.x.x`**\n\n[View Documentation](https://www.notion.so/Payment-Package-Docs-5130308e4c2a4e84af7bc6047c7c04de?pvs=21)\n\n## Esewa\n\n### **Documentation**\n\n**Importing Esewa Payment Method**\n\nImport by using `import` or `require`.\n\n```tsx\nimport { EsewaPayment } from '@bisham/payment-package';\n```\n\n**Initialization With Default Values**\n\n```tsx\n// Initializes Esewa with default credentials\n\n// Default Options\n\n// runtimeMode = \"Development\"\n// merchantId = \"EPAYTEST\"\n// successRedirectUrl = \"https://example.com/esewaSuccessRedirect\"\n// failureRedirectUrl = \"https://example.com/esewaFailureRedirect\"\n// logConfig = false\n\nconst esewaPayment = new EsewaPayment();\n```\n\n**Make Payment With Initial Config**\n\n```\n// Payment Initiation Can Only Be Done in Browser Environment\nesewaPayment.initiate({\n      amount: 10, // Amount in Rs\n\t\t\t// Add A unique process-id\n      processId: 'Unique-id-for-each-transaction',\n      totalAmount: 10\n    })\n```\n\n> **Esewa Credentials (Development Mode Only)**\n>\n> `eSewa ID` : 9806800001, 9806800002, 9806800003, 9806800004, 9806800005\n>\n> `Password` : Nepal@123\n>\n> `Transaction Token`: 123456\n\n**Verifying Payment**\n\n```tsx\n// Validation Only Works on Server Side due To CORS\nasync function validatePayment() {\n  const response = await esewaPayment.verifyPayment({\n    amount: 10,\n    // processId is oid recieved from eSewa\n    processId: 'Unique-id-for-each-transaction',\n    referenceId: '00063JQ',\n  });\n  // Implement Your Logic Here\n  console.log(response?.success);\n}\n\nvalidatePayment();\n```\n\n### **Full Configuration Override Guide**\n\n**You Can Also Manually Override these Settings as:**\n\n```tsx\n// Only merchantId changes and all Other Options are set to Default\n\n// Default Options\n\n// runtimeMode = \"Development\"\n// successRedirectUrl = \"https://example.com/esewaSuccessRedirect\"\n// failureRedirectUrl = \"https://example.com/esewaFailureRedirect\"\n// logConfig = false\n\n// merchantId = \"ESEWASCD\"\n\nconst esewaPayment = new EsewaPayment({\n  merchantId: 'ESEWASCD',\n});\n```\n\n**Initialization With Global Redirect URLs**\n\n```tsx\n// If the App have single Redirect Url then set it Here\n\nconst esewaPayment = new EsewaPayment({\n  successRedirectUrl: 'http://bishamkunwor.com.np/payment/success',\n  failureRedirectUrl: 'http://bishamkunwor.com.np/payment/failure',\n});\n```\n\n**Config with custom parameters**\n\n```tsx\nconst eswaPayment = new EsewaPayment({\n  runtimeMode: 'Production',\n  merchantId: 'MERCHANTSCD',\n  successRedirectUrl: 'http://merchant.com.np/page/esewa_payment_success?q=su',\n  failureRedirectUrl: 'http://merchant.com.np/page/esewa_payment_failed?q=fu',\n  logConfig: true,\n});\n```\n\nKhalti Will redirect user to the `successRedirectUrl` if the payment was successful. Else it will redirect to `failureRedirectUrl`.\n\n### **For making Payment Request:**\n\n```tsx\n// Payment Initiation Can Only Be Done in Browser Environment\nesewaPayment.initiate({\n  amount: 40, // Amount in Rs\n  // Add A unique process-id\n  processId: 'Unique-id-for-each-transaction',\n  deliveryCharge: 20,\n  serviceCharge: 20,\n  taxAmount: 20,\n  // totalAmount = amount + deliveryCharge+ serviceCharge+ taxAmount\n  totalAmount: 100,\n  // Set Dynamic Url for each payment request, If your success and failure\n  // redirect url is static then set it in the global config and ommit this\n  // this field\n  successRedirectUrl:\n    'http://some-dynamic-url-that-changes-on-every-transaction.com',\n  failureRedirectUrl:\n    'http://some-dynamic-url-that-changes-on-every-transaction.com',\n});\n```\n\n**Verifying Payment**\n\n```tsx\n// Validation Only Works on Server Side due To CORS\nasync function validatePayment() {\n  const response = await esewaPayment.verifyPayment({\n    amount: 200,\n    processId: 'pid-provided-by-esewa',\n    referenceId: 'rid-provided-by-esewa',\n  });\n  // Implement Your Logic Here\n  console.log(response?.success);\n}\n\nvalidatePayment();\n```\n\n## Khalti\n\n### **Documentation**\n\n**Importing Khalti Payment Method**\n\nImport by using `import` or `require`.\n\n```tsx\nimport { KhaltiPayment } from '@bisham/payment-package';\n```\n\n**Initialization With Default Values**\n\n```tsx\n// Initializes Khalti with default credentials\n\n// Default Options\n\n// runtimeMode = \"Development\"\n// khaltiSecretKey = \"live_secret_key_c29bff9015674b939338370b7ea9f7f2\"\n// websiteUrl = \"https://example.com\"\n// redirectUrl = \"https://example.com/redirectUrl\"\n// logConfig = false\n\nconst khaltiPayment = new KhaltiPayment();\n```\n\n**Make Payment With Initial Config**\n\n```\n// Payment Initiation Can Only Be Done in Node Environment due to `CORS error`\n// Send the response recieved on calling this method on Server Side to the Cilent\n// Application\n\nasync function getKhaltiPaymentUrl () {\n  const response = await khaltiPayment.getPidx({\n    amount: 1000,\n    purchase_order_id: 'unique-process-id',\n    purchase_order_name: 'your-product-name'\n  })\n\n  // Your Logic Here\n\n  console.log(response)\n}\n\ngetKhaltiPaymentUrl()\n\n// Response Example\n// {\n//  pidx: '7dQBsUCxfEtNcsrWMQbxrJ',\n//  payment_url: 'https://test-pay.khalti.com/?pidx=7dQBsUCxfEtNcsrWMQbxrJ',\n//  expires_at: '2023-09-08T21:14:57.545837+05:45',\n//  expires_in: 1800\n// }\n\n// Redirect The User to the payment_url to initiate khalti Payment\n```\n\n> **Khalti Credentials (Development Mode Only)**\n>\n> `Khalti ID` : 9800000000, 9800000001, 9800000002, 9800000003, 9800000004, 9800000005\n>\n> `MPIN` : 1111\n>\n> `Transaction OTP`: 987654\n\n**Verifying Payment**\n\n```tsx\n// Validation Only Works on Server Side due To CORS\nasync function validatePayment() {\n  // Enter PIDX recieved From Khalti\n  const response = await khaltiPayment.verifyPayment('7dQBsUCxfEtNcsrWMQbxrJ');\n  // Implement Your Logic Here\n  console.log(response);\n}\n\nvalidatePayment();\n\n// Response Example\n// {\n//  pidx: '7dQBsUCxfEtNcsrWMQbxrJ',\n//  total_amount: 1000,\n//  status: 'Completed',\n//  transaction_id: 'CsovwPVkSXzvevQdEwSytE',\n//  fee: 30,\n// refunded: false\n// }\n```\n\n### **Full Configuration Override Guide**\n\n**You Can Also Manually Override these Settings as:**\n\n```tsx\n// Only khaltiSecretKey changes and all Other Options are set to Default\n\n// Default Options\n\n// runtimeMode = \"Development\"\n// khaltiSecretKey = \"live-secret-key-provided-by-khalti\"\n// websiteUrl = \"https://example.com\"\n// redirectUrl = \"https://example.com/redirectUrl\"\n// logConfig = false\n\nconst khaltiPayment = new KhaltiPayment({\n  khaltiSecretKey: 'live-secret-key-provided-by-khalti',\n});\n```\n\n**Initialization With Global Redirect URL**\n\n```tsx\n// If the App have single Redirect Url then set it Here\n\nconst khaltiPayment = new KhaltiPayment({\n  websiteUrl: 'http://bishamkunwor.com.np',\n  redirectUrl: 'http://bishamkunwor.com.np/payment/validate',\n});\n```\n\n**Config with custom parameters**\n\n```tsx\nconst khaltiPayment = new KhaltiPayment({\n  runtimeMode: 'Production',\n  khaltiSecretKey: 'live-secret-key-provided-by-khalti',\n  websiteUrl: 'https://bishamkunwor.com.np',\n  redirectUrl: 'https://bishamkunwor.com.np/payment/validate',\n  logConfig: true,\n});\n```\n\nKhalti Will redirect user to the `redirectUrl` if the payment was successful.\n\n### **For making Payment Request:**\n\n```tsx\n// Only amount, purchase_order_id, purchase_order_name are Required\n// and all other fields are optional\n\nasync function getKhaltiPaymentUrl() {\n  const response = await khaltiPayment.getPidx({\n    amount: 1000, // Amount in Paisa\n    purchase_order_id: 'unique-process-id',\n    purchase_order_name: 'your-product-name',\n    redirectUrl: 'dynamic-webiste-url-for-every-payment',\n    websiteUrl: 'website-url-best-to-set-it-in-global-config',\n    amount_breakdown: [\n      {\n        label: 'Mark Price',\n        amount: 1000,\n      },\n      {\n        label: 'VAT',\n        amount: 300,\n      },\n    ],\n    customer_info: {\n      name: 'Bisham Kunwor',\n      email: 'novelian.nova@gmail.com',\n      phone: '9800000000',\n    },\n    product_details: [\n      {\n        identity: '1234567890',\n        name: 'React Course',\n        total_price: 1300,\n        quantity: 1,\n        unit_price: 1300,\n      },\n    ],\n  });\n\n  // Your Logic Here\n\n  console.log(response);\n}\n\n// Response Example\n// {\n//  pidx: '7dQBsUCxfEtNcsrWMQbxrJ',\n//  payment_url: 'https://test-pay.khalti.com/?pidx=7dQBsUCxfEtNcsrWMQbxrJ',\n//  expires_at: '2023-09-08T21:14:57.545837+05:45',\n//  expires_in: 1800\n// }\n\n// Redirect The User to the payment_url to initiate khalti Payment\n```\n\n**Verifying Payment**\n\n```tsx\n// Validation Only Works on Server Side due To CORS\nasync function validateKhaltiPayment() {\n  // Enter PIDX recieved From Khalti\n  const response = await khaltiPayment.verifyPayment('7dQBsUCxfEtNcsrWMQbxrJ');\n  // Implement Your Logic Here\n  console.log(response);\n}\n\nvalidateKhaltiPayment();\n\n// Response Example\n// {\n//  pidx: '7dQBsUCxfEtNcsrWMQbxrJ',\n//  total_amount: 1000,\n//  status: 'Completed',\n//  transaction_id: 'CsovwPVkSXzvevQdEwSytE',\n//  fee: 30,\n// refunded: false\n// }\n```\n","readmeFilename":"README.md","homepage":"https://github.com/BishamKunwor/payment-package#readme","repository":{"type":"git","url":"git+https://github.com/BishamKunwor/payment-package.git"},"bugs":{"url":"https://github.com/BishamKunwor/payment-package/issues"}}