{"_id":"@bizcommerce/picpay-checkout-sdk","_rev":"2-6a73997e01237266fdba5c67a6d95581","name":"@bizcommerce/picpay-checkout-sdk","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@bizcommerce/picpay-checkout-sdk","version":"1.0.0","keywords":["picpay","checkout","payment","pix","credit-card","wallet","sdk","bizcommerce"],"author":{"name":"BizCommerce"},"license":"MIT","_id":"@bizcommerce/picpay-checkout-sdk@1.0.0","maintainers":[{"name":"dev-bizcommerce","email":"dev@bizcommerce.com.br"},{"name":"thiagocontardi","email":"thiagocontardi@hotmail.com"}],"homepage":"https://github.com/bizcommerce/picpay-checkout-sdk#readme","bugs":{"url":"https://github.com/bizcommerce/picpay-checkout-sdk/issues"},"dist":{"shasum":"a4cf090284f70530bd770d4af9632f9f0f38e96e","tarball":"https://registry.npmjs.org/@bizcommerce/picpay-checkout-sdk/-/picpay-checkout-sdk-1.0.0.tgz","fileCount":9,"integrity":"sha512-q6uoz5WcbMd+7a5NT2Lcc3DZucSzJIwGcQ8dbX88bQBIpl6gkm6NxHbWVxm+xY4qDl1IzYpCd8um5Aj561Id3w==","signatures":[{"sig":"MEUCIQD430toG2rMUTw6gd0yUhqDSYVf8BZHlanlf6jmtqPk2AIgOkhYXJSwDeoIHniTPWuKbxova9zIcOSbGrhKVNGGnWU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":78615},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18.0.0"},"exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"gitHead":"adb89145622f035228d2f791fe89394a641a15b9","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run build","test:integration":"vitest run --config vitest.integration.config.ts"},"_npmUser":{"name":"thiagocontardi","email":"thiagocontardi@hotmail.com"},"repository":{"url":"git+https://github.com/bizcommerce/picpay-checkout-sdk.git","type":"git"},"_npmVersion":"11.10.1","description":"TypeScript SDK for PicPay Checkout API (Transparent Checkout)","directories":{},"_nodeVersion":"22.15.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","vitest":"^4.0.18","typescript":"^5.9.3"},"_npmOperationalInternal":{"tmp":"tmp/picpay-checkout-sdk_1.0.0_1773013467185_0.004319313844405759","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bizcommerce/picpay-checkout-sdk","version":"1.0.1","description":"TypeScript SDK for PicPay Checkout API (Transparent Checkout)","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.mts","default":"./dist/index.mjs"},"require":{"types":"./dist/index.d.ts","default":"./dist/index.js"}}},"scripts":{"build":"tsup","test":"vitest run","test:watch":"vitest","test:integration":"vitest run --config vitest.integration.config.ts","typecheck":"tsc --noEmit","prepublishOnly":"npm run build"},"engines":{"node":">=18.0.0"},"keywords":["picpay","checkout","payment","pix","credit-card","wallet","sdk","bizcommerce"],"license":"MIT","author":{"name":"BizCommerce"},"repository":{"type":"git","url":"git+https://github.com/bizcommerce/picpay-checkout-sdk.git"},"homepage":"https://github.com/bizcommerce/picpay-checkout-sdk#readme","bugs":{"url":"https://github.com/bizcommerce/picpay-checkout-sdk/issues"},"devDependencies":{"tsup":"^8.5.1","typescript":"^5.9.3","vitest":"^4.0.18"},"gitHead":"39f0b08847551d1aafa80e0a724e3e01ca8dbcf0","_id":"@bizcommerce/picpay-checkout-sdk@1.0.1","_nodeVersion":"22.15.1","_npmVersion":"11.10.1","dist":{"integrity":"sha512-rfdOC1Ks1bDfNKLA6TD6EUoqiaNiU+lDRNp0LU11j/cGlkGDbYBiJXNCkgk7qeUG48nFy9VdPA9a8aU2zuRNmA==","shasum":"36169d5457417639ebee3c8e29f8e296d7697e8e","tarball":"https://registry.npmjs.org/@bizcommerce/picpay-checkout-sdk/-/picpay-checkout-sdk-1.0.1.tgz","fileCount":9,"unpackedSize":85253,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD9zCLiGAZGwkmutFV2Cm6ggd8Rz7lXyhTJ2V3cxWDUgQIhAMn8nEQrAD733TiZin9Aek+/dHXyKT2ICGXPxYqvyWZ7"}]},"_npmUser":{"name":"thiagocontardi","email":"thiagocontardi@hotmail.com"},"directories":{},"maintainers":[{"name":"dev-bizcommerce","email":"dev@bizcommerce.com.br"},{"name":"thiagocontardi","email":"thiagocontardi@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/picpay-checkout-sdk_1.0.1_1773062354974_0.6812327354741912"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-08T23:44:27.050Z","modified":"2026-03-09T13:19:15.237Z","1.0.0":"2026-03-08T23:44:27.349Z","1.0.1":"2026-03-09T13:19:15.124Z"},"bugs":{"url":"https://github.com/bizcommerce/picpay-checkout-sdk/issues"},"author":{"name":"BizCommerce"},"license":"MIT","homepage":"https://github.com/bizcommerce/picpay-checkout-sdk#readme","keywords":["picpay","checkout","payment","pix","credit-card","wallet","sdk","bizcommerce"],"repository":{"type":"git","url":"git+https://github.com/bizcommerce/picpay-checkout-sdk.git"},"description":"TypeScript SDK for PicPay Checkout API (Transparent Checkout)","maintainers":[{"name":"dev-bizcommerce","email":"dev@bizcommerce.com.br"},{"name":"thiagocontardi","email":"thiagocontardi@hotmail.com"}],"readme":"# @bizcommerce/picpay-checkout-sdk\n\nTypeScript SDK for PicPay Checkout API (Transparent Checkout). Supports credit card, PIX, and wallet payments.\n\n## Installation\n\n```bash\nnpm install @bizcommerce/picpay-checkout-sdk\n```\n\n## Quick Start\n\n```typescript\nimport { PicPayClient, PaymentSource, PaymentType, DocumentType } from '@bizcommerce/picpay-checkout-sdk';\n\nconst client = new PicPayClient({\n  clientId: 'your-client-id',\n  clientSecret: 'your-client-secret',\n  sandbox: true, // false for production\n});\n```\n\n## Credit Card\n\n```typescript\nconst auth = await client.creditCard.authorize({\n  paymentSource: PaymentSource.GATEWAY,\n  merchantChargeId: 'order-001',\n  customer: {\n    name: 'John Doe',\n    email: 'john@example.com',\n    documentType: DocumentType.CPF,\n    documentNumber: '12345678901',\n  },\n  transactions: [{\n    paymentType: PaymentType.CREDIT,\n    amount: 1000, // R$ 10.00 in cents\n    credit: {\n      installments: 1,\n      card: {\n        number: '4111111111111111',\n        holder: 'JOHN DOE',\n        expirationMonth: '12',\n        expirationYear: '2030',\n        cvv: '123',\n      },\n    },\n  }],\n});\n\n// Capture pre-authorized charge\nawait client.creditCard.capture('order-001');\n\n// Partial capture\nawait client.creditCard.capture('order-001', { amount: 500 });\n```\n\n## PIX\n\n```typescript\nconst pix = await client.pix.createCharge({\n  paymentSource: PaymentSource.GATEWAY,\n  merchantChargeId: 'order-002',\n  customer: { /* ... */ },\n  transactions: [{\n    paymentType: PaymentType.PIX,\n    amount: 5000,\n  }],\n});\n\nconsole.log(pix.transactions[0].pix.qrCode);       // Copy-paste code\nconsole.log(pix.transactions[0].pix.qrCodeBase64);  // QR code image\n```\n\n## Wallet\n\n```typescript\nconst wallet = await client.wallet.createCharge({\n  paymentSource: PaymentSource.GATEWAY,\n  merchantChargeId: 'order-003',\n  customer: { /* ... */ },\n  transactions: [{\n    paymentType: PaymentType.WALLET,\n    amount: 3000,\n  }],\n});\n```\n\n## Charge Operations\n\n```typescript\n// Find charge status\nconst charge = await client.charge.find('order-001');\n\n// Full refund\nawait client.charge.refund('order-001');\n\n// Partial refund\nawait client.charge.refund('order-001', { amount: 500 });\n```\n\n## Webhooks\n\n```typescript\nimport { WebhookHandler, ChargeStatus } from '@bizcommerce/picpay-checkout-sdk';\n\nconst handler = new WebhookHandler();\n\n// In your webhook endpoint\nconst event = handler.parse(req.body);\n\nif (handler.isChargeStatus(event, ChargeStatus.PAID)) {\n  // Handle payment confirmation\n}\n```\n\n## Error Handling\n\n```typescript\nimport { PicPayError, PicPayAuthError, PicPayValidationError } from '@bizcommerce/picpay-checkout-sdk';\n\ntry {\n  await client.creditCard.authorize(request);\n} catch (error) {\n  if (error instanceof PicPayValidationError) {\n    console.log(error.details); // Field-level errors\n  } else if (error instanceof PicPayAuthError) {\n    console.log('Authentication failed');\n  } else if (error instanceof PicPayError) {\n    console.log(error.statusCode, error.message);\n  }\n}\n```\n\n## Configuration\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `clientId` | `string` | required | PicPay OAuth client ID |\n| `clientSecret` | `string` | required | PicPay OAuth client secret |\n| `sandbox` | `boolean` | `false` | Use sandbox environment |\n| `timeout` | `number` | `30000` | Request timeout in ms |\n| `fetch` | `typeof fetch` | `globalThis.fetch` | Custom fetch implementation |\n\n## Documentation\n\n- [Credit Card](./docs/credit-card.md)\n- [PIX](./docs/pix.md)\n- [Wallet](./docs/wallet.md)\n- [Webhooks](./docs/webhooks.md)\n- [Testing](./docs/testing.md)\n\n## Requirements\n\n- Node.js 18+ (native fetch support)\n- TypeScript 5.7+ (recommended)\n\n## License\n\nMIT\n","readmeFilename":"README.md"}