{"_id":"@allecosystems/epay","_rev":"2-dd590a3c654b992e4ad907d048ba385c","name":"@allecosystems/epay","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@allecosystems/epay","version":"0.1.0","license":"GPL-3.0-or-later","_id":"@allecosystems/epay@0.1.0","maintainers":[{"name":"alleco","email":"teknik@alleco.dk"}],"dist":{"shasum":"6f9b5e0cb0a9e34a85ebbb9d024ef0848cc4c5b5","tarball":"https://registry.npmjs.org/@allecosystems/epay/-/epay-0.1.0.tgz","fileCount":25,"integrity":"sha512-BuJj42DWOWvd2jjEVG/cr52GA2x1RaAt9/3QxBBLZT1YutdLwaR7N2/B2BMajYNv4EM5M0YQBZ8FBULIRvAcIw==","signatures":[{"sig":"MEUCIQCeKJawnMziYlyrnHrgkTedPWP6a1siIW3cHPscF+g6TwIgM0poolA0ko0efRWRJFPHcTx7wVx4aHsOWF6VUT4YU/o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":49184},"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"dev":"ts-node dev-server/index.ts","e2e":"cross-env PACKAGE=example-plugin vitest -c ../../utils/e2e/vitest.config.mts","build":"rimraf dist && tsc -p ./tsconfig.build.json && ts-node copy-ui-src.ts","codegen":"ts-node generate-types.ts"},"_npmUser":{"name":"alleco","email":"teknik@alleco.dk"},"_npmVersion":"10.9.2","description":"Epay payment gateway for Vendure","directories":{},"_nodeVersion":"22.14.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/epay_0.1.0_1756383392763_0.33242885930422994","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@allecosystems/epay","description":"Epay payment gateway for Vendure","version":"0.1.1","license":"GPL-3.0-or-later","publishConfig":{"access":"public"},"main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"dev":"ts-node dev-server/index.ts","codegen":"ts-node generate-types.ts","build":"rimraf dist && tsc -p ./tsconfig.build.json && ts-node copy-ui-src.ts","e2e":"cross-env PACKAGE=example-plugin vitest -c ../../utils/e2e/vitest.config.mts"},"dependencies":{},"_id":"@allecosystems/epay@0.1.1","gitHead":"af52bd2fb28c41ec844dde13f95584d18b3a9444","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-L0z+m/XX4itvqlgyM6UT9unFHIOFj81b1N//g6juJ1/BpgsBqEYV6LNEPKasekRbv9xrsVh4N9OvtfuBoqaP5A==","shasum":"d9a03e0ef8aaf07b149a3636353848b1466581fe","tarball":"https://registry.npmjs.org/@allecosystems/epay/-/epay-0.1.1.tgz","fileCount":25,"unpackedSize":50723,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDS1kc5o94YSgwQLDzmSUajBXA2KQP0IOEeBDc0w0vA6QIgBx+KonnSBSIzmwGgcn5//pAzaZdQky7qWlj/ZbD3+zw="}]},"_npmUser":{"name":"alleco","email":"teknik@alleco.dk"},"directories":{},"maintainers":[{"name":"alleco","email":"teknik@alleco.dk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/epay_0.1.1_1756385278298_0.7028302968907316"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-28T12:16:32.610Z","modified":"2025-08-28T12:47:58.707Z","0.1.0":"2025-08-28T12:16:32.920Z","0.1.1":"2025-08-28T12:47:58.505Z"},"license":"GPL-3.0-or-later","description":"Epay payment gateway for Vendure","maintainers":[{"name":"alleco","email":"teknik@alleco.dk"}],"readme":"# ePay Payment Plugin for Vendure\n\nA Vendure plugin that integrates ePay payment gateway for processing online payments.\n\n## Features\n\n- Process payments through ePay gateway\n- Store payment transaction details\n- Handle payment webhooks\n\n## Installation\n\n```bash\nnpm install @allecosystems/epay\n```\n\n## Usage\n\nAdd the plugin to your Vendure configuration:\n\n```typescript\nimport { EpayPlugin } from '@allecosystems/epay';\n\nexport const config: VendureConfig = {\n  // ... other config\n  plugins: [\n    EpayPlugin.init({\n      // Plugin options here\n    }),\n  ],\n};\n```\n\n## Configuration\n\nThe plugin accepts the following configuration options:\n\n- `apiKey`: Your ePay API key\n- `Point of sale ID`: Your ePay Point of sale ID\n- `PAI URL`: Keep it at the default https://payments.epay.eu/public/api/v1/cit\n- `Webhook URL`: Must be your `VENDURE_URL/epay/webhook`\n- `Success URL`: The order success page of your storefront\n- `Failure URL`: The order failure page of your storefront\n\n\n## Frontend Integration\n\nWhen a payment is initiated with the ePay payment method, the plugin returns a redirect URL. Your frontend must redirect the customer to this URL to complete the payment.\n\nAfter calling `addPaymentToOrder`, check the returned order's last payment for redirect information:\n\n```typescript\n// Get the last payment from the order\nconst payments = order?.payments || [];\nconst lastPayment = payments[payments.length - 1];\n\n// Check if payment requires redirect\nif (lastPayment?.metadata?.public?.requiresRedirect) {\n  const redirectUrl = lastPayment.metadata.public.redirectUrl;\n  \n  if (redirectUrl) {\n    // Redirect customer to ePay payment page\n    window.location.href = redirectUrl;\n  }\n}\n```\n\n### Payment Object Structure\n\nThe payment metadata contains:\n- `lastPayment.metadata.public.requiresRedirect` - Boolean indicating if redirect is needed\n- `lastPayment.metadata.public.redirectUrl` - The ePay payment URL to redirect to\n\n### Payment Flow\n\n1. Customer initiates payment with `addPaymentToOrder` using method `'epay-payment'`\n2. Plugin creates ePay session and returns redirect URL in payment metadata\n3. Frontend redirects customer to ePay payment page\n4. Customer completes payment on ePay's secure page\n5. ePay redirects customer back to your configured success/failure URLs\n6. ePay sends webhook to confirm payment status\n\n## License\n\nGPL-3.0-or-later\n\n## Support\n\nFor any support inquiries please contact Alleco Systems at support@alleco.dk","readmeFilename":"README.md"}