{"_id":"@acountpay/pis-sdk","_rev":"3-e82fabb8906f27d4265ae029cb6fad83","name":"@acountpay/pis-sdk","dist-tags":{"latest":"1.2.0"},"versions":{"1.0.4":{"name":"@acountpay/pis-sdk","version":"1.0.4","author":{"name":"AcountPay","email":"team@acountpay.com"},"license":"MIT","_id":"@acountpay/pis-sdk@1.0.4","maintainers":[{"name":"paywithacount","email":"info@withacount.com"},{"name":"bhushandangore","email":"bhushan@steinnlabs.com"}],"dist":{"shasum":"8e2b0049c991c320de0b1ea00c0c88feb864f8d6","tarball":"https://registry.npmjs.org/@acountpay/pis-sdk/-/pis-sdk-1.0.4.tgz","fileCount":25,"integrity":"sha512-zhsL2vqRZ58R6udGiQcZRjpBKb2Tm65uGbcjmAcDZUFb9K7LC4gHh2Mr3MQIwFaZdrcPuU+4FIuuUZCS917fxA==","signatures":[{"sig":"MEQCIHyplBb1HZhxTNmCX0XNmIvUS9ac2/38+/M2Y1yKWXEUAiBlNesV1QrMmJDoVmfO2TdVUtU75BnL3qtkwtCFLDSuhA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":214406},"main":"dist/acount.js","module":"dist/acount.esm.js","gitHead":"3ee70f630024dffcdbcae9015a80b486a2c80494","scripts":{"build":"rollup -c"},"_npmUser":{"name":"paywithacount","email":"info@withacount.com"},"_npmVersion":"11.1.0","description":"A simple payment integration for your website that allows secure bank payments through Open Banking.","directories":{},"_nodeVersion":"22.11.0","dependencies":{"tslib":"^2.8.1"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.7","rollup":"^4.24.3","typescript":"^5.6.3","@types/node":"^24.0.12","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-replace":"^6.0.2","@rollup/plugin-typescript":"^12.1.1"},"_npmOperationalInternal":{"tmp":"tmp/pis-sdk_1.0.4_1759403429775_0.688638959710379","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@acountpay/pis-sdk","version":"1.0.5","author":{"name":"AcountPay","email":"team@acountpay.com"},"license":"MIT","_id":"@acountpay/pis-sdk@1.0.5","maintainers":[{"name":"paywithacount","email":"info@withacount.com"},{"name":"bhushandangore","email":"bhushan@steinnlabs.com"}],"dist":{"shasum":"8ac1de0658451647f3e698c75f28a6ddde531764","tarball":"https://registry.npmjs.org/@acountpay/pis-sdk/-/pis-sdk-1.0.5.tgz","fileCount":25,"integrity":"sha512-MNCvMX0q/TOrAQ0c8H/dkJgJXKalr1GYadCH+HyEfTi5ZZB1psHAPXOlDVAiOIZfN/DzaL9PgHwPkOXHLoHv6w==","signatures":[{"sig":"MEUCIFFyWH/iBRTX7DIIZTMTnwnlyfxlCEZb9LXTp1fMJTZ1AiEA4brvt6TvbRTkcnQ3bMo+8iqE+EuBoE+yLbyxa6dQjR8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":260477},"main":"dist/acount.cjs.js","types":"dist/index.d.ts","module":"dist/acount.esm.js","gitHead":"ad8d9564bfe68ecc9768ac8af9deffdc5e2ef8e0","scripts":{"build":"rollup -c"},"_npmUser":{"name":"paywithacount","email":"info@withacount.com"},"_npmVersion":"11.6.2","description":"A simple payment integration for your website that allows secure bank payments through Open Banking.","directories":{},"_nodeVersion":"24.12.0","dependencies":{"tslib":"^2.8.1"},"_hasShrinkwrap":false,"devDependencies":{"dotenv":"^16.4.7","rollup":"^4.24.3","typescript":"^5.6.3","@types/node":"^24.0.12","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-replace":"^6.0.2","@rollup/plugin-typescript":"^12.1.1"},"_npmOperationalInternal":{"tmp":"tmp/pis-sdk_1.0.5_1774031389152_0.39506013938852846","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@acountpay/pis-sdk","version":"1.2.0","main":"dist/acount.cjs.js","module":"dist/acount.esm.js","types":"dist/index.d.ts","unpkg":"dist/acountpay.js","jsdelivr":"dist/acountpay.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/acount.esm.js","require":"./dist/acount.cjs.js"},"./embed":"./dist/acountpay.js","./package.json":"./package.json"},"license":"MIT","author":{"name":"AcountPay","email":"team@acountpay.com"},"repository":{"type":"git","url":"git+https://github.com/PaywithAcount/PIS-sdk.git"},"scripts":{"build":"rollup -c"},"devDependencies":{"@rollup/plugin-replace":"^6.0.2","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^12.1.1","@types/node":"^24.0.12","dotenv":"^16.4.7","rollup":"^4.24.3","typescript":"^5.6.3"},"dependencies":{"tslib":"^2.8.1"},"gitHead":"5f90e55bfdf34dd0e0851c8d213cf3b5d2cc0654","_id":"@acountpay/pis-sdk@1.2.0","description":"A simple payment integration for your website that allows secure bank payments through Open Banking.","bugs":{"url":"https://github.com/PaywithAcount/PIS-sdk/issues"},"homepage":"https://github.com/PaywithAcount/PIS-sdk#readme","_nodeVersion":"24.12.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-zi0bp421GH8E5iC5GyBghdngZVfdtMQV1wdGZj+c8wP1LsU+rfW5C0lgElcK7UOoDdhhr98dsFrAPoQaDeRqBQ==","shasum":"7f149923312dc1f159c2384468fe1741e9a1d8d8","tarball":"https://registry.npmjs.org/@acountpay/pis-sdk/-/pis-sdk-1.2.0.tgz","fileCount":13,"unpackedSize":255032,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIQCljr3adZNoL8FRASuoDnMs9yTycX5eegJUii0wQvAukAIfI3A75cOozO2Ai9eROpYfvJhTZyVeA6AMUcOZjNC7Hw=="}]},"_npmUser":{"name":"paywithacount","email":"info@withacount.com"},"directories":{},"maintainers":[{"name":"paywithacount","email":"info@withacount.com"},{"name":"bhushandangore","email":"bhushan@steinnlabs.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pis-sdk_1.2.0_1781129560399_0.273152557192778"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-02T11:10:29.407Z","modified":"2026-06-10T22:12:40.698Z","1.0.4":"2025-10-02T11:10:29.972Z","1.0.5":"2026-03-20T18:29:49.291Z","1.2.0":"2026-06-10T22:12:40.556Z"},"author":{"name":"AcountPay","email":"team@acountpay.com"},"license":"MIT","description":"A simple payment integration for your website that allows secure bank payments through Open Banking.","maintainers":[{"name":"paywithacount","email":"info@withacount.com"},{"name":"bhushandangore","email":"bhushan@steinnlabs.com"}],"readme":"# AcountPay SDK\n\nA simple payment integration for your website that allows secure bank payments through Open Banking.\n\n## 5-Minute Integration Guide\n\n### Step 1: Add the SDK to your website\n\n**Option A: Script tag (quickest)**\n\n```html\n<script src=\"https://cdn.acountpay.com/sdk/acount.umd.js\"></script>\n```\n\n**Option B: npm (React, Next.js, Vue, etc.)**\n\n```bash\nnpm i @acountpay/pis-sdk\n```\n\n### Step 2: Create a payment button\n\n```html\n<button id=\"pay-button\">Pay with AcountPay</button>\n\n<script>\n  document.getElementById('pay-button').addEventListener('click', async function() {\n    const acount = new Acount({\n      clientId: \"YOUR_CLIENT_ID\" // Replace with your client ID from AcountPay dashboard\n    });\n\n    try {\n      const { redirectUrl } = await acount.createPaymentLink({\n        amount: 99.99,\n        referenceNumber: \"ORDER-123\",\n        redirectUrl: window.location.origin + \"/payment-callback\",\n      });\n\n      // Customer is taken to AcountPay's payment page to select bank and authenticate\n      window.location.href = redirectUrl;\n    } catch (error) {\n      console.error(\"Payment failed:\", error);\n      alert(\"Could not start payment. Please try again.\");\n    }\n  });\n</script>\n```\n\n### Step 3: Handle the return\n\nAfter payment, the customer is returned to your `redirectUrl` with a `?status=success|failed|pending` query parameter.\n\n```javascript\n// On your callback page\nconst params = new URLSearchParams(window.location.search);\nconst status = params.get('status');\n\nif (status === 'success') {\n  // Show order confirmation\n} else if (status === 'failed') {\n  // Offer retry\n} else {\n  // Payment is processing\n}\n```\n\n## React / Next.js Integration\n\n```typescript\n'use client';\nimport { useState } from 'react';\nimport AcountPay from '@acountpay/pis-sdk';\n\nexport function PaymentButton({ amount, orderId }: { amount: number; orderId: string }) {\n  const [loading, setLoading] = useState(false);\n\n  const handlePayment = async () => {\n    setLoading(true);\n    try {\n      const acount = new AcountPay({\n        clientId: process.env.NEXT_PUBLIC_ACOUNTPAY_CLIENT_ID!\n      });\n\n      const { redirectUrl } = await acount.createPaymentLink({\n        amount,\n        referenceNumber: orderId,\n        redirectUrl: `${window.location.origin}/payment-callback?orderId=${orderId}`,\n      });\n\n      window.location.href = redirectUrl;\n    } catch (error) {\n      console.error('Payment failed:', error);\n      setLoading(false);\n    }\n  };\n\n  return (\n    <button onClick={handlePayment} disabled={loading}>\n      {loading ? 'Processing...' : 'Pay with AcountPay'}\n    </button>\n  );\n}\n```\n\n## Payment Methods\n\n| Method | Description |\n|--------|-------------|\n| `createPaymentLink()` | **Recommended.** Creates a payment and returns a hosted payment page URL. Customer selects bank on AcountPay's page and is returned to your `redirectUrl`. |\n| `initiateUserPaymentByEmail()` | For registered AcountPay users. Redirects to AcountPay portal. |\n| `initiatePayment()` | Direct Token.io redirect for bank authentication. |\n| `initiateCrossBorderPayment()` | Converts currency to EUR and initiates a SEPA payment. |\n\n### `createPaymentLink` Parameters\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `amount` | `number` | Yes | Payment amount (e.g., 10.50) |\n| `referenceNumber` | `string` | Yes | Your unique order reference |\n| `redirectUrl` | `string` | Yes | URL to return customer to after payment |\n| `description` | `string` | No | Description shown during payment |\n| `currency` | `string` | No | Currency code (default: `DKK`) |\n| `webhookUrl` | `string` | No | Server-side URL for status updates |\n\n## Important Implementation Notes\n\n### Client ID\nReplace `\"YOUR_CLIENT_ID\"` with your actual client ID from the AcountPay dashboard.\n\n### Amount\nUse major currency units (e.g., 10.50 for $10.50). Use your actual cart total or product price.\n\n### Reference Number\nUse your unique order ID or invoice number so you can match payments back to orders.\n\n## Need Help?\n\n- Email: support@acountpay.com\n- Documentation: [docs.acountpay.com](https://docs.acountpay.com)\n- Dashboard: [dashboard.acountpay.com](https://dashboard.acountpay.com)\n","readmeFilename":"README.md","homepage":"https://github.com/PaywithAcount/PIS-sdk#readme","repository":{"type":"git","url":"git+https://github.com/PaywithAcount/PIS-sdk.git"},"bugs":{"url":"https://github.com/PaywithAcount/PIS-sdk/issues"}}