{"_id":"@damuel90/nestjs-redsys","_rev":"3-93fa5b5d9e2cea899a2483ecf20a19c0","name":"@damuel90/nestjs-redsys","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@damuel90/nestjs-redsys","version":"1.0.0","keywords":["nestjs","redsys","payment","gateway","santander","bbva","banking"],"author":{"name":"Damuel Querales","email":"damuel90@gmail.com"},"license":"MIT","_id":"@damuel90/nestjs-redsys@1.0.0","maintainers":[{"name":"damuel90","email":"damuel90@gmail.com"}],"homepage":"https://github.com/damuel90/nestjs-redsys","bugs":{"url":"https://github.com/damuel90/nestjs-redsys/issues"},"dist":{"shasum":"7a9c79b54ca8810c0ba6c4da547088ab7e1bbae0","tarball":"https://registry.npmjs.org/@damuel90/nestjs-redsys/-/nestjs-redsys-1.0.0.tgz","fileCount":20,"integrity":"sha512-EL1S/gC04t7fW5ZqcJ4i2PxoDyzWr7tg7RiDRXaq+DwC1JgKVZ173ooy8OjT4Wb/jycCbdNBAEkQRQmxWC+mLA==","signatures":[{"sig":"MEYCIQCxlVLCwwICdVdNJVh+0yjm1tRqVS96GwcuiLzHKHHEfQIhAIVOuCD2qnTmN/SlBKMK/ZVnrsueVlzuBaLx2WaoQQ2x","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":128646},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"c9571b6d6d4edcf8420c1bb55b94c388c16b6136","scripts":{"dev":"tsc -w","test":"echo \"No tests yet\" && exit 0","build":"tsc -p tsconfig.build.json","version:major":"npm version major","version:minor":"npm version minor","version:patch":"npm version patch","prepublishOnly":"npm run build"},"_npmUser":{"name":"damuel90","email":"damuel90@gmail.com"},"repository":{"url":"git+https://github.com/damuel90/nestjs-redsys.git","type":"git"},"_npmVersion":"8.19.2","description":"NestJS module for Redsys payment gateway integration with multiple bank support","directories":{},"_nodeVersion":"16.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rxjs":"^7.8.0","axios":"^1.5.0","typescript":"^5.0.0","@types/node":"^20.0.0","@nestjs/core":"^10.0.0","@nestjs/common":"^10.0.0"},"peerDependencies":{"axios":"^1.0.0","crypto":"^1.0.1","@nestjs/core":"^9.0.0 || ^10.0.0","@nestjs/common":"^9.0.0 || ^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-redsys_1.0.0_1763476627250_0.37883638512253004","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@damuel90/nestjs-redsys","version":"1.0.1","keywords":["nestjs","redsys","payment","gateway","santander","bbva","banking"],"author":{"name":"Damuel Querales","email":"damuel90@gmail.com"},"license":"MIT","_id":"@damuel90/nestjs-redsys@1.0.1","maintainers":[{"name":"damuel90","email":"damuel90@gmail.com"}],"homepage":"https://github.com/damuel90/nestjs-redsys","bugs":{"url":"https://github.com/damuel90/nestjs-redsys/issues"},"dist":{"shasum":"5074994c4a7bbf44f4245d2d631798f87cf8354a","tarball":"https://registry.npmjs.org/@damuel90/nestjs-redsys/-/nestjs-redsys-1.0.1.tgz","fileCount":20,"integrity":"sha512-vJTeVMkU8Z6lchlMSKqNOxvZwZMTq7r9gvy3BdVULJ3GJEZUvb+ZPbJoQxGHv/VKfjpdDAfgUDdQfIblAffw+w==","signatures":[{"sig":"MEQCIEuTS4TjTTzrRX8Grj42FnMWMSxLCjO0JsxLBdNg008nAiBbrlvEaKfc9pCKAtbrqqQWE8USk4vPWR3BKpDopv7cYw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":128721},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"3db64d33aa4122659049c746f24756c95c5d0d81","scripts":{"dev":"tsc -w","test":"echo \"No tests yet\" && exit 0","build":"tsc -p tsconfig.build.json","version:major":"npm version major","version:minor":"npm version minor","version:patch":"npm version patch","prepublishOnly":"npm run build"},"_npmUser":{"name":"damuel90","email":"damuel90@gmail.com"},"repository":{"url":"git+https://github.com/damuel90/nestjs-redsys.git","type":"git"},"_npmVersion":"11.6.2","description":"NestJS module for Redsys payment gateway integration with multiple bank support","directories":{},"_nodeVersion":"20.17.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rxjs":"^7.8.0","axios":"^1.5.0","typescript":"^5.0.0","@types/node":"^20.0.0","@nestjs/core":"^10.0.0","@nestjs/common":"^10.0.0"},"peerDependencies":{"axios":"^1.0.0","crypto":"^1.0.1","@nestjs/core":"^9.0.0 || ^10.0.0","@nestjs/common":"^9.0.0 || ^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/nestjs-redsys_1.0.1_1763511031576_0.6130697777973584","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@damuel90/nestjs-redsys","version":"1.0.2","description":"NestJS module for Redsys payment gateway integration with multiple bank support","keywords":["nestjs","redsys","payment","gateway","santander","bbva","banking"],"author":{"name":"Damuel Querales","email":"damuel90@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/damuel90/nestjs-redsys.git"},"homepage":"https://github.com/damuel90/nestjs-redsys","bugs":{"url":"https://github.com/damuel90/nestjs-redsys/issues"},"main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.build.json","prepublishOnly":"npm run build","test":"echo \"No tests yet\" && exit 0","dev":"tsc -w","version:patch":"npm version patch","version:minor":"npm version minor","version:major":"npm version major"},"peerDependencies":{"@nestjs/common":"^9.0.0 || ^10.0.0","@nestjs/core":"^9.0.0 || ^10.0.0","axios":"^1.0.0","crypto":"^1.0.1"},"devDependencies":{"@nestjs/common":"^10.0.0","@nestjs/core":"^10.0.0","@types/node":"^20.0.0","typescript":"^5.0.0","rxjs":"^7.8.0","axios":"^1.5.0"},"engines":{"node":">=16.0.0"},"publishConfig":{"access":"public"},"gitHead":"f12629f8ad3c1996c2e9f88eb3ead136f6c7c474","_id":"@damuel90/nestjs-redsys@1.0.2","_nodeVersion":"20.17.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-RYX8a4x8cq4FDw763sz/uxkGdh5jxq19aqhmaDaBp6iVfWijdrv+VT1UVXlRn03dp3z4NRl+Pl0iqkUoc87ryA==","shasum":"c5525297b86051acc3f28a3c61a414883020c6ad","tarball":"https://registry.npmjs.org/@damuel90/nestjs-redsys/-/nestjs-redsys-1.0.2.tgz","fileCount":20,"unpackedSize":129525,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCTuehDwc42+23reOKLZhlG+oywNmUF8ASKFaBT5XYPdQIhALPnRsr4nNz+KSRACD/bnr4UOsiJh5W9O7C/lz+KuQ8c"}]},"_npmUser":{"name":"damuel90","email":"damuel90@gmail.com"},"directories":{},"maintainers":[{"name":"damuel90","email":"damuel90@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nestjs-redsys_1.0.2_1763514797790_0.6859318144223501"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-18T14:37:07.179Z","modified":"2025-11-19T01:13:18.206Z","1.0.0":"2025-11-18T14:37:07.441Z","1.0.1":"2025-11-19T00:10:31.848Z","1.0.2":"2025-11-19T01:13:18.024Z"},"bugs":{"url":"https://github.com/damuel90/nestjs-redsys/issues"},"author":{"name":"Damuel Querales","email":"damuel90@gmail.com"},"license":"MIT","homepage":"https://github.com/damuel90/nestjs-redsys","keywords":["nestjs","redsys","payment","gateway","santander","bbva","banking"],"repository":{"type":"git","url":"git+https://github.com/damuel90/nestjs-redsys.git"},"description":"NestJS module for Redsys payment gateway integration with multiple bank support","maintainers":[{"name":"damuel90","email":"damuel90@gmail.com"}],"readme":"# NestJS Redsys\n\nA NestJS module for integration with the Redsys payment gateway with support for multiple banks (Santander, BBVA, etc.).\n\n## Features\n\n* ✅ Support for multiple banks simultaneously\n* ✅ Synchronous and asynchronous configuration\n* ✅ Complete TypeScript typing\n* ✅ Environment variables support\n* ✅ Optional global module\n* ✅ Easy dependency injection\n* ✅ Signature validation\n* ✅ Support for multiple currencies\n\n## Installation\n\n```\nnpm install @damuel90/nestjs-redsys\n```\n\n## Quick Setup\n\n### 1. Basic Configuration (Synchronous)\n```\nimport { Module } from '@nestjs/common';\nimport { RedsysModule } from '@damuel90/nestjs-redsys';\n\n@Module({\n  imports: [\n    RedsysModule.forRoot({\n      isGlobal: true,\n      configs: [\n        {\n          configKey: 'santander',\n          secretKey: 'Mk9m98IfEblmPfrpsawt7BmxObt98Jev',\n          webhookUrl: 'https://midominio.com/santander/webhook-listener',\n          merchantCode: '999008881',\n          terminal: '1',\n          redsysUrl: 'https://sis-t.redsys.es:25443/sis/rest/trataPeticionREST',\n          bankName: 'Santander',\n        },\n        {\n          configKey: 'bbva',\n          secretKey: 'sq7HjrUOBfKmC576ILgskD5srU870gJ7',\n          webhookUrl: 'https://midominio.com/bbva/webhook-listener',\n          merchantCode: '999008882',\n          terminal: '1',\n          redsysUrl: 'https://sis-t.redsys.es:25443/sis/rest/trataPeticionREST',\n          bankName: 'BBVA',\n        },\n      ],\n    }),\n  ],\n})\nexport class AppModule {}\n```\n### 2. Environment Variables Configuration (Recommended)\n```\nimport { Module } from '@nestjs/common';\nimport { ConfigModule, ConfigService } from '@nestjs/config';\nimport { RedsysModule } from '@damuel90/nestjs-redsys';\n\n@Module({\n  imports: [\n    ConfigModule.forRoot(),\n    RedsysModule.forRootAsync({\n      imports: [ConfigModule],\n      configs: [\n        {\n          configKey: 'santander',\n          useFactory: (configService: ConfigService) => ({\n            secretKey: configService.get('SANTANDER_SECRET_KEY'),\n            webhookUrl: `${configService.get('BASE_URL')}/santander/webhook-listener,\n            merchantCode: configService.get('SANTANDER_MERCHANT_CODE'),\n            terminal: configService.get('SANTANDER_TERMINAL'),\n            redsysUrl: configService.get('SANTANDER_REDSYS_URL'),\n            bankName: 'Santander',\n          }),\n          inject: [ConfigService],\n        },\n        {\n          configKey: 'bbva',\n          useFactory: (configService: ConfigService) => ({\n            secretKey: configService.get('BBVA_SECRET_KEY'),\n            webhookUrl: `${configService.get('BASE_URL')}/bbva/webhook-listener,\n            merchantCode: configService.get('BBVA_MERCHANT_CODE'),\n            terminal: configService.get('BBVA_TERMINAL'),\n            redsysUrl: configService.get('BBVA_REDSYS_URL'),\n            bankName: 'BBVA',\n          }),\n          inject: [ConfigService],\n        },\n      ],\n    }),\n  ],\n})\nexport class AppModule {}\n```\n\n### 3. Required Environment Variables\n```\n# URL base de tu aplicación\nBASE_URL=https://midominio.com\n\n# Configuración Santander\nSANTANDER_SECRET_KEY=Mk9m98IfEblmPfrpsawt7BmxObt98Jev\nSANTANDER_MERCHANT_CODE=999008881\nSANTANDER_TERMINAL=1\nSANTANDER_REDSYS_URL=https://sis-t.redsys.es:25443/sis/rest/trataPeticionREST\n\n# Configuración BBVA\nBBVA_SECRET_KEY=sq7HjrUOBfKmC576ILgskD5srU870gJ7\nBBVA_MERCHANT_CODE=999008882\nBBVA_TERMINAL=1\nBBVA_REDSYS_URL=https://sis-t.redsys.es:25443/sis/rest/trataPeticionREST\n```\n\n## Usage in Services\n\n### 1. Usage with Specific Decorator (Recommended)\n```\nimport { Injectable } from '@nestjs/common';\nimport { InjectRedsysService, RedsysService, RedsysPaymentLinkBody } from '@damuel90/nestjs-redsys';\n\n@Injectable()\nexport class PaymentService {\n  constructor(\n    @InjectRedsysService('santander') \n    private readonly santanderService: RedsysService,\n    \n    @InjectRedsysService('bbva') \n    private readonly bbvaService: RedsysService,\n  ) {}\n\n  async createSantanderPayment(amount: number, customerEmail: string) {\n    const paymentBody: RedsysPaymentLinkBody = {\n      amount: amount,\n      currencyCode: 'EUR',\n      customerFullName: 'Juan Pérez',\n      title: 'Pago de servicio',\n      customerEmail: customerEmail,\n    };\n\n    return this.santanderService.createPaymentLink(paymentBody);\n  }\n\n  async createBbvaPayment(amount: number, customerEmail: string) {\n    const paymentBody: RedsysPaymentLinkBody = {\n      amount: amount,\n      currencyCode: 'EUR', \n      customerFullName: 'María García',\n      title: 'Compra online',\n      customerEmail: customerEmail,\n    };\n\n    return this.bbvaService.createPaymentLink(paymentBody);\n  }\n}\n```\n\n### 2. Dynamic Usage with Bank Map\n```\nimport { Injectable, Inject } from '@nestjs/common';\nimport { RedsysService, RedsysPaymentLinkBody } from '@damuel90/nestjs-redsys';\n\n@Injectable()\nexport class DynamicPaymentService {\n  constructor(\n    @Inject('REDSYS_SERVICE_MAP')\n    private readonly redsysMap: Record<string, RedsysService>,\n  ) {}\n\n  async createPayment(bankKey: string, amount: number, customerName: string) {\n    const bankService = this.redsysMap[bankKey];\n    \n    if (!bankService) {\n      throw new Error(`Banco no configurado: ${bankKey}. Bancos disponibles: ${Object.keys(this.redsysMap).join(', ')}`);\n    }\n\n    const paymentBody: RedsysPaymentLinkBody = {\n      amount: amount,\n      currencyCode: 'EUR',\n      customerFullName: customerName,\n      title: 'Pago con ' + bankService.getConfig().bankName,\n    };\n\n    return bankService.createPaymentLink(paymentBody);\n  }\n\n  getAvailableBanks() {\n    return Object.entries(this.redsysMap).map(([key, service]) => ({\n      key,\n      name: service.getConfig().bankName,\n    }));\n  }\n}\n```","readmeFilename":"README.md"}