diff --git a/BookingMicroservice/Controllers/BookingController.cs b/BookingMicroservice/Controllers/BookingController.cs index 71d73923f50a9fd4a9d09948bc7489e31d2a9f8f..0a2584ea2955302d68389d4bf7053104fea6df70 100644 --- a/BookingMicroservice/Controllers/BookingController.cs +++ b/BookingMicroservice/Controllers/BookingController.cs @@ -142,6 +142,7 @@ namespace BookingMicroservice.Controllers } } + [Authorize] [HttpPost("create-payment-intent")] public async Task<IActionResult> CreatePaymentIntent([FromBody] PaymentIntentCreateRequest request) { diff --git a/client/package-lock.json b/client/package-lock.json index 2b93a1b24b2dce317e218b05489363af3d0b0aed..41698907f8e453c78998582431a40350d3bbb9e6 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -8,6 +8,8 @@ "name": "client", "version": "0.0.0", "dependencies": { + "@stripe/react-stripe-js": "^2.7.0", + "@stripe/stripe-js": "^3.3.0", "axios": "^1.6.8", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -25,7 +27,7 @@ "eslint-plugin-react-refresh": "^0.4.5", "sass": "^1.71.1", "typescript": "^5.2.2", - "vite": "^5.1.4" + "vite": "^5.2.9" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -396,9 +398,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", "cpu": [ "ppc64" ], @@ -412,9 +414,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", "cpu": [ "arm" ], @@ -428,9 +430,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", "cpu": [ "arm64" ], @@ -444,9 +446,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", "cpu": [ "x64" ], @@ -460,9 +462,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", "cpu": [ "arm64" ], @@ -476,9 +478,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", "cpu": [ "x64" ], @@ -492,9 +494,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", "cpu": [ "arm64" ], @@ -508,9 +510,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", "cpu": [ "x64" ], @@ -524,9 +526,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", "cpu": [ "arm" ], @@ -540,9 +542,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", "cpu": [ "arm64" ], @@ -556,9 +558,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", "cpu": [ "ia32" ], @@ -572,9 +574,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", "cpu": [ "loong64" ], @@ -588,9 +590,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", "cpu": [ "mips64el" ], @@ -604,9 +606,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", "cpu": [ "ppc64" ], @@ -620,9 +622,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", "cpu": [ "riscv64" ], @@ -636,9 +638,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", "cpu": [ "s390x" ], @@ -652,9 +654,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", "cpu": [ "x64" ], @@ -668,9 +670,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", "cpu": [ "x64" ], @@ -684,9 +686,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", "cpu": [ "x64" ], @@ -700,9 +702,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", "cpu": [ "x64" ], @@ -716,9 +718,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", "cpu": [ "arm64" ], @@ -732,9 +734,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", "cpu": [ "ia32" ], @@ -748,9 +750,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", "cpu": [ "x64" ], @@ -1003,9 +1005,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.1.tgz", - "integrity": "sha512-iU2Sya8hNn1LhsYyf0N+L4Gf9Qc+9eBTJJJsaOGUp+7x4n2M9dxTt8UvhJl3oeftSjblSlpCfvjA/IfP3g5VjQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.3.tgz", + "integrity": "sha512-X9alQ3XM6I9IlSlmC8ddAvMSyG1WuHk5oUnXGw+yUBs3BFoTizmG1La/Gr8fVJvDWAq+zlYTZ9DBgrlKRVY06g==", "cpu": [ "arm" ], @@ -1016,9 +1018,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.1.tgz", - "integrity": "sha512-wlzcWiH2Ir7rdMELxFE5vuM7D6TsOcJ2Yw0c3vaBR3VOsJFVTx9xvwnAvhgU5Ii8Gd6+I11qNHwndDscIm0HXg==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.3.tgz", + "integrity": "sha512-eQK5JIi+POhFpzk+LnjKIy4Ks+pwJ+NXmPxOCSvOKSNRPONzKuUvWE+P9JxGZVxrtzm6BAYMaL50FFuPe0oWMQ==", "cpu": [ "arm64" ], @@ -1029,9 +1031,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.1.tgz", - "integrity": "sha512-YRXa1+aZIFN5BaImK+84B3uNK8C6+ynKLPgvn29X9s0LTVCByp54TB7tdSMHDR7GTV39bz1lOmlLDuedgTwwHg==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.3.tgz", + "integrity": "sha512-Od4vE6f6CTT53yM1jgcLqNfItTsLt5zE46fdPaEmeFHvPs5SjZYlLpHrSiHEKR1+HdRfxuzXHjDOIxQyC3ptBA==", "cpu": [ "arm64" ], @@ -1042,9 +1044,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.1.tgz", - "integrity": "sha512-opjWJ4MevxeA8FhlngQWPBOvVWYNPFkq6/25rGgG+KOy0r8clYwL1CFd+PGwRqqMFVQ4/Qd3sQu5t7ucP7C/Uw==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.3.tgz", + "integrity": "sha512-0IMAO21axJeNIrvS9lSe/PGthc8ZUS+zC53O0VhF5gMxfmcKAP4ESkKOCwEi6u2asUrt4mQv2rjY8QseIEb1aw==", "cpu": [ "x64" ], @@ -1055,9 +1057,22 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.1.tgz", - "integrity": "sha512-uBkwaI+gBUlIe+EfbNnY5xNyXuhZbDSx2nzzW8tRMjUmpScd6lCQYKY2V9BATHtv5Ef2OBq6SChEP8h+/cxifQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.3.tgz", + "integrity": "sha512-ge2DC7tHRHa3caVEoSbPRJpq7azhG+xYsd6u2MEnJ6XzPSzQsTKyXvh6iWjXRf7Rt9ykIUWHtl0Uz3T6yXPpKw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.14.3.tgz", + "integrity": "sha512-ljcuiDI4V3ySuc7eSk4lQ9wU8J8r8KrOUvB2U+TtK0TiW6OFDmJ+DdIjjwZHIw9CNxzbmXY39wwpzYuFDwNXuw==", "cpu": [ "arm" ], @@ -1068,9 +1083,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.1.tgz", - "integrity": "sha512-0bK9aG1kIg0Su7OcFTlexkVeNZ5IzEsnz1ept87a0TUgZ6HplSgkJAnFpEVRW7GRcikT4GlPV0pbtVedOaXHQQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.3.tgz", + "integrity": "sha512-Eci2us9VTHm1eSyn5/eEpaC7eP/mp5n46gTRB3Aar3BgSvDQGJZuicyq6TsH4HngNBgVqC5sDYxOzTExSU+NjA==", "cpu": [ "arm64" ], @@ -1081,9 +1096,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.1.tgz", - "integrity": "sha512-qB6AFRXuP8bdkBI4D7UPUbE7OQf7u5OL+R94JE42Z2Qjmyj74FtDdLGeriRyBDhm4rQSvqAGCGC01b8Fu2LthQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.3.tgz", + "integrity": "sha512-UrBoMLCq4E92/LCqlh+blpqMz5h1tJttPIniwUgOFJyjWI1qrtrDhhpHPuFxULlUmjFHfloWdixtDhSxJt5iKw==", "cpu": [ "arm64" ], @@ -1093,10 +1108,23 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.3.tgz", + "integrity": "sha512-5aRjvsS8q1nWN8AoRfrq5+9IflC3P1leMoy4r2WjXyFqf3qcqsxRCfxtZIV58tCxd+Yv7WELPcO9mY9aeQyAmw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.1.tgz", - "integrity": "sha512-sHig3LaGlpNgDj5o8uPEoGs98RII8HpNIqFtAI8/pYABO8i0nb1QzT0JDoXF/pxzqO+FkxvwkHZo9k0NJYDedg==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.3.tgz", + "integrity": "sha512-sk/Qh1j2/RJSX7FhEpJn8n0ndxy/uf0kI/9Zc4b1ELhqULVdTfN6HL31CDaTChiBAOgLcsJ1sgVZjWv8XNEsAQ==", "cpu": [ "riscv64" ], @@ -1106,10 +1134,23 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.3.tgz", + "integrity": "sha512-jOO/PEaDitOmY9TgkxF/TQIjXySQe5KVYB57H/8LRP/ux0ZoO8cSHCX17asMSv3ruwslXW/TLBcxyaUzGRHcqg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.1.tgz", - "integrity": "sha512-nD3YcUv6jBJbBNFvSbp0IV66+ba/1teuBcu+fBBPZ33sidxitc6ErhON3JNavaH8HlswhWMC3s5rgZpM4MtPqQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.3.tgz", + "integrity": "sha512-8ybV4Xjy59xLMyWo3GCfEGqtKV5M5gCSrZlxkPGvEPCGDLNla7v48S662HSGwRd6/2cSneMQWiv+QzcttLrrOA==", "cpu": [ "x64" ], @@ -1120,9 +1161,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.1.tgz", - "integrity": "sha512-7/XVZqgBby2qp/cO0TQ8uJK+9xnSdJ9ct6gSDdEr4MfABrjTyrW6Bau7HQ73a2a5tPB7hno49A0y1jhWGDN9OQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.3.tgz", + "integrity": "sha512-s+xf1I46trOY10OqAtZ5Rm6lzHre/UiLA1J2uOhCFXWkbZrJRkYBPO6FhvGfHmdtQ3Bx793MNa7LvoWFAm93bg==", "cpu": [ "x64" ], @@ -1133,9 +1174,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.1.tgz", - "integrity": "sha512-CYc64bnICG42UPL7TrhIwsJW4QcKkIt9gGlj21gq3VV0LL6XNb1yAdHVp1pIi9gkts9gGcT3OfUYHjGP7ETAiw==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.3.tgz", + "integrity": "sha512-+4h2WrGOYsOumDQ5S2sYNyhVfrue+9tc9XcLWLh+Kw3UOxAvrfOrSMFon60KspcDdytkNDh7K2Vs6eMaYImAZg==", "cpu": [ "arm64" ], @@ -1146,9 +1187,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.1.tgz", - "integrity": "sha512-LN+vnlZ9g0qlHGlS920GR4zFCqAwbv2lULrR29yGaWP9u7wF5L7GqWu9Ah6/kFZPXPUkpdZwd//TNR+9XC9hvA==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.3.tgz", + "integrity": "sha512-T1l7y/bCeL/kUwh9OD4PQT4aM7Bq43vX05htPJJ46RTI4r5KNt6qJRzAfNfM+OYMNEVBWQzR2Gyk+FXLZfogGw==", "cpu": [ "ia32" ], @@ -1159,9 +1200,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.1.tgz", - "integrity": "sha512-n+vkrSyphvmU0qkQ6QBNXCGr2mKjhP08mPRM/Xp5Ck2FV4NrHU+y6axzDeixUrCBHVUS51TZhjqrKBBsHLKb2Q==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.3.tgz", + "integrity": "sha512-/BypzV0H1y1HzgYpxqRaXGBRqfodgoBBCcsrujT6QRcakDQdfU+Lq9PENPh5jB4I44YWq+0C2eHsHya+nZY1sA==", "cpu": [ "x64" ], @@ -1171,6 +1212,27 @@ "win32" ] }, + "node_modules/@stripe/react-stripe-js": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@stripe/react-stripe-js/-/react-stripe-js-2.7.0.tgz", + "integrity": "sha512-kTkIZl2ZleBuDR9c6fDy/s4m33llII8a5al6BDAMSTrfVq/4gSZv3RBO5KS/xvnxS+fDapJ3bKvjD8Lqj+AKdQ==", + "dependencies": { + "prop-types": "^15.7.2" + }, + "peerDependencies": { + "@stripe/stripe-js": "^1.44.1 || ^2.0.0 || ^3.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@stripe/stripe-js": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@stripe/stripe-js/-/stripe-js-3.3.0.tgz", + "integrity": "sha512-dUgAsko9KoYC1U2TIawHzbkQJzPoApxCc1Qf6/j318d1ArViyh6ROHVYTxnU3RlOQL/utUD9I4/QoyiCowsgrw==", + "engines": { + "node": ">=12.16" + } + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -1845,9 +1907,9 @@ "dev": true }, "node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", "dev": true, "hasInstallScript": true, "bin": { @@ -1857,29 +1919,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" } }, "node_modules/escalade": { @@ -2792,6 +2854,14 @@ "node": ">=0.10.0" } }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -2915,9 +2985,9 @@ } }, "node_modules/postcss": { - "version": "8.4.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", - "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "dev": true, "funding": [ { @@ -2936,7 +3006,7 @@ "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" @@ -2951,6 +3021,16 @@ "node": ">= 0.8.0" } }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -3023,6 +3103,11 @@ "react": "^16.8.0 || ^17 || ^18" } }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" + }, "node_modules/react-refresh": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.0.tgz", @@ -3109,9 +3194,9 @@ } }, "node_modules/rollup": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.1.tgz", - "integrity": "sha512-ggqQKvx/PsB0FaWXhIvVkSWh7a/PCLQAsMjBc+nA2M8Rv2/HG0X6zvixAB7KyZBRtifBUhy5k8voQX/mRnABPg==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.3.tgz", + "integrity": "sha512-ag5tTQKYsj1bhrFC9+OEWqb5O6VYgtQDO9hPDBMmIbePwhfSr+ExlcU741t8Dhw5DkPCQf6noz0jb36D6W9/hw==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -3124,19 +3209,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.12.1", - "@rollup/rollup-android-arm64": "4.12.1", - "@rollup/rollup-darwin-arm64": "4.12.1", - "@rollup/rollup-darwin-x64": "4.12.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.12.1", - "@rollup/rollup-linux-arm64-gnu": "4.12.1", - "@rollup/rollup-linux-arm64-musl": "4.12.1", - "@rollup/rollup-linux-riscv64-gnu": "4.12.1", - "@rollup/rollup-linux-x64-gnu": "4.12.1", - "@rollup/rollup-linux-x64-musl": "4.12.1", - "@rollup/rollup-win32-arm64-msvc": "4.12.1", - "@rollup/rollup-win32-ia32-msvc": "4.12.1", - "@rollup/rollup-win32-x64-msvc": "4.12.1", + "@rollup/rollup-android-arm-eabi": "4.14.3", + "@rollup/rollup-android-arm64": "4.14.3", + "@rollup/rollup-darwin-arm64": "4.14.3", + "@rollup/rollup-darwin-x64": "4.14.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.14.3", + "@rollup/rollup-linux-arm-musleabihf": "4.14.3", + "@rollup/rollup-linux-arm64-gnu": "4.14.3", + "@rollup/rollup-linux-arm64-musl": "4.14.3", + "@rollup/rollup-linux-powerpc64le-gnu": "4.14.3", + "@rollup/rollup-linux-riscv64-gnu": "4.14.3", + "@rollup/rollup-linux-s390x-gnu": "4.14.3", + "@rollup/rollup-linux-x64-gnu": "4.14.3", + "@rollup/rollup-linux-x64-musl": "4.14.3", + "@rollup/rollup-win32-arm64-msvc": "4.14.3", + "@rollup/rollup-win32-ia32-msvc": "4.14.3", + "@rollup/rollup-win32-x64-msvc": "4.14.3", "fsevents": "~2.3.2" } }, @@ -3252,9 +3340,9 @@ } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -3412,14 +3500,14 @@ } }, "node_modules/vite": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.5.tgz", - "integrity": "sha512-BdN1xh0Of/oQafhU+FvopafUp6WaYenLU/NFoL5WyJL++GxkNfieKzBhM24H3HVsPQrlAqB7iJYTHabzaRed5Q==", + "version": "5.2.9", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.9.tgz", + "integrity": "sha512-uOQWfuZBlc6Y3W/DTuQ1Sr+oIXWvqljLvS881SVmAj00d5RdgShLcuXWxseWPd4HXwiYBFW/vXHfKFeqj9uQnw==", "dev": true, "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.35", - "rollup": "^4.2.0" + "esbuild": "^0.20.1", + "postcss": "^8.4.38", + "rollup": "^4.13.0" }, "bin": { "vite": "bin/vite.js" diff --git a/client/package.json b/client/package.json index f33bceb34e0941e67845df527f755097b45f681c..fbbb466174e095ab43d4f7528c7c9e06a34bc4d1 100644 --- a/client/package.json +++ b/client/package.json @@ -10,6 +10,8 @@ "preview": "vite preview --host" }, "dependencies": { + "@stripe/react-stripe-js": "^2.7.0", + "@stripe/stripe-js": "^3.3.0", "axios": "^1.6.8", "react": "^18.2.0", "react-dom": "^18.2.0", @@ -27,6 +29,6 @@ "eslint-plugin-react-refresh": "^0.4.5", "sass": "^1.71.1", "typescript": "^5.2.2", - "vite": "^5.1.4" + "vite": "^5.2.9" } } diff --git a/client/src/components/BookingList/BookingCard/BookingCard.tsx b/client/src/components/BookingList/BookingCard/BookingCard.tsx index 751b0e08e2f7b7d173059af89c001d19c71fc435..774dc95614b8ec8cae317e555cb84c564cd43696 100644 --- a/client/src/components/BookingList/BookingCard/BookingCard.tsx +++ b/client/src/components/BookingList/BookingCard/BookingCard.tsx @@ -1,4 +1,4 @@ -import { useLocation } from "react-router-dom"; +import { useLocation, useNavigate } from "react-router-dom"; import { IFlight } from "../../../services/Dashboard/CustomerDashboard"; import "./BookingCard.scss"; import { @@ -12,6 +12,7 @@ interface IBookingCard { function BookingCard({ flight }: IBookingCard) { const location = useLocation(); + const navigate = useNavigate(); const isEconomy = location.search.split("seatType=")[1] === "economy"; const handleClick = async (event: any) => { @@ -20,9 +21,15 @@ function BookingCard({ flight }: IBookingCard) { const bookingInfo: BookingOrder = { flightId: flight.id, bookingClass: isEconomy ? 1 : 2, + price: isEconomy ? flight.economyPrice : flight.businessPrice }; - await bookFlight(bookingInfo); - alert("Flight booked successfully, navigating to payments page..."); + try { + alert("Flight booked successfully, navigating to payments page..."); + navigate('/booking/payment-form', { state: { bookingInfo } }); + } catch (error) { + console.error("Booking failed:", error); + alert("Failed to book flight. Please try again. Error: ${error.message}"); + } }; return ( diff --git a/client/src/components/PaymentForm/PaymentForm.scss b/client/src/components/PaymentForm/PaymentForm.scss new file mode 100644 index 0000000000000000000000000000000000000000..2a94031f32918c7bc9f86a164d1c8d48fcce9c11 --- /dev/null +++ b/client/src/components/PaymentForm/PaymentForm.scss @@ -0,0 +1,69 @@ +/* Add this at the beginning of your stylesheet */ +html, body { + margin: 0; + padding: 0; + height: 100%; /* Ensures the body takes full viewport height */ + overflow: hidden; /* Disables scrolling */ + background-color: #f4f4f9; /* Set the background color */ +} + +.form-container { + display: flex; + justify-content: center; + align-items: center; + height: 100%; /* Use the full height to align the form vertically */ + width: 100%; /* Cover the full width of the viewport */ +} + +.payment-form { + width: 100%; + max-width: 400px; + background: white; + padding: 20px; + box-shadow: 0 4px 8px rgba(0,0,0,0.1); + border-radius: 8px; + display: flex; + flex-direction: column; + gap: 10px; +} + +#form-heading { + font-size: 1.5rem; + color: #333; +} + +#form-description { + font-size: 1rem; + color: #666; + margin-bottom: 20px; + margin-top: -20px; +} + +.StripeElement { + background-color: white; + padding: 12px 16px; + border: 1px solid #ccc; + border-radius: 4px; + box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); + margin-bottom: 20px; +} + +.button { + padding: 12px; + background-color: #0066ff; + color: white; + border: none; + border-radius: 4px; + cursor: pointer; + font-size: 16px; + transition: background-color 0.3s ease; +} + +.button:hover { + background-color: #0056e0; +} + +.button:disabled { + background-color: #ccc; + cursor: not-allowed; +} diff --git a/client/src/components/PaymentForm/PaymentForm.tsx b/client/src/components/PaymentForm/PaymentForm.tsx new file mode 100644 index 0000000000000000000000000000000000000000..64ac254857ba1b73f92687d71f6e22d4973ec76c --- /dev/null +++ b/client/src/components/PaymentForm/PaymentForm.tsx @@ -0,0 +1,108 @@ +import React, { useState, useEffect } from 'react'; +import { useLocation, useNavigate } from "react-router-dom"; +import Api from "../../helpers/Api"; +import { CardElement, useStripe, useElements, Elements } from '@stripe/react-stripe-js'; +import { loadStripe } from '@stripe/stripe-js'; +import {bookFlight} from "../../services/BookingList/BookingOrder"; +import './PaymentForm.scss'; + +const stripePromise = loadStripe('pk_test_51P5UhOExQclpActcEGkHdut1X1k6uQnEXQ2cKKTD5l9FS9a1TyB2ap1lRSQXZt35Dpd7mh8gHOwFyVb4TiqpZfJr00bDRrD4vF'); + +const PaymentForm = () => { + const stripe = useStripe(); + const elements = useElements(); + const location = useLocation(); + const navigate = useNavigate(); + const [loading, setLoading] = useState(false); + const [bookingInfo, setBookingInfo] = useState(null); + const [message, setMessage] = useState(""); + const [clientSecret, setClientSecret] = useState(""); + + useEffect(() => { + if (location.state && location.state.bookingInfo) { + setBookingInfo(location.state.bookingInfo); + } + }, [location]); + + useEffect(() => { + if (!stripe || !bookingInfo) return; + + const fetchClientSecret = async () => { + try { + const form = { items: [{ price: bookingInfo.price * 100 }] }; + const response = await Api.post("Booking/create-payment-intent", form, { withCredentials: true }); + setClientSecret(response.data.clientSecret); + } catch (error) { + console.error('Failed to retrieve client secret:', error); + setMessage("Failed to retrieve Stripe secret key"); + } + }; + + fetchClientSecret(); + }, [stripe, bookingInfo]); + + const handleSubmit = async (event) => { + event.preventDefault(); + if (!stripe || !elements || !clientSecret) { + console.log('Stripe.js has not yet loaded or client secret not available.'); + return; + } + + setLoading(true); + try { + const { error, paymentIntent } = await stripe.confirmCardPayment(clientSecret, { + payment_method: { + card: elements.getElement(CardElement), + }, + }); + + if (error) { + setMessage(`Payment failed: ${error.message}`); + } else if (paymentIntent && paymentIntent.status === 'succeeded') { + setMessage("Payment succeeded!"); + + const updatedBookingInfo = { + ...bookingInfo, + paymentIntentId: paymentIntent.id + }; + + setBookingInfo(updatedBookingInfo); + + await bookFlight(updatedBookingInfo); + alert("Flight booked successfully!"); + navigate('/customer/bookings'); + + } else { + setMessage(`Payment processed but check status: ${paymentIntent.status}`); + } + } catch (error) { + console.error('Payment confirmation failed:', error); + setMessage("An error occurred while confirming the payment. Error: ${error.message}"); + } finally { + setLoading(false); + } + }; + + return ( + <div className="form-container"> + <form onSubmit={handleSubmit} className="payment-form"> + <h3 id="form-heading">Last step!</h3> + <p id="form-description">Enter your payment info below.</p> + <CardElement className="StripeElement" onChange={event => { + setDisabled(event.empty); + setMessage(event.error ? event.error.message : ""); + }} /> + <button type="submit" className="button" disabled={!stripe || loading}> + {loading ? 'Processing...' : 'Pay'} + </button> + {message && <div className="message">{message}</div>} + </form> + </div> + ); +}; + +export default () => ( + <Elements stripe={stripePromise}> + <PaymentForm /> + </Elements> +); diff --git a/client/src/main.tsx b/client/src/main.tsx index 0fe3efce59d977e6fc72da8118dcf9f27b61cd94..82fc0c40b6edef05e26b0def7c42bc59e5d5b592 100644 --- a/client/src/main.tsx +++ b/client/src/main.tsx @@ -12,6 +12,7 @@ import Flight from "./components/Flight/Flight.tsx"; import FlightList from "./components/FlightList/FlightList.tsx"; import BookingQuery from "./components/BookingQuery/BookingQuery.tsx"; import BookingList from "./components/BookingList/BookingList.tsx"; +import PaymentFormWrapper from "./components/PaymentForm/PaymentForm.tsx"; import { AuthoriseUser } from "./services/Authorise/Authorise.ts"; import { LogoutUser } from "./services/Logout/Logout.ts"; import { GetCustomerDashboardData } from "./services/Dashboard/CustomerDashboard.ts"; @@ -29,6 +30,11 @@ import CustomerProtectedRoute from "./components/ProtectedRoute/CustomerProtecte import AirlineProtectedRoute from "./components/ProtectedRoute/AirlineProtectedRoute.tsx"; import ErrorPage404 from "./components/ErrorPage/ErrorPage404.tsx"; import ErrorPage from "./components/ErrorPage/ErrorPage.tsx"; +import { loadStripe } from '@stripe/stripe-js'; +import { Elements } from '@stripe/react-stripe-js'; + +const stripePromise = loadStripe('pk_test_51P5UhOExQclpActcEGkHdut1X1k6uQnEXQ2cKKTD5l9FS9a1TyB2ap1lRSQXZt35Dpd7mh8gHOwFyVb4TiqpZfJr00bDRrD4vF'); + const router = createBrowserRouter([ { @@ -75,6 +81,10 @@ const router = createBrowserRouter([ loader: GetBookingList, element: <BookingList></BookingList>, }, + { + path: "booking/payment-form", + element: <PaymentFormWrapper></PaymentFormWrapper >, + }, { path: "customer/bookings", loader: GetAllBookings, diff --git a/client/src/services/BookingList/BookingOrder.ts b/client/src/services/BookingList/BookingOrder.ts index a46318ce8af122c34284cdf93b5e910f624ae80c..10b040a36cd2d374aca8b33d9b5394e0c4a38d07 100644 --- a/client/src/services/BookingList/BookingOrder.ts +++ b/client/src/services/BookingList/BookingOrder.ts @@ -6,6 +6,7 @@ export interface BookingOrder { flightId: number; bookingClass: number; seatId?: number; + price: number; } export async function bookFlight( diff --git a/client/src/services/Payment/Payment.ts b/client/src/services/Payment/Payment.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..69c7424db604f72574db7d6175e8038894253654 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,15 @@ +{ + "name": "COM3014", + "lockfileVersion": 2, + "requires": true, + "packages": { + "node_modules/@stripe/stripe-js": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@stripe/stripe-js/-/stripe-js-3.3.0.tgz", + "integrity": "sha512-dUgAsko9KoYC1U2TIawHzbkQJzPoApxCc1Qf6/j318d1ArViyh6ROHVYTxnU3RlOQL/utUD9I4/QoyiCowsgrw==", + "engines": { + "node": ">=12.16" + } + } + } +} diff --git a/node_modules/@stripe/stripe-js/LICENSE b/node_modules/@stripe/stripe-js/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..a97e81d3844a6fc3c704196c502ad15fccd8e2cd --- /dev/null +++ b/node_modules/@stripe/stripe-js/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Stripe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@stripe/stripe-js/README.md b/node_modules/@stripe/stripe-js/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fffb33873b2ac2f481da34eff98e7bd0f2c8edb3 --- /dev/null +++ b/node_modules/@stripe/stripe-js/README.md @@ -0,0 +1,156 @@ +# Stripe.js as a CommonJS module or ES module + +This package allows [Stripe.js](https://stripe.com/docs/stripe-js) to be +imported as a CommonJS module or ES module. + +**Note**: To be +[PCI compliant](https://stripe.com/docs/security/guide#validating-pci-compliance), +you must load Stripe.js directly from `https://js.stripe.com`. You cannot +include it in a bundle or host it yourself. This package wraps the global +`Stripe` function provided by the Stripe.js script as an ES module. + +Calling `loadStripe` always loads the latest version of Stripe.js, regardless of +which version of `@stripe/stripe-js` you use. Updates for this package only +impact tooling around the `loadStripe` helper itself and the TypeScript type +definitions provided for Stripe.js. Updates do not affect runtime availability +of features of Stripe.js. + +[](https://www.npmjs.com/package/@stripe/stripe-js) + +## Minimum requirements + +- Node.js: v12.16 +- TypeScript: v.3.1.1 + +## Installation + +Use `npm` to install the Stripe.js module: + +```sh +npm install @stripe/stripe-js +``` + +## Usage + +### `loadStripe` + +This function returns a `Promise` that resolves with a newly created `Stripe` +object once Stripe.js has loaded. It takes the same parameters passed when +directly +[initializing a `Stripe` instance](https://stripe.com/docs/js/initializing). If +necessary, it will load Stripe.js for you by inserting the Stripe.js script tag. +If you call `loadStripe` in a server environment it will resolve to `null`. + +```js +import {loadStripe} from '@stripe/stripe-js'; + +const stripe = await loadStripe('pk_test_TYooMQauvdEDq54NiTphI7jx'); +``` + +We’ve placed a random API key in this example. Replace it with your +[actual publishable API keys](https://dashboard.stripe.com/account/apikeys) to +test this code through your Stripe account. + +For more information on how to use Stripe.js, please refer to the +[Stripe.js API reference](https://stripe.com/docs/js) or learn to +[accept a payment](https://stripe.com/docs/payments/accept-a-payment) with +Stripe. + +If you have deployed a +[Content Security Policy](https://developer.mozilla.org/en-US/docs/Web/Security/CSP), +make sure to +[include Stripe.js in your directives](https://stripe.com/docs/security/guide#content-security-policy). + +## TypeScript support + +This package includes TypeScript declarations for Stripe.js. We support projects +using TypeScript versions >= 3.1. + +Some methods in Stripe.js accept and return objects from the +[Stripe API](https://stripe.com/docs/api). The type declarations in +`@stripe/stripe-js` for these objects in will always track the +[latest version](https://stripe.com/docs/api/versioning) of the Stripe API. If +you would like to use these types but are using an older version of the Stripe +API, we recommend +[updating to the latest version](https://stripe.com/docs/upgrades#how-can-i-upgrade-my-api), +or ignoring and overriding the type definitions as necessary. + +Note that we may release new [minor and patch](https://semver.org/) versions of +`@stripe/stripe-js` with small but backwards-incompatible fixes to the type +declarations. These changes will not affect Stripe.js itself. + +## Ensuring Stripe.js is available everywhere + +To best leverage Stripe’s advanced fraud functionality, ensure that Stripe.js is +loaded on every page, not just your checkout page. This +[allows Stripe to detect suspicious behavior](https://stripe.com/docs/disputes/prevention/advanced-fraud-detection) +that may be indicative of fraud as customers browse your website. + +By default, this module will insert a `<script>` tag that loads Stripe.js from +`https://js.stripe.com`. This happens as a side effect immediately upon +importing this module. If you utilize code splitting or only include your +JavaScript app on your checkout page, the Stripe.js script will only be +available in parts of your site. To ensure Stripe.js is available everywhere, +you can perform either of the following steps: + +### Import as a side effect + +Import `@stripe/stripe-js` as a side effect in code that will be included +throughout your site (e.g. your root module). This will make sure the Stripe.js +script tag is inserted immediately upon page load. + +```js +import '@stripe/stripe-js'; +``` + +### Manually include the script tag + +Manually add the Stripe.js script tag to the `<head>` of each page on your site. +If an existing script tag is already present, this module will not insert a new +one. When you call `loadStripe`, it will use the existing script tag. + +```html +<!-- Somewhere in your site's <head> --> +<script src="https://js.stripe.com/v3" async></script> +``` + +### Importing `loadStripe` without side effects + +If you would like to use `loadStripe` in your application, but defer loading the +Stripe.js script until `loadStripe` is first called, use the alternative +`@stripe/stripe-js/pure` import module: + +```js +// CommonJS module import +const {loadStripe} = require('@stripe/stripe-js/pure'); +// ES module import +import {loadStripe} from '@stripe/stripe-js/pure'; + +// Stripe.js will not be loaded until `loadStripe` is called +const stripe = await loadStripe('pk_test_TYooMQauvdEDq54NiTphI7jx'); +``` + +### Disabling advanced fraud detection signals + +If you would like to +[disable advanced fraud detection](https://stripe.com/docs/disputes/prevention/advanced-fraud-detection#disabling-advanced-fraud-detection) +altogether, use `loadStripe.setLoadParameters`: + +```js +// CommonJS module import +const {loadStripe} = require('@stripe/stripe-js/pure'); +// ES module import +import {loadStripe} from '@stripe/stripe-js/pure'; + +loadStripe.setLoadParameters({advancedFraudSignals: false}); +const stripe = await loadStripe('pk_test_TYooMQauvdEDq54NiTphI7jx'); +``` + +The `loadStripe.setLoadParameters` function is only available when importing +`loadStripe` from `@stripe/stripe-js/pure`. + +## Stripe.js Documentation + +- [Stripe.js Docs](https://stripe.com/docs/stripe-js) +- [Stripe.js Reference](https://stripe.com/docs/js) +- [React Stripe.js Docs](https://stripe.com/docs/stripe-js/react) diff --git a/node_modules/@stripe/stripe-js/dist/api/bank-accounts.d.mts b/node_modules/@stripe/stripe-js/dist/api/bank-accounts.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c5a43764ff4bd131d2b16f07c6fbe3d7affad741 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/bank-accounts.d.mts @@ -0,0 +1,61 @@ +/** + * The BankAccount object. + */ +export interface BankAccount { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'bank_account'; + + /** + * The name of the person or business that owns the bank account. + */ + account_holder_name: string | null; + + /** + * The type of entity that holds the account. This can be either `individual` or `company`. + */ + account_holder_type: string | null; + + /** + * Name of the bank associated with the routing number (e.g., `WELLS FARGO`). + */ + bank_name: string | null; + + /** + * Two-letter ISO code representing the country the bank account is located in. + */ + country: string; + + /** + * Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. + */ + currency: string; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + */ + fingerprint: string | null; + + /** + * The last four digits of the bank account number. + */ + last4: string; + + /** + * The routing transit number for the bank account. + */ + routing_number: string | null; + + /** + * For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a transfer sent to this bank account fails, we'll set the status to `errored` and will not continue to send transfers until the bank details are updated. + * + * For external accounts, possible values are `new` and `errored`. Validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. If a transfer fails, the status is set to `errored` and transfers are stopped until account details are updated. + */ + status: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/bank-accounts.d.ts b/node_modules/@stripe/stripe-js/dist/api/bank-accounts.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c5a43764ff4bd131d2b16f07c6fbe3d7affad741 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/bank-accounts.d.ts @@ -0,0 +1,61 @@ +/** + * The BankAccount object. + */ +export interface BankAccount { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'bank_account'; + + /** + * The name of the person or business that owns the bank account. + */ + account_holder_name: string | null; + + /** + * The type of entity that holds the account. This can be either `individual` or `company`. + */ + account_holder_type: string | null; + + /** + * Name of the bank associated with the routing number (e.g., `WELLS FARGO`). + */ + bank_name: string | null; + + /** + * Two-letter ISO code representing the country the bank account is located in. + */ + country: string; + + /** + * Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. + */ + currency: string; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + */ + fingerprint: string | null; + + /** + * The last four digits of the bank account number. + */ + last4: string; + + /** + * The routing transit number for the bank account. + */ + routing_number: string | null; + + /** + * For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a transfer sent to this bank account fails, we'll set the status to `errored` and will not continue to send transfers until the bank details are updated. + * + * For external accounts, possible values are `new` and `errored`. Validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. If a transfer fails, the status is set to `errored` and transfers are stopped until account details are updated. + */ + status: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/cards.d.mts b/node_modules/@stripe/stripe-js/dist/api/cards.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..31cf071f8352716c73e4ebdecae5bc4ecf9a71d6 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/cards.d.mts @@ -0,0 +1,130 @@ +import {Metadata} from './shared'; + +/** + * The Card object. + */ +export interface Card { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'card'; + + /** + * City/District/Suburb/Town/Village. + */ + address_city: string | null; + + /** + * Billing address country, if provided when creating card. + */ + address_country: string | null; + + /** + * Address line 1 (Street address/PO Box/Company name). + */ + address_line1: string | null; + + /** + * If `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + */ + address_line1_check: string | null; + + /** + * Address line 2 (Apartment/Suite/Unit/Building). + */ + address_line2: string | null; + + /** + * State/County/Province/Region. + */ + address_state: string | null; + + /** + * ZIP or postal code. + */ + address_zip: string | null; + + /** + * If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + */ + address_zip_check: string | null; + + /** + * Card brand. Can be `American Express`, `Diners Club`, `Discover`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. + */ + brand: string; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + */ + country: string | null; + + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency?: string | null; + + /** + * The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead. + */ + customer?: string | null; + + /** + * If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + */ + cvc_check: string | null; + + /** + * (For tokenized numbers only.) The last four digits of the device account number. + */ + dynamic_last4: string | null; + + /** + * Two-digit number representing the card's expiration month. + */ + exp_month: number; + + /** + * Four-digit number representing the card's expiration year. + */ + exp_year: number; + + /** + * Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. + */ + fingerprint?: string | null; + + /** + * Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + */ + funding: string; + + /** + * The last four digits of the card. + */ + last4: string; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata: Metadata; + + /** + * Cardholder name. + */ + name: string | null; + + /** + * If the card number is tokenized, this is the method that was used. Can be `apple_pay` or `google_pay`. + */ + tokenization_method: string | null; +} + +export namespace Card { + export type AvailablePayoutMethod = 'instant' | 'standard'; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/cards.d.ts b/node_modules/@stripe/stripe-js/dist/api/cards.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..31cf071f8352716c73e4ebdecae5bc4ecf9a71d6 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/cards.d.ts @@ -0,0 +1,130 @@ +import {Metadata} from './shared'; + +/** + * The Card object. + */ +export interface Card { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'card'; + + /** + * City/District/Suburb/Town/Village. + */ + address_city: string | null; + + /** + * Billing address country, if provided when creating card. + */ + address_country: string | null; + + /** + * Address line 1 (Street address/PO Box/Company name). + */ + address_line1: string | null; + + /** + * If `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + */ + address_line1_check: string | null; + + /** + * Address line 2 (Apartment/Suite/Unit/Building). + */ + address_line2: string | null; + + /** + * State/County/Province/Region. + */ + address_state: string | null; + + /** + * ZIP or postal code. + */ + address_zip: string | null; + + /** + * If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + */ + address_zip_check: string | null; + + /** + * Card brand. Can be `American Express`, `Diners Club`, `Discover`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. + */ + brand: string; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + */ + country: string | null; + + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency?: string | null; + + /** + * The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead. + */ + customer?: string | null; + + /** + * If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + */ + cvc_check: string | null; + + /** + * (For tokenized numbers only.) The last four digits of the device account number. + */ + dynamic_last4: string | null; + + /** + * Two-digit number representing the card's expiration month. + */ + exp_month: number; + + /** + * Four-digit number representing the card's expiration year. + */ + exp_year: number; + + /** + * Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. + */ + fingerprint?: string | null; + + /** + * Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + */ + funding: string; + + /** + * The last four digits of the card. + */ + last4: string; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata: Metadata; + + /** + * Cardholder name. + */ + name: string | null; + + /** + * If the card number is tokenized, this is the method that was used. Can be `apple_pay` or `google_pay`. + */ + tokenization_method: string | null; +} + +export namespace Card { + export type AvailablePayoutMethod = 'instant' | 'standard'; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/confirmation-tokens.d.mts b/node_modules/@stripe/stripe-js/dist/api/confirmation-tokens.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..d709888bc91570dd9bc3ad84aba265f9803b2682 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/confirmation-tokens.d.mts @@ -0,0 +1,191 @@ +import {StripeElements} from '../stripe-js'; +import {Address} from './shared'; +import {PaymentMethod, PaymentMethodCreateParams} from './payment-methods'; +import {PaymentIntent} from './payment-intents'; + +/** + * The ConfirmationToken object. + */ +export interface ConfirmationToken { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'confirmation_token'; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. This is set to null once this ConfirmationToken has been used. Measured in seconds since the Unix epoch. + */ + expires_at: number; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + */ + payment_intent: null | string; + + /** + * Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. + */ + payment_method_preview: ConfirmationToken.PaymentMethodPreview; + + /** + * The URL your customer is redirected to after they complete the payment. + */ + return_url: string | null; + + /** + * Indicates that you intend to make future payments with this ConfirmationToken’s payment method. + * + * The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + * + * Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by [SCA](https://stripe.com/docs/strong-customer-authentication), using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect [off-session payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer. + */ + setup_future_usage: PaymentIntent.SetupFutureUsage | null; + + /** + * ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + */ + setup_intent: null | string; + + /** + * Shipping information for this ConfirmationToken. + */ + shipping: PaymentIntent.Shipping | null; + + /** + * Set to true when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + */ + use_stripe_sdk: boolean; +} + +export interface ConfirmationTokenCreateParams { + /** + * Data used to create a new payment method. + * + */ + payment_method_data?: { + /** + * The customer's billing details. + */ + billing_details?: PaymentMethodCreateParams.BillingDetails; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Specifies if the PaymentMethod should be redisplayed when using the Saved Payment Method feature + */ + allow_redisplay?: 'always' | 'limited' | 'unspecified'; + }; + + /** + * Shipping information. + */ + shipping?: ConfirmationToken.Shipping; + + /** + * The url your customer will be directed to after they complete authentication. + */ + return_url?: string | null; +} + +export interface CreateConfirmationToken { + /** + * The Elements instance. + * + * @docs https://stripe.com/docs/js/elements_object + */ + elements: StripeElements; + + /** + * Parameters for creating the ConfirmationToken. + * Details collected by Elements will be overriden by values passed here. + */ + params?: ConfirmationTokenCreateParams; +} + +export namespace ConfirmationToken { + export interface Shipping { + /** + * Recipient address. + */ + address: Address; + + /** + * Recipient name. + */ + name: string | null; + + /** + * Recipient phone (including extension). + */ + phone?: string | null; + } + + export interface PaymentMethodPreview { + /** + * The type of the PaymentMethod. An additional hash is included on payment_method_preview with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type: string; + + billing_details: PaymentMethod.BillingDetails; + + acss_debit?: PaymentMethod.AcssDebit; + + affirm?: PaymentMethod.Affirm; + + afterpay_clearpay?: PaymentMethod.AfterpayClearpay; + + au_becs_debit?: PaymentMethod.AuBecsDebit; + + card?: PaymentMethod.Card; + + card_present?: PaymentMethod.CardPresent; + + eps?: PaymentMethod.Eps; + + fpx?: PaymentMethod.Fpx; + + grabpay?: PaymentMethod.GrabPay; + + ideal?: PaymentMethod.Ideal; + + p24?: PaymentMethod.P24; + + sepa_debit?: PaymentMethod.SepaDebit; + + us_bank_account?: PaymentMethod.UsBankAccount; + } + + export interface MandateData { + customer_acceptance: { + type: 'online'; + + online?: { + /** + * The IP address from which the Mandate was accepted by the customer. + */ + ip_address: string; + + /** + * The user agent of the browser from which the Mandate was accepted by the customer. + */ + user_agent: string; + }; + }; + } +} diff --git a/node_modules/@stripe/stripe-js/dist/api/confirmation-tokens.d.ts b/node_modules/@stripe/stripe-js/dist/api/confirmation-tokens.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d709888bc91570dd9bc3ad84aba265f9803b2682 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/confirmation-tokens.d.ts @@ -0,0 +1,191 @@ +import {StripeElements} from '../stripe-js'; +import {Address} from './shared'; +import {PaymentMethod, PaymentMethodCreateParams} from './payment-methods'; +import {PaymentIntent} from './payment-intents'; + +/** + * The ConfirmationToken object. + */ +export interface ConfirmationToken { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'confirmation_token'; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. This is set to null once this ConfirmationToken has been used. Measured in seconds since the Unix epoch. + */ + expires_at: number; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + */ + payment_intent: null | string; + + /** + * Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. + */ + payment_method_preview: ConfirmationToken.PaymentMethodPreview; + + /** + * The URL your customer is redirected to after they complete the payment. + */ + return_url: string | null; + + /** + * Indicates that you intend to make future payments with this ConfirmationToken’s payment method. + * + * The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + * + * Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by [SCA](https://stripe.com/docs/strong-customer-authentication), using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect [off-session payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer. + */ + setup_future_usage: PaymentIntent.SetupFutureUsage | null; + + /** + * ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + */ + setup_intent: null | string; + + /** + * Shipping information for this ConfirmationToken. + */ + shipping: PaymentIntent.Shipping | null; + + /** + * Set to true when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + */ + use_stripe_sdk: boolean; +} + +export interface ConfirmationTokenCreateParams { + /** + * Data used to create a new payment method. + * + */ + payment_method_data?: { + /** + * The customer's billing details. + */ + billing_details?: PaymentMethodCreateParams.BillingDetails; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Specifies if the PaymentMethod should be redisplayed when using the Saved Payment Method feature + */ + allow_redisplay?: 'always' | 'limited' | 'unspecified'; + }; + + /** + * Shipping information. + */ + shipping?: ConfirmationToken.Shipping; + + /** + * The url your customer will be directed to after they complete authentication. + */ + return_url?: string | null; +} + +export interface CreateConfirmationToken { + /** + * The Elements instance. + * + * @docs https://stripe.com/docs/js/elements_object + */ + elements: StripeElements; + + /** + * Parameters for creating the ConfirmationToken. + * Details collected by Elements will be overriden by values passed here. + */ + params?: ConfirmationTokenCreateParams; +} + +export namespace ConfirmationToken { + export interface Shipping { + /** + * Recipient address. + */ + address: Address; + + /** + * Recipient name. + */ + name: string | null; + + /** + * Recipient phone (including extension). + */ + phone?: string | null; + } + + export interface PaymentMethodPreview { + /** + * The type of the PaymentMethod. An additional hash is included on payment_method_preview with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type: string; + + billing_details: PaymentMethod.BillingDetails; + + acss_debit?: PaymentMethod.AcssDebit; + + affirm?: PaymentMethod.Affirm; + + afterpay_clearpay?: PaymentMethod.AfterpayClearpay; + + au_becs_debit?: PaymentMethod.AuBecsDebit; + + card?: PaymentMethod.Card; + + card_present?: PaymentMethod.CardPresent; + + eps?: PaymentMethod.Eps; + + fpx?: PaymentMethod.Fpx; + + grabpay?: PaymentMethod.GrabPay; + + ideal?: PaymentMethod.Ideal; + + p24?: PaymentMethod.P24; + + sepa_debit?: PaymentMethod.SepaDebit; + + us_bank_account?: PaymentMethod.UsBankAccount; + } + + export interface MandateData { + customer_acceptance: { + type: 'online'; + + online?: { + /** + * The IP address from which the Mandate was accepted by the customer. + */ + ip_address: string; + + /** + * The user agent of the browser from which the Mandate was accepted by the customer. + */ + user_agent: string; + }; + }; + } +} diff --git a/node_modules/@stripe/stripe-js/dist/api/financial-connections.d.mts b/node_modules/@stripe/stripe-js/dist/api/financial-connections.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..18573471269f6b29015dc37866be3004bb42c658 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/financial-connections.d.mts @@ -0,0 +1,232 @@ +type SupportedPaymentMethodType = 'us_bank_account' | 'link'; + +interface CommonBalance { + /** + * The time that the external institution calculated this balance. Measured + * in seconds since the Unix epoch. + */ + as_of: number; + + /** + * The balances owed to (or by) the account holder. + * + * Each key is a three-letter ISO currency code, in lowercase. + * + * Each value is a integer amount. A positive amount indicates money owed to + * the account holder. A negative amount indicates money owed by the account + * holder. + */ + current: { + [key: string]: number | undefined; + }; +} + +interface CashBalance { + /** + * Information on a `cash` balance. Only set if `balance.type` is `cash`. + */ + cash: { + /** + * The funds available to the account holder. Typically this is the + * current balance less any holds. + * + * Each key is a three-letter ISO currency code, in lowercase. + * + * Each value is a integer amount. A positive amount indicates money owed + * to the account holder. A negative amount indicates money owed by the + * account holder. + */ + available: {[key: string]: number | undefined}; + }; + + type: 'cash'; +} + +interface CreditBalance { + /** + * Information on a `credit` balance. Only set if `balance.type` is `credit`. + */ + credit: { + /** + * The credit that has been used by the account holder. + * + * Each key is a three-letter ISO currency code, in lowercase + * + * Each value is a integer amount. A positive amount indicates money owed + * to the account holder. A negative amount indicates money owed by the + * account holder. + */ + used: {[key: string]: number | undefined}; + }; + + type: 'credit'; +} + +type Balance = (CommonBalance & CashBalance) | (CommonBalance & CreditBalance); + +interface BalanceRefresh { + /** + * The status of the Balance Refresh + */ + status: 'pending' | 'succeeded' | 'failed'; + + /** + * Time at which the Balance Refresh was attempted. Measured in seconds since the Unix epoch. + */ + last_attempted_at: number; +} + +interface OwnershipRefresh { + /** + * The status of the Ownership Refresh + */ + status: 'pending' | 'succeeded' | 'failed'; + + /** + * Time at which the Ownersip Refresh was attempted. Measured in seconds since the Unix epoch. + */ + last_attempted_at: number; +} + +/** + * The Financial Connections Session object + */ +export interface FinancialConnectionsSession { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * List of accounts collected by the Session + */ + accounts: FinancialConnectionsSession.Account[]; + + /** + * Filters applied to the Session + */ + filters?: FinancialConnectionsSession.Filters; + + /** + * List of data permissions requested in the Session + */ + permissions?: FinancialConnectionsSession.Permission[]; + + /** + * For webview integrations only. The user will be redirected to this URL to return to your app. + */ + return_url?: string; +} + +export namespace FinancialConnectionsSession { + /** + * The Financial Connections Account object + */ + export interface Account { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. `'linked_account'` is present for backwards-compatibility. + */ + object: 'linked_account' | 'financial_connections.account'; + + /** + * The balance for this Account + */ + balance: null | Balance; + + /** + * The most recent Balance Refresh for this Account + */ + balance_refresh: null | BalanceRefresh; + + /** + * The type of the account. + */ + category: 'cash' | 'credit' | 'investment' | 'other'; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * A human-readable name that has been assigned to this account, either by the account holder or by the institution. + */ + display_name: string; + + /** + * The name of the institution that holds this account. + */ + institution_name: string; + + /** + * The last 4 digits of the account number. If present, this will be 4 numeric characters. + */ + last4: string | null; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * The ID of this account's Ownership resource. + */ + ownership: string | null; + + /** + * The most recent Ownership Refresh for this Account + */ + ownership_refresh: null | OwnershipRefresh; + + /** + * Permissions granted on this Account + */ + permissions: Permission[]; + + /** + * The status of the Account + */ + status: 'active' | 'inactive' | 'disconnected'; + + /** + * The sub-category of the Account + */ + subcategory: + | 'checking' + | 'savings' + | 'mortgage' + | 'line_of_credit' + | 'credit_card' + | 'other'; + + /** + * The types of Payment Methods which can be set up by this Account + */ + supported_payment_method_types: SupportedPaymentMethodType[]; + } + + /** + * Filters to restrict the kinds of accounts to collect. + */ + export interface Filters { + /** + * List of countries from which to collect accounts. + */ + countries?: string[]; + } + + /** + * Data features to which access can be requested + */ + export type Permission = + | 'payment_method' + | 'balances' + | 'transactions' + | 'ownership' + | 'account_numbers'; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/financial-connections.d.ts b/node_modules/@stripe/stripe-js/dist/api/financial-connections.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..18573471269f6b29015dc37866be3004bb42c658 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/financial-connections.d.ts @@ -0,0 +1,232 @@ +type SupportedPaymentMethodType = 'us_bank_account' | 'link'; + +interface CommonBalance { + /** + * The time that the external institution calculated this balance. Measured + * in seconds since the Unix epoch. + */ + as_of: number; + + /** + * The balances owed to (or by) the account holder. + * + * Each key is a three-letter ISO currency code, in lowercase. + * + * Each value is a integer amount. A positive amount indicates money owed to + * the account holder. A negative amount indicates money owed by the account + * holder. + */ + current: { + [key: string]: number | undefined; + }; +} + +interface CashBalance { + /** + * Information on a `cash` balance. Only set if `balance.type` is `cash`. + */ + cash: { + /** + * The funds available to the account holder. Typically this is the + * current balance less any holds. + * + * Each key is a three-letter ISO currency code, in lowercase. + * + * Each value is a integer amount. A positive amount indicates money owed + * to the account holder. A negative amount indicates money owed by the + * account holder. + */ + available: {[key: string]: number | undefined}; + }; + + type: 'cash'; +} + +interface CreditBalance { + /** + * Information on a `credit` balance. Only set if `balance.type` is `credit`. + */ + credit: { + /** + * The credit that has been used by the account holder. + * + * Each key is a three-letter ISO currency code, in lowercase + * + * Each value is a integer amount. A positive amount indicates money owed + * to the account holder. A negative amount indicates money owed by the + * account holder. + */ + used: {[key: string]: number | undefined}; + }; + + type: 'credit'; +} + +type Balance = (CommonBalance & CashBalance) | (CommonBalance & CreditBalance); + +interface BalanceRefresh { + /** + * The status of the Balance Refresh + */ + status: 'pending' | 'succeeded' | 'failed'; + + /** + * Time at which the Balance Refresh was attempted. Measured in seconds since the Unix epoch. + */ + last_attempted_at: number; +} + +interface OwnershipRefresh { + /** + * The status of the Ownership Refresh + */ + status: 'pending' | 'succeeded' | 'failed'; + + /** + * Time at which the Ownersip Refresh was attempted. Measured in seconds since the Unix epoch. + */ + last_attempted_at: number; +} + +/** + * The Financial Connections Session object + */ +export interface FinancialConnectionsSession { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * List of accounts collected by the Session + */ + accounts: FinancialConnectionsSession.Account[]; + + /** + * Filters applied to the Session + */ + filters?: FinancialConnectionsSession.Filters; + + /** + * List of data permissions requested in the Session + */ + permissions?: FinancialConnectionsSession.Permission[]; + + /** + * For webview integrations only. The user will be redirected to this URL to return to your app. + */ + return_url?: string; +} + +export namespace FinancialConnectionsSession { + /** + * The Financial Connections Account object + */ + export interface Account { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. `'linked_account'` is present for backwards-compatibility. + */ + object: 'linked_account' | 'financial_connections.account'; + + /** + * The balance for this Account + */ + balance: null | Balance; + + /** + * The most recent Balance Refresh for this Account + */ + balance_refresh: null | BalanceRefresh; + + /** + * The type of the account. + */ + category: 'cash' | 'credit' | 'investment' | 'other'; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * A human-readable name that has been assigned to this account, either by the account holder or by the institution. + */ + display_name: string; + + /** + * The name of the institution that holds this account. + */ + institution_name: string; + + /** + * The last 4 digits of the account number. If present, this will be 4 numeric characters. + */ + last4: string | null; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * The ID of this account's Ownership resource. + */ + ownership: string | null; + + /** + * The most recent Ownership Refresh for this Account + */ + ownership_refresh: null | OwnershipRefresh; + + /** + * Permissions granted on this Account + */ + permissions: Permission[]; + + /** + * The status of the Account + */ + status: 'active' | 'inactive' | 'disconnected'; + + /** + * The sub-category of the Account + */ + subcategory: + | 'checking' + | 'savings' + | 'mortgage' + | 'line_of_credit' + | 'credit_card' + | 'other'; + + /** + * The types of Payment Methods which can be set up by this Account + */ + supported_payment_method_types: SupportedPaymentMethodType[]; + } + + /** + * Filters to restrict the kinds of accounts to collect. + */ + export interface Filters { + /** + * List of countries from which to collect accounts. + */ + countries?: string[]; + } + + /** + * Data features to which access can be requested + */ + export type Permission = + | 'payment_method' + | 'balances' + | 'transactions' + | 'ownership' + | 'account_numbers'; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/index.d.mts b/node_modules/@stripe/stripe-js/dist/api/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..302a8a3a59cc375a745c25648c7cb6375a14bd36 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/index.d.mts @@ -0,0 +1,12 @@ +export * from './shared'; +export * from './payment-methods'; +export * from './confirmation-tokens'; +export * from './payment-intents'; +export * from './orders'; +export * from './setup-intents'; +export * from './sources'; +export * from './tokens'; +export * from './bank-accounts'; +export * from './cards'; +export * from './verification-sessions'; +export * from './financial-connections'; diff --git a/node_modules/@stripe/stripe-js/dist/api/index.d.ts b/node_modules/@stripe/stripe-js/dist/api/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..302a8a3a59cc375a745c25648c7cb6375a14bd36 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/index.d.ts @@ -0,0 +1,12 @@ +export * from './shared'; +export * from './payment-methods'; +export * from './confirmation-tokens'; +export * from './payment-intents'; +export * from './orders'; +export * from './setup-intents'; +export * from './sources'; +export * from './tokens'; +export * from './bank-accounts'; +export * from './cards'; +export * from './verification-sessions'; +export * from './financial-connections'; diff --git a/node_modules/@stripe/stripe-js/dist/api/orders.d.mts b/node_modules/@stripe/stripe-js/dist/api/orders.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..fadefb21e3d2672f77aa9f9e782833cf5e45fb99 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/orders.d.mts @@ -0,0 +1,122 @@ +import {Address} from './shared'; +import {PaymentIntent} from './payment-intents'; + +/** + * The Order object. + */ +export interface Order { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'order'; + + /** + * Total order cost after discounts and taxes are applied. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + */ + amount_total: number; + + /** + * Order cost before any discounts or taxes are applied. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + */ + amount_subtotal: number; + + /** + * Customer billing details associated with the order. + */ + billing_details: Order.Billing | null; + + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Customer shipping information associated with the order. + */ + shipping_details: Order.Shipping | null; + + /** + * Payment information associated with the order. + */ + payment: Order.Payment; + + /** + * The overall status of the order. + */ + status: Order.Status; +} + +export namespace Order { + export interface Billing { + /** + * Billing address for the order. + */ + address?: Address; + + /** + * Email address for the order. + */ + email?: string | null; + + /** + * Full name for the order. + */ + name?: string | null; + + /** + * Billing phone number for the order (including extension). + */ + phone?: string | null; + } + + export interface Shipping { + /** + * Recipient shipping address. Required if the order includes products that are shippable. + */ + address?: Address; + + /** + * Recipient name. + */ + name?: string | null; + + /** + * Recipient phone (including extension). + */ + phone?: string | null; + } + + export interface Payment { + /** + * Payment intent associated with this order. Null when the order is `open`. + */ + payment_intent?: PaymentIntent | null; + + /** + * The status of the underlying payment associated with this order, if any. Null when the order is `open`. + */ + status?: PaymentIntent.Status | null; + } + + export type Status = + | 'open' + | 'submitted' + | 'processing' + | 'complete' + | 'canceled'; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/orders.d.ts b/node_modules/@stripe/stripe-js/dist/api/orders.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fadefb21e3d2672f77aa9f9e782833cf5e45fb99 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/orders.d.ts @@ -0,0 +1,122 @@ +import {Address} from './shared'; +import {PaymentIntent} from './payment-intents'; + +/** + * The Order object. + */ +export interface Order { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'order'; + + /** + * Total order cost after discounts and taxes are applied. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + */ + amount_total: number; + + /** + * Order cost before any discounts or taxes are applied. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + */ + amount_subtotal: number; + + /** + * Customer billing details associated with the order. + */ + billing_details: Order.Billing | null; + + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Customer shipping information associated with the order. + */ + shipping_details: Order.Shipping | null; + + /** + * Payment information associated with the order. + */ + payment: Order.Payment; + + /** + * The overall status of the order. + */ + status: Order.Status; +} + +export namespace Order { + export interface Billing { + /** + * Billing address for the order. + */ + address?: Address; + + /** + * Email address for the order. + */ + email?: string | null; + + /** + * Full name for the order. + */ + name?: string | null; + + /** + * Billing phone number for the order (including extension). + */ + phone?: string | null; + } + + export interface Shipping { + /** + * Recipient shipping address. Required if the order includes products that are shippable. + */ + address?: Address; + + /** + * Recipient name. + */ + name?: string | null; + + /** + * Recipient phone (including extension). + */ + phone?: string | null; + } + + export interface Payment { + /** + * Payment intent associated with this order. Null when the order is `open`. + */ + payment_intent?: PaymentIntent | null; + + /** + * The status of the underlying payment associated with this order, if any. Null when the order is `open`. + */ + status?: PaymentIntent.Status | null; + } + + export type Status = + | 'open' + | 'submitted' + | 'processing' + | 'complete' + | 'canceled'; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/payment-intents.d.mts b/node_modules/@stripe/stripe-js/dist/api/payment-intents.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..6c83a4f3e103b75db159da264f9846585b5388ad --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/payment-intents.d.mts @@ -0,0 +1,330 @@ +import {Address, AddressParam} from './shared'; +import {PaymentMethod} from './payment-methods'; + +/** + * The PaymentIntent object. + */ +export interface PaymentIntent { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'payment_intent'; + + /** + * Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + */ + amount: number; + + /** + * Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. + */ + canceled_at: number | null; + + /** + * Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). + */ + cancellation_reason: PaymentIntent.CancellationReason | null; + + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method: PaymentIntent.CaptureMethod; + + /** + * The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. + * + * The client secret can be used to complete a payment from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + * + * Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment) and learn about how `client_secret` should be handled. + */ + client_secret: string | null; + + confirmation_method: PaymentIntent.ConfirmationMethod; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string | null; + + /** + * The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. + */ + last_payment_error: PaymentIntent.LastPaymentError | null; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + */ + next_action: PaymentIntent.NextAction | null; + + /** + * ID of the payment method used in this PaymentIntent, or the PaymentMethod itself if this field is expanded. + */ + payment_method: string | null | PaymentMethod; + + /** + * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + */ + payment_method_types: Array<string>; + + /** + * Email address that the receipt for the resulting payment will be sent to. + */ + receipt_email: string | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * If present, the payment method used with this PaymentIntent can be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer, even after the transaction completes. + * + * For more, learn to [save card details after a payment](https://stripe.com/docs/payments/save-after-payment). + * + * Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by [SCA](https://stripe.com/docs/strong-customer-authentication), using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect [off-session payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer. + */ + setup_future_usage: PaymentIntent.SetupFutureUsage | null; + + /** + * Shipping information for this PaymentIntent. + */ + shipping: PaymentIntent.Shipping | null; + + /** + * Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). + */ + status: PaymentIntent.Status; +} + +export namespace PaymentIntent { + export type CancellationReason = + | 'abandoned' + | 'automatic' + | 'duplicate' + | 'failed_invoice' + | 'fraudulent' + | 'requested_by_customer' + | 'void_invoice'; + + export type CaptureMethod = 'automatic' | 'manual'; + + export type ConfirmationMethod = 'automatic' | 'manual'; + + export interface LastPaymentError { + /** + * For card errors, the ID of the failed charge. + */ + charge?: string; + + /** + * For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + */ + code?: string; + + /** + * For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + */ + decline_code?: string; + + /** + * A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + */ + doc_url?: string; + + /** + * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + */ + message?: string; + + /** + * If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + */ + param?: string; + + payment_method?: PaymentMethod; + + /** + * The type of error returned. One of `api_connection_error`, `api_error`, `authentication_error`, `card_error`, `idempotency_error`, `invalid_request_error`, or `rate_limit_error` + */ + type: LastPaymentError.Type; + } + + export namespace LastPaymentError { + export type Type = + | 'api_connection_error' + | 'api_error' + | 'authentication_error' + | 'card_error' + | 'idempotency_error' + | 'invalid_request_error' + | 'rate_limit_error'; + } + + export interface NextAction { + redirect_to_url?: NextAction.RedirectToUrl; + + /** + * Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk` or `wechat_pay_display_qr_code`. + */ + type: string; + + /** + * Wechat Pay display qrcode + */ + wechat_pay_display_qr_code?: NextAction.WechatPayDisplayQrCode; + } + + export namespace NextAction { + export interface RedirectToUrl { + /** + * If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + */ + return_url: string | null; + + /** + * The URL you must redirect your customer to in order to authenticate the payment. + */ + url: string | null; + } + export interface WechatPayDisplayQrCode { + /** + * Render and display `paymentIntent.next_action.wechat_pay_display_qr_code.data` as a QR code on your checkout page. + */ + data: string; + + /** + * Use `paymentIntent.next_action.wechat_pay_display_qr_code.image_data_url` as an image source. + */ + image_data_url: string; + } + } + + export type SetupFutureUsage = 'off_session' | 'on_session'; + + export interface Shipping { + address?: Address; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string | null; + + /** + * Recipient name. + */ + name?: string | null; + + /** + * Recipient phone (including extension). + */ + phone?: string | null; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string | null; + } + + export type Status = + | 'canceled' + | 'processing' + | 'requires_action' + | 'requires_capture' + | 'requires_confirmation' + | 'requires_payment_method' + | 'succeeded'; +} + +export interface PaymentIntentConfirmParams { + /** + * This hash contains details about the Mandate to create + */ + mandate_data?: {[k: string]: any}; + + /** + * Email address that the receipt for the resulting payment will be sent to. + */ + receipt_email?: string | ''; + + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + * If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + * This parameter is only used for cards and other redirect-based payment methods. + */ + return_url?: string; + + /** + * If the PaymentIntent has a `payment_method` and a `customer` or if you're attaching a payment method to the PaymentIntent in this request, you can pass `save_payment_method=true` to save the payment method to the customer. Defaults to `false`. + * + * If the payment method is already saved to a customer, this does nothing. If this type of payment method cannot be saved to a customer, the request will error. + * + * _Note that saving a payment method using this parameter does not guarantee that the payment method can be charged._ To ensure that only payment methods which can be charged are saved to a customer, you can [manually save](https://stripe.com/docs/api/customers/create#create_customer-source) the payment method in response to the [`payment_intent.succeeded` webhook](https://stripe.com/docs/api/events/types#event_types-payment_intent.succeeded). + */ + save_payment_method?: boolean; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * If present, the payment method used with this PaymentIntent can be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer, even after the transaction completes. + * + * Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. + * + * Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by [SCA](https://stripe.com/docs/strong-customer-authentication), using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect [off-session payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer. + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: PaymentIntentConfirmParams.SetupFutureUsage | null; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: PaymentIntentConfirmParams.Shipping | null; +} + +export namespace PaymentIntentConfirmParams { + export type SetupFutureUsage = 'off_session' | 'on_session'; + + export interface Shipping { + /** + * Shipping address. + */ + address: AddressParam; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string; + + /** + * Recipient name. + */ + name: string; + + /** + * Recipient phone (including extension). + */ + phone?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string; + } +} diff --git a/node_modules/@stripe/stripe-js/dist/api/payment-intents.d.ts b/node_modules/@stripe/stripe-js/dist/api/payment-intents.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6c83a4f3e103b75db159da264f9846585b5388ad --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/payment-intents.d.ts @@ -0,0 +1,330 @@ +import {Address, AddressParam} from './shared'; +import {PaymentMethod} from './payment-methods'; + +/** + * The PaymentIntent object. + */ +export interface PaymentIntent { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'payment_intent'; + + /** + * Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + */ + amount: number; + + /** + * Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. + */ + canceled_at: number | null; + + /** + * Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). + */ + cancellation_reason: PaymentIntent.CancellationReason | null; + + /** + * Controls when the funds will be captured from the customer's account. + */ + capture_method: PaymentIntent.CaptureMethod; + + /** + * The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. + * + * The client secret can be used to complete a payment from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + * + * Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment) and learn about how `client_secret` should be handled. + */ + client_secret: string | null; + + confirmation_method: PaymentIntent.ConfirmationMethod; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string | null; + + /** + * The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. + */ + last_payment_error: PaymentIntent.LastPaymentError | null; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + */ + next_action: PaymentIntent.NextAction | null; + + /** + * ID of the payment method used in this PaymentIntent, or the PaymentMethod itself if this field is expanded. + */ + payment_method: string | null | PaymentMethod; + + /** + * The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + */ + payment_method_types: Array<string>; + + /** + * Email address that the receipt for the resulting payment will be sent to. + */ + receipt_email: string | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * If present, the payment method used with this PaymentIntent can be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer, even after the transaction completes. + * + * For more, learn to [save card details after a payment](https://stripe.com/docs/payments/save-after-payment). + * + * Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by [SCA](https://stripe.com/docs/strong-customer-authentication), using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect [off-session payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer. + */ + setup_future_usage: PaymentIntent.SetupFutureUsage | null; + + /** + * Shipping information for this PaymentIntent. + */ + shipping: PaymentIntent.Shipping | null; + + /** + * Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). + */ + status: PaymentIntent.Status; +} + +export namespace PaymentIntent { + export type CancellationReason = + | 'abandoned' + | 'automatic' + | 'duplicate' + | 'failed_invoice' + | 'fraudulent' + | 'requested_by_customer' + | 'void_invoice'; + + export type CaptureMethod = 'automatic' | 'manual'; + + export type ConfirmationMethod = 'automatic' | 'manual'; + + export interface LastPaymentError { + /** + * For card errors, the ID of the failed charge. + */ + charge?: string; + + /** + * For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + */ + code?: string; + + /** + * For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + */ + decline_code?: string; + + /** + * A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + */ + doc_url?: string; + + /** + * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + */ + message?: string; + + /** + * If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + */ + param?: string; + + payment_method?: PaymentMethod; + + /** + * The type of error returned. One of `api_connection_error`, `api_error`, `authentication_error`, `card_error`, `idempotency_error`, `invalid_request_error`, or `rate_limit_error` + */ + type: LastPaymentError.Type; + } + + export namespace LastPaymentError { + export type Type = + | 'api_connection_error' + | 'api_error' + | 'authentication_error' + | 'card_error' + | 'idempotency_error' + | 'invalid_request_error' + | 'rate_limit_error'; + } + + export interface NextAction { + redirect_to_url?: NextAction.RedirectToUrl; + + /** + * Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk` or `wechat_pay_display_qr_code`. + */ + type: string; + + /** + * Wechat Pay display qrcode + */ + wechat_pay_display_qr_code?: NextAction.WechatPayDisplayQrCode; + } + + export namespace NextAction { + export interface RedirectToUrl { + /** + * If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + */ + return_url: string | null; + + /** + * The URL you must redirect your customer to in order to authenticate the payment. + */ + url: string | null; + } + export interface WechatPayDisplayQrCode { + /** + * Render and display `paymentIntent.next_action.wechat_pay_display_qr_code.data` as a QR code on your checkout page. + */ + data: string; + + /** + * Use `paymentIntent.next_action.wechat_pay_display_qr_code.image_data_url` as an image source. + */ + image_data_url: string; + } + } + + export type SetupFutureUsage = 'off_session' | 'on_session'; + + export interface Shipping { + address?: Address; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string | null; + + /** + * Recipient name. + */ + name?: string | null; + + /** + * Recipient phone (including extension). + */ + phone?: string | null; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string | null; + } + + export type Status = + | 'canceled' + | 'processing' + | 'requires_action' + | 'requires_capture' + | 'requires_confirmation' + | 'requires_payment_method' + | 'succeeded'; +} + +export interface PaymentIntentConfirmParams { + /** + * This hash contains details about the Mandate to create + */ + mandate_data?: {[k: string]: any}; + + /** + * Email address that the receipt for the resulting payment will be sent to. + */ + receipt_email?: string | ''; + + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + * If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + * This parameter is only used for cards and other redirect-based payment methods. + */ + return_url?: string; + + /** + * If the PaymentIntent has a `payment_method` and a `customer` or if you're attaching a payment method to the PaymentIntent in this request, you can pass `save_payment_method=true` to save the payment method to the customer. Defaults to `false`. + * + * If the payment method is already saved to a customer, this does nothing. If this type of payment method cannot be saved to a customer, the request will error. + * + * _Note that saving a payment method using this parameter does not guarantee that the payment method can be charged._ To ensure that only payment methods which can be charged are saved to a customer, you can [manually save](https://stripe.com/docs/api/customers/create#create_customer-source) the payment method in response to the [`payment_intent.succeeded` webhook](https://stripe.com/docs/api/events/types#event_types-payment_intent.succeeded). + */ + save_payment_method?: boolean; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + * If present, the payment method used with this PaymentIntent can be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer, even after the transaction completes. + * + * Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. + * + * Stripe uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by [SCA](https://stripe.com/docs/strong-customer-authentication), using `off_session` will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect [off-session payments](https://stripe.com/docs/payments/cards/charging-saved-cards#off-session-payments-with-saved-cards) for this customer. + * + * If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + */ + setup_future_usage?: PaymentIntentConfirmParams.SetupFutureUsage | null; + + /** + * Shipping information for this PaymentIntent. + */ + shipping?: PaymentIntentConfirmParams.Shipping | null; +} + +export namespace PaymentIntentConfirmParams { + export type SetupFutureUsage = 'off_session' | 'on_session'; + + export interface Shipping { + /** + * Shipping address. + */ + address: AddressParam; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string; + + /** + * Recipient name. + */ + name: string; + + /** + * Recipient phone (including extension). + */ + phone?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string; + } +} diff --git a/node_modules/@stripe/stripe-js/dist/api/payment-methods.d.mts b/node_modules/@stripe/stripe-js/dist/api/payment-methods.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..1a8778176fc583d81ced175fc7ded4d2ee02e2af --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/payment-methods.d.mts @@ -0,0 +1,452 @@ +import {StripeElement, StripeElements} from '../stripe-js'; +import {Metadata, MetadataParam, Address} from './shared'; + +/** + * The PaymentMethod object. + */ +export interface PaymentMethod { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'payment_method'; + + billing_details: PaymentMethod.BillingDetails; + + card?: PaymentMethod.Card; + + card_present?: PaymentMethod.CardPresent; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. + */ + customer: string | null; + + eps?: PaymentMethod.Eps; + + fpx?: PaymentMethod.Fpx; + + grabpay?: PaymentMethod.GrabPay; + + ideal?: PaymentMethod.Ideal; + + p24?: PaymentMethod.P24; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata: Metadata; + + sepa_debit?: PaymentMethod.SepaDebit; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type: string; + + affirm?: PaymentMethod.Affirm; + + afterpay_clearpay?: PaymentMethod.AfterpayClearpay; + + acss_debit?: PaymentMethod.AcssDebit; + + au_becs_debit?: PaymentMethod.AuBecsDebit; + + us_bank_account?: PaymentMethod.UsBankAccount; +} + +export namespace PaymentMethod { + export interface AuBecsDebit { + /** + * Bank State Branch + */ + bsb_number: string | null; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + */ + fingerprint: string | null; + + /** + * Last four characters of the account number. + */ + last4: string | null; + } + + export interface BillingDetails { + /** + * Billing address. + */ + address: Address | null; + + /** + * Email address. + */ + email: string | null; + + /** + * Full name. + */ + name: string | null; + + /** + * Billing phone number (including extension). + */ + phone: string | null; + } + + export interface Card { + /** + * Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + */ + brand: string; + + /** + * Checks on Card address and CVC if provided. + */ + checks: Card.Checks | null; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + */ + country: string | null; + + /** + * Two-digit number representing the card's expiration month. + */ + exp_month: number; + + /** + * Four-digit number representing the card's expiration year. + */ + exp_year: number; + + /** + * Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number. + */ + fingerprint?: string | null; + + /** + * Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + */ + funding: string; + + /** + * The last four digits of the card. + */ + last4: string; + + /** + * Contains details on how this Card maybe be used for 3D Secure authentication. + */ + three_d_secure_usage: Card.ThreeDSecureUsage | null; + + /** + * If this Card is part of a card wallet, this contains the details of the card wallet. + */ + wallet: null | {[k: string]: any}; + } + + export namespace Card { + export interface Checks { + /** + * If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + */ + address_line1_check: string | null; + + /** + * If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + */ + address_postal_code_check: string | null; + + /** + * If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + */ + cvc_check: string | null; + } + + export interface ThreeDSecureUsage { + /** + * Whether 3D Secure is supported on this card. + */ + supported: boolean; + } + } + + export interface CardPresent {} + + export interface Eps { + /** + * The customer's bank. + */ + bank: string; + } + + export interface Fpx { + /** + * The customer's bank. + */ + bank: string; + } + + export interface GrabPay {} + + export interface Ideal { + /** + * The customer's bank, if provided. + */ + bank: string | null; + + /** + * The Bank Identifier Code of the customer's bank, if the bank was provided. + */ + bic: string | null; + } + + export interface P24 { + /** + * The customer's bank. + */ + bank: string; + } + + export interface SepaDebit { + /** + * Bank code of bank associated with the bank account. + */ + bank_code: string | null; + + /** + * Branch code of bank associated with the bank account. + */ + branch_code: string | null; + + /** + * Two-letter ISO code representing the country the bank account is located in. + */ + country: string | null; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + */ + fingerprint: string | null; + + /** + * Last four characters of the IBAN. + */ + last4: string | null; + } + + export interface Affirm {} + + export interface AfterpayClearpay {} + + export interface AcssDebit { + /** + * Customer’s bank account number. + */ + account_number: string; + + /** + * Institution number of the customer’s bank. + */ + institution_number: string; + + /** + * Transit number of the customer’s bank. + */ + transit_number: string; + } + + export interface UsBankAccount { + /** + * Customer’s bank account number. + */ + account_number: string; + + /** + * The routing transit number for the bank account. + */ + routing_number: string; + + /** + * The type of entity that holds the account. This can be either `individual` or `company`. + */ + account_holder_type: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type: string; + + /** + * The name of the bank. + */ + bank_name: string; + + /** + * The ID of the Financial Connections Account used to create the payment method. + */ + financial_connections_account: string; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + */ + fingerprint: string; + + /** + * Last four digits of the bank account number. + */ + last4: string; + + /** + * Contains information about US bank account networks that can be used. + */ + networks: { + /** + * The preferred network. + */ + preferred: string; + + /** + * All supported networks. + */ + supported: string[]; + }; + } +} + +export interface PaymentMethodCreateParams { + /** + * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + */ + billing_details?: PaymentMethodCreateParams.BillingDetails; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: MetadataParam; + + /** + * The PaymentMethod to share. + */ + payment_method?: string; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. Required unless `payment_method` is specified (see the [Cloning PaymentMethods](https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods) guide) + */ + type?: string; +} + +export interface CreatePaymentMethodFromElements { + /** + * The Elements instance + * + * @docs https://stripe.com/docs/js/elements_object + */ + elements: StripeElements; + + /** + * Parameters that will be passed on to the PaymentMethod API + * + * @docs https://stripe.com/docs/api/payment_methods/create + */ + params?: PaymentMethodCreateParams; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: MetadataParam; +} +export interface CreatePaymentMethodFromElement { + /** + * The specific Element used to collect payment details + * + * @docs https://stripe.com/docs/js/element + */ + element: StripeElement; + + /** + * Parameters that will be passed on to the PaymentMethod API + * + * @docs https://stripe.com/docs/api/payment_methods/create + */ + params?: PaymentMethodCreateParams; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: MetadataParam; +} + +export namespace PaymentMethodCreateParams { + export interface BillingDetails { + /** + * Billing address. + */ + address?: BillingDetails.Address; + + /** + * Email address. + */ + email?: string; + + /** + * Full name. + */ + name?: string; + + /** + * Billing phone number (including extension). + */ + phone?: string; + } + + export namespace BillingDetails { + export interface Address { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + } +} diff --git a/node_modules/@stripe/stripe-js/dist/api/payment-methods.d.ts b/node_modules/@stripe/stripe-js/dist/api/payment-methods.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1a8778176fc583d81ced175fc7ded4d2ee02e2af --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/payment-methods.d.ts @@ -0,0 +1,452 @@ +import {StripeElement, StripeElements} from '../stripe-js'; +import {Metadata, MetadataParam, Address} from './shared'; + +/** + * The PaymentMethod object. + */ +export interface PaymentMethod { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'payment_method'; + + billing_details: PaymentMethod.BillingDetails; + + card?: PaymentMethod.Card; + + card_present?: PaymentMethod.CardPresent; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. + */ + customer: string | null; + + eps?: PaymentMethod.Eps; + + fpx?: PaymentMethod.Fpx; + + grabpay?: PaymentMethod.GrabPay; + + ideal?: PaymentMethod.Ideal; + + p24?: PaymentMethod.P24; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata: Metadata; + + sepa_debit?: PaymentMethod.SepaDebit; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ + type: string; + + affirm?: PaymentMethod.Affirm; + + afterpay_clearpay?: PaymentMethod.AfterpayClearpay; + + acss_debit?: PaymentMethod.AcssDebit; + + au_becs_debit?: PaymentMethod.AuBecsDebit; + + us_bank_account?: PaymentMethod.UsBankAccount; +} + +export namespace PaymentMethod { + export interface AuBecsDebit { + /** + * Bank State Branch + */ + bsb_number: string | null; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + */ + fingerprint: string | null; + + /** + * Last four characters of the account number. + */ + last4: string | null; + } + + export interface BillingDetails { + /** + * Billing address. + */ + address: Address | null; + + /** + * Email address. + */ + email: string | null; + + /** + * Full name. + */ + name: string | null; + + /** + * Billing phone number (including extension). + */ + phone: string | null; + } + + export interface Card { + /** + * Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + */ + brand: string; + + /** + * Checks on Card address and CVC if provided. + */ + checks: Card.Checks | null; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + */ + country: string | null; + + /** + * Two-digit number representing the card's expiration month. + */ + exp_month: number; + + /** + * Four-digit number representing the card's expiration year. + */ + exp_year: number; + + /** + * Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number. + */ + fingerprint?: string | null; + + /** + * Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + */ + funding: string; + + /** + * The last four digits of the card. + */ + last4: string; + + /** + * Contains details on how this Card maybe be used for 3D Secure authentication. + */ + three_d_secure_usage: Card.ThreeDSecureUsage | null; + + /** + * If this Card is part of a card wallet, this contains the details of the card wallet. + */ + wallet: null | {[k: string]: any}; + } + + export namespace Card { + export interface Checks { + /** + * If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + */ + address_line1_check: string | null; + + /** + * If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + */ + address_postal_code_check: string | null; + + /** + * If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + */ + cvc_check: string | null; + } + + export interface ThreeDSecureUsage { + /** + * Whether 3D Secure is supported on this card. + */ + supported: boolean; + } + } + + export interface CardPresent {} + + export interface Eps { + /** + * The customer's bank. + */ + bank: string; + } + + export interface Fpx { + /** + * The customer's bank. + */ + bank: string; + } + + export interface GrabPay {} + + export interface Ideal { + /** + * The customer's bank, if provided. + */ + bank: string | null; + + /** + * The Bank Identifier Code of the customer's bank, if the bank was provided. + */ + bic: string | null; + } + + export interface P24 { + /** + * The customer's bank. + */ + bank: string; + } + + export interface SepaDebit { + /** + * Bank code of bank associated with the bank account. + */ + bank_code: string | null; + + /** + * Branch code of bank associated with the bank account. + */ + branch_code: string | null; + + /** + * Two-letter ISO code representing the country the bank account is located in. + */ + country: string | null; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + */ + fingerprint: string | null; + + /** + * Last four characters of the IBAN. + */ + last4: string | null; + } + + export interface Affirm {} + + export interface AfterpayClearpay {} + + export interface AcssDebit { + /** + * Customer’s bank account number. + */ + account_number: string; + + /** + * Institution number of the customer’s bank. + */ + institution_number: string; + + /** + * Transit number of the customer’s bank. + */ + transit_number: string; + } + + export interface UsBankAccount { + /** + * Customer’s bank account number. + */ + account_number: string; + + /** + * The routing transit number for the bank account. + */ + routing_number: string; + + /** + * The type of entity that holds the account. This can be either `individual` or `company`. + */ + account_holder_type: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type: string; + + /** + * The name of the bank. + */ + bank_name: string; + + /** + * The ID of the Financial Connections Account used to create the payment method. + */ + financial_connections_account: string; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + */ + fingerprint: string; + + /** + * Last four digits of the bank account number. + */ + last4: string; + + /** + * Contains information about US bank account networks that can be used. + */ + networks: { + /** + * The preferred network. + */ + preferred: string; + + /** + * All supported networks. + */ + supported: string[]; + }; + } +} + +export interface PaymentMethodCreateParams { + /** + * Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + */ + billing_details?: PaymentMethodCreateParams.BillingDetails; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: MetadataParam; + + /** + * The PaymentMethod to share. + */ + payment_method?: string; + + /** + * The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. Required unless `payment_method` is specified (see the [Cloning PaymentMethods](https://stripe.com/docs/payments/payment-methods/connect#cloning-payment-methods) guide) + */ + type?: string; +} + +export interface CreatePaymentMethodFromElements { + /** + * The Elements instance + * + * @docs https://stripe.com/docs/js/elements_object + */ + elements: StripeElements; + + /** + * Parameters that will be passed on to the PaymentMethod API + * + * @docs https://stripe.com/docs/api/payment_methods/create + */ + params?: PaymentMethodCreateParams; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: MetadataParam; +} +export interface CreatePaymentMethodFromElement { + /** + * The specific Element used to collect payment details + * + * @docs https://stripe.com/docs/js/element + */ + element: StripeElement; + + /** + * Parameters that will be passed on to the PaymentMethod API + * + * @docs https://stripe.com/docs/api/payment_methods/create + */ + params?: PaymentMethodCreateParams; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: MetadataParam; +} + +export namespace PaymentMethodCreateParams { + export interface BillingDetails { + /** + * Billing address. + */ + address?: BillingDetails.Address; + + /** + * Email address. + */ + email?: string; + + /** + * Full name. + */ + name?: string; + + /** + * Billing phone number (including extension). + */ + phone?: string; + } + + export namespace BillingDetails { + export interface Address { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + } +} diff --git a/node_modules/@stripe/stripe-js/dist/api/setup-intents.d.mts b/node_modules/@stripe/stripe-js/dist/api/setup-intents.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..54faaf46e2425a8a4fd8e4b49cd401ef90b11bc2 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/setup-intents.d.mts @@ -0,0 +1,184 @@ +import {PaymentMethod} from './payment-methods'; + +/** + * The SetupIntent object. + */ +export interface SetupIntent { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'setup_intent'; + + /** + * Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. + */ + cancellation_reason: SetupIntent.CancellationReason | null; + + /** + * The client secret of this SetupIntent. Used for client-side retrieval using a publishable key. + * + * The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + */ + client_secret: string | null; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string | null; + + /** + * The error encountered in the previous SetupIntent confirmation. + */ + last_setup_error: SetupIntent.LastSetupError | null; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * If present, this property tells you what actions you need to take in order for your customer to continue payment setup. + */ + next_action: SetupIntent.NextAction | null; + + /** + * ID of the payment method used with this SetupIntent, or the PaymentMethod itself if this field is expanded. + */ + payment_method: string | null | PaymentMethod; + + /** + * The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. + */ + payment_method_types: Array<string>; + + /** + * [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. + */ + status: SetupIntent.Status; + + /** + * Indicates how the payment method is intended to be used in the future. + * + * Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`. + */ + usage: string; +} + +export namespace SetupIntent { + export type CancellationReason = + | 'abandoned' + | 'duplicate' + | 'requested_by_customer'; + + export interface LastSetupError { + /** + * For card errors, the ID of the failed charge. + */ + charge?: string; + + /** + * For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + */ + code?: string; + + /** + * For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + */ + decline_code?: string; + + /** + * A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + */ + doc_url?: string; + + /** + * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + */ + message?: string; + + /** + * If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + */ + param?: string; + + payment_method?: PaymentMethod; + + /** + * The type of error returned. One of `api_connection_error`, `api_error`, `authentication_error`, `card_error`, `idempotency_error`, `invalid_request_error`, or `rate_limit_error` + */ + type: LastSetupError.Type; + } + + export namespace LastSetupError { + export type Type = + | 'api_connection_error' + | 'api_error' + | 'authentication_error' + | 'card_error' + | 'idempotency_error' + | 'invalid_request_error' + | 'rate_limit_error'; + } + + export interface NextAction { + redirect_to_url?: NextAction.RedirectToUrl; + + /** + * Type of the next action to perform, one of `redirect_to_url` or `use_stripe_sdk`. + */ + type: string; + + /** + * When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. + */ + use_stripe_sdk?: NextAction.UseStripeSdk; + } + + export namespace NextAction { + export interface RedirectToUrl { + /** + * If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + */ + return_url: string | null; + + /** + * The URL you must redirect your customer to in order to authenticate. + */ + url: string | null; + } + + export interface UseStripeSdk {} + } + + export type Status = + | 'canceled' + | 'processing' + | 'requires_action' + | 'requires_confirmation' + | 'requires_payment_method' + | 'succeeded'; +} + +export interface SetupIntentConfirmParams { + /** + * This hash contains details about the Mandate to create + */ + mandate_data?: {[k: string]: any}; + + /** + * The URL to redirect your customer back to after they authenticate on the payment method's app or site. + * If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + * This parameter is only used for cards and other redirect-based payment methods. + */ + return_url?: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/setup-intents.d.ts b/node_modules/@stripe/stripe-js/dist/api/setup-intents.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..54faaf46e2425a8a4fd8e4b49cd401ef90b11bc2 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/setup-intents.d.ts @@ -0,0 +1,184 @@ +import {PaymentMethod} from './payment-methods'; + +/** + * The SetupIntent object. + */ +export interface SetupIntent { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'setup_intent'; + + /** + * Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. + */ + cancellation_reason: SetupIntent.CancellationReason | null; + + /** + * The client secret of this SetupIntent. Used for client-side retrieval using a publishable key. + * + * The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + */ + client_secret: string | null; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * An arbitrary string attached to the object. Often useful for displaying to users. + */ + description: string | null; + + /** + * The error encountered in the previous SetupIntent confirmation. + */ + last_setup_error: SetupIntent.LastSetupError | null; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * If present, this property tells you what actions you need to take in order for your customer to continue payment setup. + */ + next_action: SetupIntent.NextAction | null; + + /** + * ID of the payment method used with this SetupIntent, or the PaymentMethod itself if this field is expanded. + */ + payment_method: string | null | PaymentMethod; + + /** + * The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. + */ + payment_method_types: Array<string>; + + /** + * [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. + */ + status: SetupIntent.Status; + + /** + * Indicates how the payment method is intended to be used in the future. + * + * Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`. + */ + usage: string; +} + +export namespace SetupIntent { + export type CancellationReason = + | 'abandoned' + | 'duplicate' + | 'requested_by_customer'; + + export interface LastSetupError { + /** + * For card errors, the ID of the failed charge. + */ + charge?: string; + + /** + * For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + */ + code?: string; + + /** + * For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + */ + decline_code?: string; + + /** + * A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + */ + doc_url?: string; + + /** + * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + */ + message?: string; + + /** + * If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + */ + param?: string; + + payment_method?: PaymentMethod; + + /** + * The type of error returned. One of `api_connection_error`, `api_error`, `authentication_error`, `card_error`, `idempotency_error`, `invalid_request_error`, or `rate_limit_error` + */ + type: LastSetupError.Type; + } + + export namespace LastSetupError { + export type Type = + | 'api_connection_error' + | 'api_error' + | 'authentication_error' + | 'card_error' + | 'idempotency_error' + | 'invalid_request_error' + | 'rate_limit_error'; + } + + export interface NextAction { + redirect_to_url?: NextAction.RedirectToUrl; + + /** + * Type of the next action to perform, one of `redirect_to_url` or `use_stripe_sdk`. + */ + type: string; + + /** + * When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. + */ + use_stripe_sdk?: NextAction.UseStripeSdk; + } + + export namespace NextAction { + export interface RedirectToUrl { + /** + * If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + */ + return_url: string | null; + + /** + * The URL you must redirect your customer to in order to authenticate. + */ + url: string | null; + } + + export interface UseStripeSdk {} + } + + export type Status = + | 'canceled' + | 'processing' + | 'requires_action' + | 'requires_confirmation' + | 'requires_payment_method' + | 'succeeded'; +} + +export interface SetupIntentConfirmParams { + /** + * This hash contains details about the Mandate to create + */ + mandate_data?: {[k: string]: any}; + + /** + * The URL to redirect your customer back to after they authenticate on the payment method's app or site. + * If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + * This parameter is only used for cards and other redirect-based payment methods. + */ + return_url?: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/shared.d.mts b/node_modules/@stripe/stripe-js/dist/api/shared.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..f7b0b7f07ff748d3e804a88d41b0b7d84638d35f --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/shared.d.mts @@ -0,0 +1,125 @@ +/** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ +export interface Metadata { + [name: string]: string; +} + +/** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * While you can send values as numbers, they will be returned as strings. + */ +export interface MetadataParam { + [name: string]: string | number | null; +} + +/** + * The Address object. + */ +export interface Address { + /** + * City/District/Suburb/Town/Village. + */ + city: string | null; + + /** + * 2-letter country code. + */ + country: string | null; + + /** + * Address line 1 (Street address/PO Box/Company name). + */ + line1: string | null; + + /** + * Address line 2 (Apartment/Suite/Unit/Building). + */ + line2: string | null; + + /** + * ZIP or postal code. + */ + postal_code: string | null; + + /** + * State/County/Province/Region. + */ + state: string | null; +} + +export interface AccountAddressParam { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; +} + +export interface AddressParam extends AccountAddressParam { + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1: string; +} + +export interface JapanAddressParam { + /** + * City or ward. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Block or building number. + */ + line1?: string; + + /** + * Building details. + */ + line2?: string; + + /** + * Postal code. + */ + postal_code?: string; + + /** + * Prefecture. + */ + state?: string; + + /** + * Town or cho-me. + */ + town?: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/shared.d.ts b/node_modules/@stripe/stripe-js/dist/api/shared.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f7b0b7f07ff748d3e804a88d41b0b7d84638d35f --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/shared.d.ts @@ -0,0 +1,125 @@ +/** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ +export interface Metadata { + [name: string]: string; +} + +/** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * While you can send values as numbers, they will be returned as strings. + */ +export interface MetadataParam { + [name: string]: string | number | null; +} + +/** + * The Address object. + */ +export interface Address { + /** + * City/District/Suburb/Town/Village. + */ + city: string | null; + + /** + * 2-letter country code. + */ + country: string | null; + + /** + * Address line 1 (Street address/PO Box/Company name). + */ + line1: string | null; + + /** + * Address line 2 (Apartment/Suite/Unit/Building). + */ + line2: string | null; + + /** + * ZIP or postal code. + */ + postal_code: string | null; + + /** + * State/County/Province/Region. + */ + state: string | null; +} + +export interface AccountAddressParam { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; +} + +export interface AddressParam extends AccountAddressParam { + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1: string; +} + +export interface JapanAddressParam { + /** + * City or ward. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Block or building number. + */ + line1?: string; + + /** + * Building details. + */ + line2?: string; + + /** + * Postal code. + */ + postal_code?: string; + + /** + * Prefecture. + */ + state?: string; + + /** + * Town or cho-me. + */ + town?: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/sources.d.mts b/node_modules/@stripe/stripe-js/dist/api/sources.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..d9105898180ce3274409f1c121eb5a082687f0e3 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/sources.d.mts @@ -0,0 +1,1045 @@ +import {Address, AddressParam, Metadata, MetadataParam} from './shared'; + +/** + * The Source object. + */ +export interface Source { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'source'; + + ach_credit_transfer?: Source.AchCreditTransfer; + + ach_debit?: Source.AchDebit; + + acss_debit?: Source.AcssDebit; + + alipay?: Source.Alipay; + + /** + * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. + */ + amount: number | null; + + au_becs_debit?: Source.AuBecsDebit; + + bancontact?: Source.Bancontact; + + card?: Source.Card; + + card_present?: Source.CardPresent; + + /** + * The client secret of the source. Used for client-side retrieval using a publishable key. + */ + client_secret: string; + + code_verification?: Source.CodeVerification; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. Required for `single_use` sources. + */ + currency: string | null; + + /** + * The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. + */ + customer?: string; + + eps?: Source.Eps; + + /** + * The authentication `flow` of the source. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. + */ + flow: string; + + giropay?: Source.Giropay; + + ideal?: Source.Ideal; + + klarna?: Source.Klarna; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata: Metadata | null; + + multibanco?: Source.Multibanco; + + /** + * Information about the owner of the payment instrument that may be used or required by particular source types. + */ + owner: Source.Owner | null; + + p24?: Source.P24; + + receiver?: Source.Receiver; + + redirect?: Source.Redirect; + + sepa_credit_transfer?: Source.SepaCreditTransfer; + + sepa_debit?: Source.SepaDebit; + + sofort?: Source.Sofort; + + source_order?: Source.SourceOrder; + + /** + * Extra information about a source. This will appear on your customer's statement every time you charge the source. + */ + statement_descriptor: string | null; + + /** + * The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`. Only `chargeable` sources can be used to create a charge. + */ + status: string; + + three_d_secure?: Source.ThreeDSecure; + + /** + * The `type` of the source. The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. An additional hash is included on the source with a name matching this value. It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. + */ + type: Source.Type; + + /** + * Either `reusable` or `single_use`. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. + */ + usage: string | null; + + wechat?: Source.Wechat; +} + +export namespace Source { + export interface AchCreditTransfer { + account_number?: string | null; + + bank_name?: string | null; + + fingerprint?: string | null; + + refund_account_holder_name?: string | null; + + refund_account_holder_type?: string | null; + + refund_routing_number?: string | null; + + routing_number?: string | null; + + swift_code?: string | null; + } + + export interface AchDebit { + bank_name?: string | null; + + country?: string | null; + + fingerprint?: string | null; + + last4?: string | null; + + routing_number?: string | null; + + type?: string | null; + } + + export interface AcssDebit { + bank_address_city?: string | null; + + bank_address_line_1?: string | null; + + bank_address_line_2?: string | null; + + bank_address_postal_code?: string | null; + + bank_name?: string | null; + + category?: string | null; + + country?: string | null; + + fingerprint?: string | null; + + last4?: string | null; + + routing_number?: string | null; + } + + export interface Alipay { + data_string?: string | null; + + native_url?: string | null; + + statement_descriptor?: string | null; + } + + export interface AuBecsDebit { + bsb_number?: string | null; + + fingerprint?: string | null; + + last4?: string | null; + } + + export interface Bancontact { + bank_code?: string | null; + + bank_name?: string | null; + + bic?: string | null; + + iban_last4?: string | null; + + preferred_language?: string | null; + + statement_descriptor?: string | null; + } + + export interface Card { + address_line1_check?: string | null; + + address_zip_check?: string | null; + + brand?: string | null; + + country?: string | null; + + cvc_check?: string | null; + + description?: string; + + dynamic_last4?: string | null; + + exp_month?: number | null; + + exp_year?: number | null; + + fingerprint?: string; + + funding?: string | null; + + iin?: string; + + issuer?: string; + + last4?: string | null; + + name?: string | null; + + three_d_secure?: string; + + tokenization_method?: string | null; + } + + export interface CardPresent { + application_cryptogram?: string; + + application_preferred_name?: string; + + authorization_code?: string | null; + + authorization_response_code?: string; + + brand?: string | null; + + country?: string | null; + + cvm_type?: string; + + data_type?: string | null; + + dedicated_file_name?: string; + + description?: string; + + emv_auth_data?: string; + + evidence_customer_signature?: string | null; + + evidence_transaction_certificate?: string | null; + + exp_month?: number | null; + + exp_year?: number | null; + + fingerprint?: string; + + funding?: string | null; + + iin?: string; + + issuer?: string; + + last4?: string | null; + + pos_device_id?: string | null; + + pos_entry_mode?: string; + + read_method?: string | null; + + reader?: string | null; + + terminal_verification_results?: string; + + transaction_status_information?: string; + } + + export interface CodeVerification { + /** + * The number of attempts remaining to authenticate the source object with a verification code. + */ + attempts_remaining: number; + + /** + * The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0). + */ + status: string; + } + + export interface Eps { + reference?: string | null; + + statement_descriptor?: string | null; + } + + export interface Giropay { + bank_code?: string | null; + + bank_name?: string | null; + + bic?: string | null; + + statement_descriptor?: string | null; + } + + export interface Ideal { + bank?: string | null; + + bic?: string | null; + + iban_last4?: string | null; + + statement_descriptor?: string | null; + } + + export interface Klarna { + background_image_url?: string; + + client_token?: string | null; + + first_name?: string; + + last_name?: string; + + locale?: string; + + logo_url?: string; + + page_title?: string; + + pay_later_asset_urls_descriptive?: string; + + pay_later_asset_urls_standard?: string; + + pay_later_name?: string; + + pay_later_redirect_url?: string; + + pay_now_asset_urls_descriptive?: string; + + pay_now_asset_urls_standard?: string; + + pay_now_name?: string; + + pay_now_redirect_url?: string; + + pay_over_time_asset_urls_descriptive?: string; + + pay_over_time_asset_urls_standard?: string; + + pay_over_time_name?: string; + + pay_over_time_redirect_url?: string; + + payment_method_categories?: string; + + purchase_country?: string; + + purchase_type?: string; + + redirect_url?: string; + + shipping_first_name?: string; + + shipping_last_name?: string; + } + + export interface Multibanco { + entity?: string | null; + + reference?: string | null; + + refund_account_holder_address_city?: string | null; + + refund_account_holder_address_country?: string | null; + + refund_account_holder_address_line1?: string | null; + + refund_account_holder_address_line2?: string | null; + + refund_account_holder_address_postal_code?: string | null; + + refund_account_holder_address_state?: string | null; + + refund_account_holder_name?: string | null; + + refund_iban?: string | null; + } + + export interface Owner { + /** + * Owner's address. + */ + address: Address | null; + + /** + * Owner's email address. + */ + email: string | null; + + /** + * Owner's full name. + */ + name: string | null; + + /** + * Owner's phone number (including extension). + */ + phone: string | null; + + /** + * Verified owner's address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + verified_address: Address | null; + + /** + * Verified owner's email address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + verified_email: string | null; + + /** + * Verified owner's full name. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + verified_name: string | null; + + /** + * Verified owner's phone number (including extension). Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + verified_phone: string | null; + } + + export interface P24 { + reference?: string | null; + } + + export interface Receiver { + /** + * The address of the receiver source. This is the value that should be communicated to the customer to send their funds to. + */ + address: string | null; + + /** + * The total amount that was charged by you. The amount charged is expressed in the source's currency. + */ + amount_charged: number; + + /** + * The total amount received by the receiver source. `amount_received = amount_returned + amount_charged` is true at all time. The amount received is expressed in the source's currency. + */ + amount_received: number; + + /** + * The total amount that was returned to the customer. The amount returned is expressed in the source's currency. + */ + amount_returned: number; + + /** + * Type of refund attribute method, one of `email`, `manual`, or `none`. + */ + refund_attributes_method: string; + + /** + * Type of refund attribute status, one of `missing`, `requested`, or `available`. + */ + refund_attributes_status: string; + } + + export interface Redirect { + /** + * The failure reason for the redirect, either `user_abort` (the customer aborted or dropped out of the redirect flow), `declined` (the authentication failed or the transaction was declined), or `processing_error` (the redirect failed due to a technical error). Present only if the redirect status is `failed`. + */ + failure_reason: string | null; + + /** + * The URL you provide to redirect the customer to after they authenticated their payment. + */ + return_url: string; + + /** + * The status of the redirect, either `pending` (ready to be used by your customer to authenticate the transaction), `succeeded` (succesful authentication, cannot be reused) or `not_required` (redirect should not be used) or `failed` (failed authentication, cannot be reused). + */ + status: string; + + /** + * The URL provided to you to redirect a customer to as part of a `redirect` authentication flow. + */ + url: string; + } + + export interface SepaCreditTransfer { + bank_name?: string | null; + + bic?: string | null; + + iban?: string | null; + + refund_account_holder_address_city?: string | null; + + refund_account_holder_address_country?: string | null; + + refund_account_holder_address_line1?: string | null; + + refund_account_holder_address_line2?: string | null; + + refund_account_holder_address_postal_code?: string | null; + + refund_account_holder_address_state?: string | null; + + refund_account_holder_name?: string | null; + + refund_iban?: string | null; + } + + export interface SepaDebit { + bank_code?: string | null; + + branch_code?: string | null; + + country?: string | null; + + fingerprint?: string | null; + + last4?: string | null; + + mandate_reference?: string | null; + + mandate_url?: string | null; + } + + export interface Sofort { + bank_code?: string | null; + + bank_name?: string | null; + + bic?: string | null; + + country?: string | null; + + iban_last4?: string | null; + + preferred_language?: string | null; + + statement_descriptor?: string | null; + } + + export interface SourceOrder { + /** + * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. + */ + amount: number; + + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The email address of the customer placing the order. + */ + email?: string; + + /** + * List of items constituting the order. + */ + items: Array<SourceOrder.Item> | null; + + shipping?: SourceOrder.Shipping; + } + + export namespace SourceOrder { + export interface Item { + /** + * The amount (price) for this order item. + */ + amount: number | null; + + /** + * This currency of this order item. Required when `amount` is present. + */ + currency: string | null; + + /** + * Human-readable description for this order item. + */ + description: string | null; + + /** + * The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. + */ + quantity?: number; + + /** + * The type of this order item. Must be `sku`, `tax`, or `shipping`. + */ + type: string | null; + } + + export interface Shipping { + address?: Address; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string | null; + + /** + * Recipient name. + */ + name?: string | null; + + /** + * Recipient phone (including extension). + */ + phone?: string | null; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string | null; + } + } + + export interface ThreeDSecure { + address_line1_check?: string | null; + + address_zip_check?: string | null; + + authenticated?: boolean | null; + + brand?: string | null; + + card?: string | null; + + country?: string | null; + + customer?: string | null; + + cvc_check?: string | null; + + description?: string; + + dynamic_last4?: string | null; + + exp_month?: number | null; + + exp_year?: number | null; + + fingerprint?: string; + + funding?: string | null; + + iin?: string; + + issuer?: string; + + last4?: string | null; + + name?: string | null; + + three_d_secure?: string; + + tokenization_method?: string | null; + } + + export type Type = + | 'ach_credit_transfer' + | 'ach_debit' + | 'acss_debit' + | 'alipay' + | 'au_becs_debit' + | 'bancontact' + | 'card' + | 'card_present' + | 'eps' + | 'giropay' + | 'ideal' + | 'klarna' + | 'multibanco' + | 'p24' + | 'sepa_credit_transfer' + | 'sepa_debit' + | 'sofort' + | 'three_d_secure' + | 'wechat'; + + export interface Wechat { + prepay_id?: string; + + qr_code_url?: string | null; + + statement_descriptor?: string; + } +} + +export interface SourceCreateParams { + /** + * Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. Not supported for `receiver` type sources, where charge amount may not be specified until funds land. + */ + amount?: number; + + /** + * Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. + */ + currency?: string; + + /** + * The `Customer` to whom the original source is attached to. Must be set when the original source is not a `Source` (e.g., `Card`). + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array<string>; + + /** + * The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. It is generally inferred unless a type supports multiple flows. + */ + flow?: SourceCreateParams.Flow; + + /** + * Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. + */ + mandate?: SourceCreateParams.Mandate; + + metadata?: MetadataParam; + + /** + * The source to share. + */ + original_source?: string; + + /** + * Information about the owner of the payment instrument that may be used or required by particular source types. + */ + owner?: SourceCreateParams.Owner; + + /** + * Optional parameters for the receiver flow. Can be set only if the source is a receiver (`flow` is `receiver`). + */ + receiver?: SourceCreateParams.Receiver; + + /** + * Parameters required for the redirect flow. Required if the source is authenticated by a redirect (`flow` is `redirect`). + */ + redirect?: SourceCreateParams.Redirect; + + /** + * Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. + */ + source_order?: SourceCreateParams.SourceOrder; + + /** + * An arbitrary string to be displayed on your customer's statement. As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. + */ + statement_descriptor?: string; + + /** + * An optional token used to create the source. When passed, token properties will override source parameters. + */ + token?: string; + + /** + * The `type` of the source to create. Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide) + */ + type?: string; + + usage?: SourceCreateParams.Usage; +} + +export namespace SourceCreateParams { + export type Flow = 'code_verification' | 'none' | 'receiver' | 'redirect'; + + export interface Mandate { + /** + * The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. + */ + acceptance?: Mandate.Acceptance; + + /** + * The amount specified by the mandate. (Leave null for a mandate covering all amounts) + */ + amount?: number | ''; + + /** + * The currency specified by the mandate. (Must match `currency` of the source) + */ + currency?: string; + + /** + * The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) + */ + interval?: Mandate.Interval; + + /** + * The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). + */ + notification_method?: Mandate.NotificationMethod; + } + + export namespace Mandate { + export interface Acceptance { + /** + * The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + */ + date?: number; + + /** + * The IP address from which the mandate was accepted or refused by the customer. + */ + ip?: string; + + /** + * The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` + */ + offline?: Acceptance.Offline; + + /** + * The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` + */ + online?: Acceptance.Online; + + /** + * The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). + */ + status: Acceptance.Status; + + /** + * The type of acceptance information included with the mandate. Either `online` or `offline` + */ + type?: Acceptance.Type; + + /** + * The user agent of the browser from which the mandate was accepted or refused by the customer. + */ + user_agent?: string; + } + + export namespace Acceptance { + export interface Offline { + /** + * An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. + */ + contact_email: string; + } + + export interface Online { + /** + * The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + */ + date?: number; + + /** + * The IP address from which the mandate was accepted or refused by the customer. + */ + ip?: string; + + /** + * The user agent of the browser from which the mandate was accepted or refused by the customer. + */ + user_agent?: string; + } + + export type Status = 'accepted' | 'pending' | 'refused' | 'revoked'; + + export type Type = 'offline' | 'online'; + } + + export type Interval = 'one_time' | 'scheduled' | 'variable'; + + export type NotificationMethod = + | 'deprecated_none' + | 'email' + | 'manual' + | 'none' + | 'stripe_email'; + } + + export interface Owner { + /** + * Owner's address. + */ + address?: Owner.Address; + + /** + * Owner's email address. + */ + email?: string; + + /** + * Owner's full name. + */ + name?: string; + + /** + * Owner's phone number. + */ + phone?: string; + } + + export namespace Owner { + export interface Address { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + } + + export interface Receiver { + /** + * The method Stripe should use to request information needed to process a refund or mispayment. Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). Refer to each payment method's documentation to learn which refund attributes may be required. + */ + refund_attributes_method?: Receiver.RefundAttributesMethod; + } + + export namespace Receiver { + export type RefundAttributesMethod = 'email' | 'manual' | 'none'; + } + + export interface Redirect { + /** + * The URL you provide to redirect the customer back to you after they authenticated their payment. It can use your application URI scheme in the context of a mobile application. + */ + return_url: string; + } + + export interface SourceOrder { + /** + * List of items constituting the order. + */ + items?: Array<SourceOrder.Item>; + + /** + * Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. + */ + shipping?: SourceOrder.Shipping; + } + + export namespace SourceOrder { + export interface Item { + amount?: number; + + currency?: string; + + description?: string; + + /** + * The ID of the SKU being ordered. + */ + parent?: string; + + /** + * The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. + */ + quantity?: number; + + type?: Item.Type; + } + + export namespace Item { + export type Type = 'discount' | 'shipping' | 'sku' | 'tax'; + } + + export interface Shipping { + /** + * Shipping address. + */ + address: AddressParam; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string; + + /** + * Recipient name. + */ + name?: string; + + /** + * Recipient phone (including extension). + */ + phone?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string; + } + } + + export type Usage = 'reusable' | 'single_use'; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/sources.d.ts b/node_modules/@stripe/stripe-js/dist/api/sources.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d9105898180ce3274409f1c121eb5a082687f0e3 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/sources.d.ts @@ -0,0 +1,1045 @@ +import {Address, AddressParam, Metadata, MetadataParam} from './shared'; + +/** + * The Source object. + */ +export interface Source { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'source'; + + ach_credit_transfer?: Source.AchCreditTransfer; + + ach_debit?: Source.AchDebit; + + acss_debit?: Source.AcssDebit; + + alipay?: Source.Alipay; + + /** + * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. + */ + amount: number | null; + + au_becs_debit?: Source.AuBecsDebit; + + bancontact?: Source.Bancontact; + + card?: Source.Card; + + card_present?: Source.CardPresent; + + /** + * The client secret of the source. Used for client-side retrieval using a publishable key. + */ + client_secret: string; + + code_verification?: Source.CodeVerification; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. Required for `single_use` sources. + */ + currency: string | null; + + /** + * The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. + */ + customer?: string; + + eps?: Source.Eps; + + /** + * The authentication `flow` of the source. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. + */ + flow: string; + + giropay?: Source.Giropay; + + ideal?: Source.Ideal; + + klarna?: Source.Klarna; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ + metadata: Metadata | null; + + multibanco?: Source.Multibanco; + + /** + * Information about the owner of the payment instrument that may be used or required by particular source types. + */ + owner: Source.Owner | null; + + p24?: Source.P24; + + receiver?: Source.Receiver; + + redirect?: Source.Redirect; + + sepa_credit_transfer?: Source.SepaCreditTransfer; + + sepa_debit?: Source.SepaDebit; + + sofort?: Source.Sofort; + + source_order?: Source.SourceOrder; + + /** + * Extra information about a source. This will appear on your customer's statement every time you charge the source. + */ + statement_descriptor: string | null; + + /** + * The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`. Only `chargeable` sources can be used to create a charge. + */ + status: string; + + three_d_secure?: Source.ThreeDSecure; + + /** + * The `type` of the source. The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. An additional hash is included on the source with a name matching this value. It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. + */ + type: Source.Type; + + /** + * Either `reusable` or `single_use`. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. + */ + usage: string | null; + + wechat?: Source.Wechat; +} + +export namespace Source { + export interface AchCreditTransfer { + account_number?: string | null; + + bank_name?: string | null; + + fingerprint?: string | null; + + refund_account_holder_name?: string | null; + + refund_account_holder_type?: string | null; + + refund_routing_number?: string | null; + + routing_number?: string | null; + + swift_code?: string | null; + } + + export interface AchDebit { + bank_name?: string | null; + + country?: string | null; + + fingerprint?: string | null; + + last4?: string | null; + + routing_number?: string | null; + + type?: string | null; + } + + export interface AcssDebit { + bank_address_city?: string | null; + + bank_address_line_1?: string | null; + + bank_address_line_2?: string | null; + + bank_address_postal_code?: string | null; + + bank_name?: string | null; + + category?: string | null; + + country?: string | null; + + fingerprint?: string | null; + + last4?: string | null; + + routing_number?: string | null; + } + + export interface Alipay { + data_string?: string | null; + + native_url?: string | null; + + statement_descriptor?: string | null; + } + + export interface AuBecsDebit { + bsb_number?: string | null; + + fingerprint?: string | null; + + last4?: string | null; + } + + export interface Bancontact { + bank_code?: string | null; + + bank_name?: string | null; + + bic?: string | null; + + iban_last4?: string | null; + + preferred_language?: string | null; + + statement_descriptor?: string | null; + } + + export interface Card { + address_line1_check?: string | null; + + address_zip_check?: string | null; + + brand?: string | null; + + country?: string | null; + + cvc_check?: string | null; + + description?: string; + + dynamic_last4?: string | null; + + exp_month?: number | null; + + exp_year?: number | null; + + fingerprint?: string; + + funding?: string | null; + + iin?: string; + + issuer?: string; + + last4?: string | null; + + name?: string | null; + + three_d_secure?: string; + + tokenization_method?: string | null; + } + + export interface CardPresent { + application_cryptogram?: string; + + application_preferred_name?: string; + + authorization_code?: string | null; + + authorization_response_code?: string; + + brand?: string | null; + + country?: string | null; + + cvm_type?: string; + + data_type?: string | null; + + dedicated_file_name?: string; + + description?: string; + + emv_auth_data?: string; + + evidence_customer_signature?: string | null; + + evidence_transaction_certificate?: string | null; + + exp_month?: number | null; + + exp_year?: number | null; + + fingerprint?: string; + + funding?: string | null; + + iin?: string; + + issuer?: string; + + last4?: string | null; + + pos_device_id?: string | null; + + pos_entry_mode?: string; + + read_method?: string | null; + + reader?: string | null; + + terminal_verification_results?: string; + + transaction_status_information?: string; + } + + export interface CodeVerification { + /** + * The number of attempts remaining to authenticate the source object with a verification code. + */ + attempts_remaining: number; + + /** + * The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0). + */ + status: string; + } + + export interface Eps { + reference?: string | null; + + statement_descriptor?: string | null; + } + + export interface Giropay { + bank_code?: string | null; + + bank_name?: string | null; + + bic?: string | null; + + statement_descriptor?: string | null; + } + + export interface Ideal { + bank?: string | null; + + bic?: string | null; + + iban_last4?: string | null; + + statement_descriptor?: string | null; + } + + export interface Klarna { + background_image_url?: string; + + client_token?: string | null; + + first_name?: string; + + last_name?: string; + + locale?: string; + + logo_url?: string; + + page_title?: string; + + pay_later_asset_urls_descriptive?: string; + + pay_later_asset_urls_standard?: string; + + pay_later_name?: string; + + pay_later_redirect_url?: string; + + pay_now_asset_urls_descriptive?: string; + + pay_now_asset_urls_standard?: string; + + pay_now_name?: string; + + pay_now_redirect_url?: string; + + pay_over_time_asset_urls_descriptive?: string; + + pay_over_time_asset_urls_standard?: string; + + pay_over_time_name?: string; + + pay_over_time_redirect_url?: string; + + payment_method_categories?: string; + + purchase_country?: string; + + purchase_type?: string; + + redirect_url?: string; + + shipping_first_name?: string; + + shipping_last_name?: string; + } + + export interface Multibanco { + entity?: string | null; + + reference?: string | null; + + refund_account_holder_address_city?: string | null; + + refund_account_holder_address_country?: string | null; + + refund_account_holder_address_line1?: string | null; + + refund_account_holder_address_line2?: string | null; + + refund_account_holder_address_postal_code?: string | null; + + refund_account_holder_address_state?: string | null; + + refund_account_holder_name?: string | null; + + refund_iban?: string | null; + } + + export interface Owner { + /** + * Owner's address. + */ + address: Address | null; + + /** + * Owner's email address. + */ + email: string | null; + + /** + * Owner's full name. + */ + name: string | null; + + /** + * Owner's phone number (including extension). + */ + phone: string | null; + + /** + * Verified owner's address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + verified_address: Address | null; + + /** + * Verified owner's email address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + verified_email: string | null; + + /** + * Verified owner's full name. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + verified_name: string | null; + + /** + * Verified owner's phone number (including extension). Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + verified_phone: string | null; + } + + export interface P24 { + reference?: string | null; + } + + export interface Receiver { + /** + * The address of the receiver source. This is the value that should be communicated to the customer to send their funds to. + */ + address: string | null; + + /** + * The total amount that was charged by you. The amount charged is expressed in the source's currency. + */ + amount_charged: number; + + /** + * The total amount received by the receiver source. `amount_received = amount_returned + amount_charged` is true at all time. The amount received is expressed in the source's currency. + */ + amount_received: number; + + /** + * The total amount that was returned to the customer. The amount returned is expressed in the source's currency. + */ + amount_returned: number; + + /** + * Type of refund attribute method, one of `email`, `manual`, or `none`. + */ + refund_attributes_method: string; + + /** + * Type of refund attribute status, one of `missing`, `requested`, or `available`. + */ + refund_attributes_status: string; + } + + export interface Redirect { + /** + * The failure reason for the redirect, either `user_abort` (the customer aborted or dropped out of the redirect flow), `declined` (the authentication failed or the transaction was declined), or `processing_error` (the redirect failed due to a technical error). Present only if the redirect status is `failed`. + */ + failure_reason: string | null; + + /** + * The URL you provide to redirect the customer to after they authenticated their payment. + */ + return_url: string; + + /** + * The status of the redirect, either `pending` (ready to be used by your customer to authenticate the transaction), `succeeded` (succesful authentication, cannot be reused) or `not_required` (redirect should not be used) or `failed` (failed authentication, cannot be reused). + */ + status: string; + + /** + * The URL provided to you to redirect a customer to as part of a `redirect` authentication flow. + */ + url: string; + } + + export interface SepaCreditTransfer { + bank_name?: string | null; + + bic?: string | null; + + iban?: string | null; + + refund_account_holder_address_city?: string | null; + + refund_account_holder_address_country?: string | null; + + refund_account_holder_address_line1?: string | null; + + refund_account_holder_address_line2?: string | null; + + refund_account_holder_address_postal_code?: string | null; + + refund_account_holder_address_state?: string | null; + + refund_account_holder_name?: string | null; + + refund_iban?: string | null; + } + + export interface SepaDebit { + bank_code?: string | null; + + branch_code?: string | null; + + country?: string | null; + + fingerprint?: string | null; + + last4?: string | null; + + mandate_reference?: string | null; + + mandate_url?: string | null; + } + + export interface Sofort { + bank_code?: string | null; + + bank_name?: string | null; + + bic?: string | null; + + country?: string | null; + + iban_last4?: string | null; + + preferred_language?: string | null; + + statement_descriptor?: string | null; + } + + export interface SourceOrder { + /** + * A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. + */ + amount: number; + + /** + * Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). + */ + currency: string; + + /** + * The email address of the customer placing the order. + */ + email?: string; + + /** + * List of items constituting the order. + */ + items: Array<SourceOrder.Item> | null; + + shipping?: SourceOrder.Shipping; + } + + export namespace SourceOrder { + export interface Item { + /** + * The amount (price) for this order item. + */ + amount: number | null; + + /** + * This currency of this order item. Required when `amount` is present. + */ + currency: string | null; + + /** + * Human-readable description for this order item. + */ + description: string | null; + + /** + * The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. + */ + quantity?: number; + + /** + * The type of this order item. Must be `sku`, `tax`, or `shipping`. + */ + type: string | null; + } + + export interface Shipping { + address?: Address; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string | null; + + /** + * Recipient name. + */ + name?: string | null; + + /** + * Recipient phone (including extension). + */ + phone?: string | null; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string | null; + } + } + + export interface ThreeDSecure { + address_line1_check?: string | null; + + address_zip_check?: string | null; + + authenticated?: boolean | null; + + brand?: string | null; + + card?: string | null; + + country?: string | null; + + customer?: string | null; + + cvc_check?: string | null; + + description?: string; + + dynamic_last4?: string | null; + + exp_month?: number | null; + + exp_year?: number | null; + + fingerprint?: string; + + funding?: string | null; + + iin?: string; + + issuer?: string; + + last4?: string | null; + + name?: string | null; + + three_d_secure?: string; + + tokenization_method?: string | null; + } + + export type Type = + | 'ach_credit_transfer' + | 'ach_debit' + | 'acss_debit' + | 'alipay' + | 'au_becs_debit' + | 'bancontact' + | 'card' + | 'card_present' + | 'eps' + | 'giropay' + | 'ideal' + | 'klarna' + | 'multibanco' + | 'p24' + | 'sepa_credit_transfer' + | 'sepa_debit' + | 'sofort' + | 'three_d_secure' + | 'wechat'; + + export interface Wechat { + prepay_id?: string; + + qr_code_url?: string | null; + + statement_descriptor?: string; + } +} + +export interface SourceCreateParams { + /** + * Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. Not supported for `receiver` type sources, where charge amount may not be specified until funds land. + */ + amount?: number; + + /** + * Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. + */ + currency?: string; + + /** + * The `Customer` to whom the original source is attached to. Must be set when the original source is not a `Source` (e.g., `Card`). + */ + customer?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array<string>; + + /** + * The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. It is generally inferred unless a type supports multiple flows. + */ + flow?: SourceCreateParams.Flow; + + /** + * Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. + */ + mandate?: SourceCreateParams.Mandate; + + metadata?: MetadataParam; + + /** + * The source to share. + */ + original_source?: string; + + /** + * Information about the owner of the payment instrument that may be used or required by particular source types. + */ + owner?: SourceCreateParams.Owner; + + /** + * Optional parameters for the receiver flow. Can be set only if the source is a receiver (`flow` is `receiver`). + */ + receiver?: SourceCreateParams.Receiver; + + /** + * Parameters required for the redirect flow. Required if the source is authenticated by a redirect (`flow` is `redirect`). + */ + redirect?: SourceCreateParams.Redirect; + + /** + * Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. + */ + source_order?: SourceCreateParams.SourceOrder; + + /** + * An arbitrary string to be displayed on your customer's statement. As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. + */ + statement_descriptor?: string; + + /** + * An optional token used to create the source. When passed, token properties will override source parameters. + */ + token?: string; + + /** + * The `type` of the source to create. Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide) + */ + type?: string; + + usage?: SourceCreateParams.Usage; +} + +export namespace SourceCreateParams { + export type Flow = 'code_verification' | 'none' | 'receiver' | 'redirect'; + + export interface Mandate { + /** + * The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. + */ + acceptance?: Mandate.Acceptance; + + /** + * The amount specified by the mandate. (Leave null for a mandate covering all amounts) + */ + amount?: number | ''; + + /** + * The currency specified by the mandate. (Must match `currency` of the source) + */ + currency?: string; + + /** + * The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) + */ + interval?: Mandate.Interval; + + /** + * The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). + */ + notification_method?: Mandate.NotificationMethod; + } + + export namespace Mandate { + export interface Acceptance { + /** + * The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + */ + date?: number; + + /** + * The IP address from which the mandate was accepted or refused by the customer. + */ + ip?: string; + + /** + * The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` + */ + offline?: Acceptance.Offline; + + /** + * The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` + */ + online?: Acceptance.Online; + + /** + * The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). + */ + status: Acceptance.Status; + + /** + * The type of acceptance information included with the mandate. Either `online` or `offline` + */ + type?: Acceptance.Type; + + /** + * The user agent of the browser from which the mandate was accepted or refused by the customer. + */ + user_agent?: string; + } + + export namespace Acceptance { + export interface Offline { + /** + * An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. + */ + contact_email: string; + } + + export interface Online { + /** + * The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + */ + date?: number; + + /** + * The IP address from which the mandate was accepted or refused by the customer. + */ + ip?: string; + + /** + * The user agent of the browser from which the mandate was accepted or refused by the customer. + */ + user_agent?: string; + } + + export type Status = 'accepted' | 'pending' | 'refused' | 'revoked'; + + export type Type = 'offline' | 'online'; + } + + export type Interval = 'one_time' | 'scheduled' | 'variable'; + + export type NotificationMethod = + | 'deprecated_none' + | 'email' + | 'manual' + | 'none' + | 'stripe_email'; + } + + export interface Owner { + /** + * Owner's address. + */ + address?: Owner.Address; + + /** + * Owner's email address. + */ + email?: string; + + /** + * Owner's full name. + */ + name?: string; + + /** + * Owner's phone number. + */ + phone?: string; + } + + export namespace Owner { + export interface Address { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + } + + export interface Receiver { + /** + * The method Stripe should use to request information needed to process a refund or mispayment. Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). Refer to each payment method's documentation to learn which refund attributes may be required. + */ + refund_attributes_method?: Receiver.RefundAttributesMethod; + } + + export namespace Receiver { + export type RefundAttributesMethod = 'email' | 'manual' | 'none'; + } + + export interface Redirect { + /** + * The URL you provide to redirect the customer back to you after they authenticated their payment. It can use your application URI scheme in the context of a mobile application. + */ + return_url: string; + } + + export interface SourceOrder { + /** + * List of items constituting the order. + */ + items?: Array<SourceOrder.Item>; + + /** + * Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. + */ + shipping?: SourceOrder.Shipping; + } + + export namespace SourceOrder { + export interface Item { + amount?: number; + + currency?: string; + + description?: string; + + /** + * The ID of the SKU being ordered. + */ + parent?: string; + + /** + * The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. + */ + quantity?: number; + + type?: Item.Type; + } + + export namespace Item { + export type Type = 'discount' | 'shipping' | 'sku' | 'tax'; + } + + export interface Shipping { + /** + * Shipping address. + */ + address: AddressParam; + + /** + * The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + */ + carrier?: string; + + /** + * Recipient name. + */ + name?: string; + + /** + * Recipient phone (including extension). + */ + phone?: string; + + /** + * The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + */ + tracking_number?: string; + } + } + + export type Usage = 'reusable' | 'single_use'; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/tokens.d.mts b/node_modules/@stripe/stripe-js/dist/api/tokens.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..1953a9eea9a0e345fe8db35ecda8f7699eae8a56 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/tokens.d.mts @@ -0,0 +1,639 @@ +import {Omit} from '../utils'; +import {Card} from './cards'; +import {BankAccount} from './bank-accounts'; +import {JapanAddressParam, MetadataParam} from './shared'; + +/** + * The Token object. + */ +export interface Token { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'token'; + + bank_account?: BankAccount; + + card?: Card; + + /** + * IP address of the client that generated the token. + */ + client_ip: string | null; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Type of the token: `account`, `bank_account`, `card`, or `pii`. + */ + type: string; + + /** + * Whether this token has already been used (tokens can be used only once). + */ + used: boolean; +} + +export type BankAccountToken = Omit<Token, 'card'> & { + bank_account: BankAccount; +}; + +export namespace TokenCreateParams { + export interface Account { + /** + * The business type. + */ + business_type?: Account.BusinessType; + + /** + * Information about the company or business. + */ + company?: Account.Company; + + /** + * Information about the person represented by the account. + */ + individual?: Account.Individual; + + /** + * Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. + */ + tos_shown_and_accepted?: boolean; + } + + export namespace Account { + export type BusinessType = + | 'company' + | 'government_entity' + | 'individual' + | 'non_profit'; + + export interface Company { + /** + * The company's primary address. + */ + address?: Company.Address; + + /** + * The Kana variation of the company's primary address (Japan only). + */ + address_kana?: JapanAddressParam; + + /** + * The Kanji variation of the company's primary address (Japan only). + */ + address_kanji?: JapanAddressParam; + + /** + * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + */ + directors_provided?: boolean; + + /** + * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + */ + executives_provided?: boolean; + + /** + * The company's legal name. + */ + name?: string; + + /** + * The Kana variation of the company's legal name (Japan only). + */ + name_kana?: string; + + /** + * The Kanji variation of the company's legal name (Japan only). + */ + name_kanji?: string; + + /** + * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + */ + owners_provided?: boolean; + + /** + * The company's phone number (used for verification). + */ + phone?: string; + + /** + * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + */ + structure?: Company.Structure | null; + + /** + * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) + */ + tax_id?: string; + + /** + * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + */ + tax_id_registrar?: string; + + /** + * The VAT number of the company. + */ + vat_id?: string; + + /** + * Information on the verification state of the company. + */ + verification?: Company.Verification; + } + + export namespace Company { + export interface Address { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + + export type Structure = + | 'government_instrumentality' + | 'governmental_unit' + | 'incorporated_non_profit' + | 'limited_liability_partnership' + | 'multi_member_llc' + | 'private_company' + | 'private_corporation' + | 'private_partnership' + | 'public_company' + | 'public_corporation' + | 'public_partnership' + | 'sole_proprietorship' + | 'tax_exempt_government_instrumentality' + | 'unincorporated_association' + | 'unincorporated_non_profit'; + + export interface Verification { + /** + * A document verifying the business. + */ + document?: Verification.Document; + } + + export namespace Verification { + export interface Document { + /** + * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + + export interface Individual { + /** + * The individual's primary address. + */ + address?: Individual.Address; + + /** + * The Kana variation of the the individual's primary address (Japan only). + */ + address_kana?: JapanAddressParam; + + /** + * The Kanji variation of the the individual's primary address (Japan only). + */ + address_kanji?: JapanAddressParam; + + /** + * The individual's date of birth. + */ + dob?: Individual.Dob | null; + + /** + * The individual's email address. + */ + email?: string; + + /** + * The individual's first name. + */ + first_name?: string; + + /** + * The Kana variation of the the individual's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the individual's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * The individual's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/stripe.js#collecting-pii-data). + */ + id_number?: string; + + /** + * The individual's last name. + */ + last_name?: string; + + /** + * The Kana varation of the individual's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji varation of the individual's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The individual's maiden name. + */ + maiden_name?: string; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: MetadataParam | null; + + /** + * The individual's phone number. + */ + phone?: string; + + /** + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ + political_exposure?: Individual.PoliticalExposure; + + /** + * The last four digits of the individual's Social Security Number (U.S. only). + */ + ssn_last_4?: string; + + /** + * The individual's verification document information. + */ + verification?: Individual.Verification; + } + + export namespace Individual { + export interface Address { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + + export interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + export type PoliticalExposure = 'none' | 'existing'; + + export interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; + + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + export namespace Verification { + export interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + + export interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + } + + export interface Person { + /** + * The person's address. + */ + address?: Person.Address; + + /** + * The Kana variation of the person's address (Japan only). + */ + address_kana?: JapanAddressParam; + + /** + * The Kanji variation of the person's address (Japan only). + */ + address_kanji?: JapanAddressParam; + + /** + * The person's date of birth. + */ + dob?: Person.Dob | null; + + /** + * The person's email address. + */ + email?: string; + + /** + * The person's first name. + */ + first_name?: string; + + /** + * The Kana variation of the person's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the person's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * The person's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/stripe.js#collecting-pii-data). + */ + id_number?: string; + + /** + * The person's last name. + */ + last_name?: string; + + /** + * The Kana variation of the person's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji variation of the person's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The person's maiden name. + */ + maiden_name?: string; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: MetadataParam | null; + + /** + * The person's phone number. + */ + phone?: string; + + /** + * The relationship that this person has with the account's legal entity. + */ + relationship?: Person.Relationship; + + /** + * The last 4 digits of the person's social security number. + */ + ssn_last_4?: string; + + /** + * The person's verification status. + */ + verification?: Person.Verification; + } + + export namespace Person { + export interface Address { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + + export interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + export interface Relationship { + /** + * Whether the person is a director of the account's legal entity. Currently only required for accounts in the EU. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + */ + director?: boolean; + + /** + * Whether the person has significant responsibility to control, manage, or direct the organization. + */ + executive?: boolean; + + /** + * Whether the person is an owner of the account's legal entity. + */ + owner?: boolean; + + /** + * The percent owned by the person of the account's legal entity. + */ + percent_ownership?: number | null; + + /** + * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. + */ + representative?: boolean; + + /** + * The person's title (e.g., CEO, Support Engineer). + */ + title?: string; + } + + export interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; + + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + export namespace Verification { + export interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + + export interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } +} diff --git a/node_modules/@stripe/stripe-js/dist/api/tokens.d.ts b/node_modules/@stripe/stripe-js/dist/api/tokens.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1953a9eea9a0e345fe8db35ecda8f7699eae8a56 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/tokens.d.ts @@ -0,0 +1,639 @@ +import {Omit} from '../utils'; +import {Card} from './cards'; +import {BankAccount} from './bank-accounts'; +import {JapanAddressParam, MetadataParam} from './shared'; + +/** + * The Token object. + */ +export interface Token { + /** + * Unique identifier for the object. + */ + id: string; + + /** + * String representing the object's type. Objects of the same type share the same value. + */ + object: 'token'; + + bank_account?: BankAccount; + + card?: Card; + + /** + * IP address of the client that generated the token. + */ + client_ip: string | null; + + /** + * Time at which the object was created. Measured in seconds since the Unix epoch. + */ + created: number; + + /** + * Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + */ + livemode: boolean; + + /** + * Type of the token: `account`, `bank_account`, `card`, or `pii`. + */ + type: string; + + /** + * Whether this token has already been used (tokens can be used only once). + */ + used: boolean; +} + +export type BankAccountToken = Omit<Token, 'card'> & { + bank_account: BankAccount; +}; + +export namespace TokenCreateParams { + export interface Account { + /** + * The business type. + */ + business_type?: Account.BusinessType; + + /** + * Information about the company or business. + */ + company?: Account.Company; + + /** + * Information about the person represented by the account. + */ + individual?: Account.Individual; + + /** + * Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. + */ + tos_shown_and_accepted?: boolean; + } + + export namespace Account { + export type BusinessType = + | 'company' + | 'government_entity' + | 'individual' + | 'non_profit'; + + export interface Company { + /** + * The company's primary address. + */ + address?: Company.Address; + + /** + * The Kana variation of the company's primary address (Japan only). + */ + address_kana?: JapanAddressParam; + + /** + * The Kanji variation of the company's primary address (Japan only). + */ + address_kanji?: JapanAddressParam; + + /** + * Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + */ + directors_provided?: boolean; + + /** + * Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + */ + executives_provided?: boolean; + + /** + * The company's legal name. + */ + name?: string; + + /** + * The Kana variation of the company's legal name (Japan only). + */ + name_kana?: string; + + /** + * The Kanji variation of the company's legal name (Japan only). + */ + name_kanji?: string; + + /** + * Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + */ + owners_provided?: boolean; + + /** + * The company's phone number (used for verification). + */ + phone?: string; + + /** + * The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + */ + structure?: Company.Structure | null; + + /** + * The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) + */ + tax_id?: string; + + /** + * The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + */ + tax_id_registrar?: string; + + /** + * The VAT number of the company. + */ + vat_id?: string; + + /** + * Information on the verification state of the company. + */ + verification?: Company.Verification; + } + + export namespace Company { + export interface Address { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + + export type Structure = + | 'government_instrumentality' + | 'governmental_unit' + | 'incorporated_non_profit' + | 'limited_liability_partnership' + | 'multi_member_llc' + | 'private_company' + | 'private_corporation' + | 'private_partnership' + | 'public_company' + | 'public_corporation' + | 'public_partnership' + | 'sole_proprietorship' + | 'tax_exempt_government_instrumentality' + | 'unincorporated_association' + | 'unincorporated_non_profit'; + + export interface Verification { + /** + * A document verifying the business. + */ + document?: Verification.Document; + } + + export namespace Verification { + export interface Document { + /** + * The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + + export interface Individual { + /** + * The individual's primary address. + */ + address?: Individual.Address; + + /** + * The Kana variation of the the individual's primary address (Japan only). + */ + address_kana?: JapanAddressParam; + + /** + * The Kanji variation of the the individual's primary address (Japan only). + */ + address_kanji?: JapanAddressParam; + + /** + * The individual's date of birth. + */ + dob?: Individual.Dob | null; + + /** + * The individual's email address. + */ + email?: string; + + /** + * The individual's first name. + */ + first_name?: string; + + /** + * The Kana variation of the the individual's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the individual's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * The individual's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/stripe.js#collecting-pii-data). + */ + id_number?: string; + + /** + * The individual's last name. + */ + last_name?: string; + + /** + * The Kana varation of the individual's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji varation of the individual's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The individual's maiden name. + */ + maiden_name?: string; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: MetadataParam | null; + + /** + * The individual's phone number. + */ + phone?: string; + + /** + * Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + */ + political_exposure?: Individual.PoliticalExposure; + + /** + * The last four digits of the individual's Social Security Number (U.S. only). + */ + ssn_last_4?: string; + + /** + * The individual's verification document information. + */ + verification?: Individual.Verification; + } + + export namespace Individual { + export interface Address { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + + export interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + export type PoliticalExposure = 'none' | 'existing'; + + export interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; + + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + export namespace Verification { + export interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + + export interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } + } + + export interface Person { + /** + * The person's address. + */ + address?: Person.Address; + + /** + * The Kana variation of the person's address (Japan only). + */ + address_kana?: JapanAddressParam; + + /** + * The Kanji variation of the person's address (Japan only). + */ + address_kanji?: JapanAddressParam; + + /** + * The person's date of birth. + */ + dob?: Person.Dob | null; + + /** + * The person's email address. + */ + email?: string; + + /** + * The person's first name. + */ + first_name?: string; + + /** + * The Kana variation of the person's first name (Japan only). + */ + first_name_kana?: string; + + /** + * The Kanji variation of the person's first name (Japan only). + */ + first_name_kanji?: string; + + /** + * The person's gender (International regulations require either "male" or "female"). + */ + gender?: string; + + /** + * The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/stripe.js#collecting-pii-data). + */ + id_number?: string; + + /** + * The person's last name. + */ + last_name?: string; + + /** + * The Kana variation of the person's last name (Japan only). + */ + last_name_kana?: string; + + /** + * The Kanji variation of the person's last name (Japan only). + */ + last_name_kanji?: string; + + /** + * The person's maiden name. + */ + maiden_name?: string; + + /** + * Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. + */ + metadata?: MetadataParam | null; + + /** + * The person's phone number. + */ + phone?: string; + + /** + * The relationship that this person has with the account's legal entity. + */ + relationship?: Person.Relationship; + + /** + * The last 4 digits of the person's social security number. + */ + ssn_last_4?: string; + + /** + * The person's verification status. + */ + verification?: Person.Verification; + } + + export namespace Person { + export interface Address { + /** + * City, district, suburb, town, or village. + */ + city?: string; + + /** + * Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + */ + country?: string; + + /** + * Address line 1 (e.g., street, PO Box, or company name). + */ + line1?: string; + + /** + * Address line 2 (e.g., apartment, suite, unit, or building). + */ + line2?: string; + + /** + * ZIP or postal code. + */ + postal_code?: string; + + /** + * State, county, province, or region. + */ + state?: string; + } + + export interface Dob { + /** + * The day of birth, between 1 and 31. + */ + day: number; + + /** + * The month of birth, between 1 and 12. + */ + month: number; + + /** + * The four-digit year of birth. + */ + year: number; + } + + export interface Relationship { + /** + * Whether the person is a director of the account's legal entity. Currently only required for accounts in the EU. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + */ + director?: boolean; + + /** + * Whether the person has significant responsibility to control, manage, or direct the organization. + */ + executive?: boolean; + + /** + * Whether the person is an owner of the account's legal entity. + */ + owner?: boolean; + + /** + * The percent owned by the person of the account's legal entity. + */ + percent_ownership?: number | null; + + /** + * Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. + */ + representative?: boolean; + + /** + * The person's title (e.g., CEO, Support Engineer). + */ + title?: string; + } + + export interface Verification { + /** + * A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + */ + additional_document?: Verification.AdditionalDocument; + + /** + * An identifying document, either a passport or local ID card. + */ + document?: Verification.Document; + } + + export namespace Verification { + export interface AdditionalDocument { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + + export interface Document { + /** + * The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + back?: string; + + /** + * The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + */ + front?: string; + } + } + } +} diff --git a/node_modules/@stripe/stripe-js/dist/api/verification-sessions.d.mts b/node_modules/@stripe/stripe-js/dist/api/verification-sessions.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..9e2f3a86f7a719897a9a1ffbbd0e8a5b713090e5 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/verification-sessions.d.mts @@ -0,0 +1,9 @@ +/** + * The VerificationSession object. + */ +export interface VerificationSession { + /** + * Unique identifier for the object. + */ + id: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/api/verification-sessions.d.ts b/node_modules/@stripe/stripe-js/dist/api/verification-sessions.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9e2f3a86f7a719897a9a1ffbbd0e8a5b713090e5 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/api/verification-sessions.d.ts @@ -0,0 +1,9 @@ +/** + * The VerificationSession object. + */ +export interface VerificationSession { + /** + * Unique identifier for the object. + */ + id: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/index.d.mts b/node_modules/@stripe/stripe-js/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b3f061b242136f0b9f390822db729243fbd5b631 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/index.d.mts @@ -0,0 +1,14 @@ +export * from './api'; +export * from './stripe-js'; + +import {StripeConstructor} from './stripe-js'; + +export {loadStripe} from './shared'; + +declare global { + interface Window { + // Stripe.js must be loaded directly from https://js.stripe.com/v3, which + // places a `Stripe` object on the window + Stripe?: StripeConstructor; + } +} diff --git a/node_modules/@stripe/stripe-js/dist/index.d.ts b/node_modules/@stripe/stripe-js/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3f061b242136f0b9f390822db729243fbd5b631 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/index.d.ts @@ -0,0 +1,14 @@ +export * from './api'; +export * from './stripe-js'; + +import {StripeConstructor} from './stripe-js'; + +export {loadStripe} from './shared'; + +declare global { + interface Window { + // Stripe.js must be loaded directly from https://js.stripe.com/v3, which + // places a `Stripe` object on the window + Stripe?: StripeConstructor; + } +} diff --git a/node_modules/@stripe/stripe-js/dist/index.js b/node_modules/@stripe/stripe-js/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4fc06bec506b7132fea1ede2898922334f3ce4e0 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/index.js @@ -0,0 +1,175 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var V3_URL = 'https://js.stripe.com/v3'; +var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/; +var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used'; +var findScript = function findScript() { + var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]")); + + for (var i = 0; i < scripts.length; i++) { + var script = scripts[i]; + + if (!V3_URL_REGEX.test(script.src)) { + continue; + } + + return script; + } + + return null; +}; + +var injectScript = function injectScript(params) { + var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : ''; + var script = document.createElement('script'); + script.src = "".concat(V3_URL).concat(queryString); + var headOrBody = document.head || document.body; + + if (!headOrBody) { + throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.'); + } + + headOrBody.appendChild(script); + return script; +}; + +var registerWrapper = function registerWrapper(stripe, startTime) { + if (!stripe || !stripe._registerWrapper) { + return; + } + + stripe._registerWrapper({ + name: 'stripe-js', + version: "3.3.0", + startTime: startTime + }); +}; + +var stripePromise = null; +var onErrorListener = null; +var onLoadListener = null; + +var onError = function onError(reject) { + return function () { + reject(new Error('Failed to load Stripe.js')); + }; +}; + +var onLoad = function onLoad(resolve, reject) { + return function () { + if (window.Stripe) { + resolve(window.Stripe); + } else { + reject(new Error('Stripe.js not available')); + } + }; +}; + +var loadScript = function loadScript(params) { + // Ensure that we only attempt to load Stripe.js at most once + if (stripePromise !== null) { + return stripePromise; + } + + stripePromise = new Promise(function (resolve, reject) { + if (typeof window === 'undefined' || typeof document === 'undefined') { + // Resolve to null when imported server side. This makes the module + // safe to import in an isomorphic code base. + resolve(null); + return; + } + + if (window.Stripe && params) { + console.warn(EXISTING_SCRIPT_MESSAGE); + } + + if (window.Stripe) { + resolve(window.Stripe); + return; + } + + try { + var script = findScript(); + + if (script && params) { + console.warn(EXISTING_SCRIPT_MESSAGE); + } else if (!script) { + script = injectScript(params); + } else if (script && onLoadListener !== null && onErrorListener !== null) { + var _script$parentNode; + + // remove event listeners + script.removeEventListener('load', onLoadListener); + script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error, + // reload script to trigger 'load' event + + (_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script); + script = injectScript(params); + } + + onLoadListener = onLoad(resolve, reject); + onErrorListener = onError(reject); + script.addEventListener('load', onLoadListener); + script.addEventListener('error', onErrorListener); + } catch (error) { + reject(error); + return; + } + }); // Resets stripePromise on error + + return stripePromise["catch"](function (error) { + stripePromise = null; + return Promise.reject(error); + }); +}; +var initStripe = function initStripe(maybeStripe, args, startTime) { + if (maybeStripe === null) { + return null; + } + + var stripe = maybeStripe.apply(undefined, args); + registerWrapper(stripe, startTime); + return stripe; +}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + +var stripePromise$1; +var loadCalled = false; + +var getStripePromise = function getStripePromise() { + if (stripePromise$1) { + return stripePromise$1; + } + + stripePromise$1 = loadScript(null)["catch"](function (error) { + // clear cache on error + stripePromise$1 = null; + return Promise.reject(error); + }); + return stripePromise$1; +}; // Execute our own script injection after a tick to give users time to do their +// own script injection. + + +Promise.resolve().then(function () { + return getStripePromise(); +})["catch"](function (error) { + if (!loadCalled) { + console.warn(error); + } +}); +var loadStripe = function loadStripe() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + loadCalled = true; + var startTime = Date.now(); // if previous attempts are unsuccessful, will re-load script + + return getStripePromise().then(function (maybeStripe) { + return initStripe(maybeStripe, args, startTime); + }); +}; + +exports.loadStripe = loadStripe; diff --git a/node_modules/@stripe/stripe-js/dist/index.mjs b/node_modules/@stripe/stripe-js/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..e226f9a11ca8e059737118efdf9d52a1f3669439 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/index.mjs @@ -0,0 +1,171 @@ +var V3_URL = 'https://js.stripe.com/v3'; +var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/; +var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used'; +var findScript = function findScript() { + var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]")); + + for (var i = 0; i < scripts.length; i++) { + var script = scripts[i]; + + if (!V3_URL_REGEX.test(script.src)) { + continue; + } + + return script; + } + + return null; +}; + +var injectScript = function injectScript(params) { + var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : ''; + var script = document.createElement('script'); + script.src = "".concat(V3_URL).concat(queryString); + var headOrBody = document.head || document.body; + + if (!headOrBody) { + throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.'); + } + + headOrBody.appendChild(script); + return script; +}; + +var registerWrapper = function registerWrapper(stripe, startTime) { + if (!stripe || !stripe._registerWrapper) { + return; + } + + stripe._registerWrapper({ + name: 'stripe-js', + version: "3.3.0", + startTime: startTime + }); +}; + +var stripePromise = null; +var onErrorListener = null; +var onLoadListener = null; + +var onError = function onError(reject) { + return function () { + reject(new Error('Failed to load Stripe.js')); + }; +}; + +var onLoad = function onLoad(resolve, reject) { + return function () { + if (window.Stripe) { + resolve(window.Stripe); + } else { + reject(new Error('Stripe.js not available')); + } + }; +}; + +var loadScript = function loadScript(params) { + // Ensure that we only attempt to load Stripe.js at most once + if (stripePromise !== null) { + return stripePromise; + } + + stripePromise = new Promise(function (resolve, reject) { + if (typeof window === 'undefined' || typeof document === 'undefined') { + // Resolve to null when imported server side. This makes the module + // safe to import in an isomorphic code base. + resolve(null); + return; + } + + if (window.Stripe && params) { + console.warn(EXISTING_SCRIPT_MESSAGE); + } + + if (window.Stripe) { + resolve(window.Stripe); + return; + } + + try { + var script = findScript(); + + if (script && params) { + console.warn(EXISTING_SCRIPT_MESSAGE); + } else if (!script) { + script = injectScript(params); + } else if (script && onLoadListener !== null && onErrorListener !== null) { + var _script$parentNode; + + // remove event listeners + script.removeEventListener('load', onLoadListener); + script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error, + // reload script to trigger 'load' event + + (_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script); + script = injectScript(params); + } + + onLoadListener = onLoad(resolve, reject); + onErrorListener = onError(reject); + script.addEventListener('load', onLoadListener); + script.addEventListener('error', onErrorListener); + } catch (error) { + reject(error); + return; + } + }); // Resets stripePromise on error + + return stripePromise["catch"](function (error) { + stripePromise = null; + return Promise.reject(error); + }); +}; +var initStripe = function initStripe(maybeStripe, args, startTime) { + if (maybeStripe === null) { + return null; + } + + var stripe = maybeStripe.apply(undefined, args); + registerWrapper(stripe, startTime); + return stripe; +}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + +var stripePromise$1; +var loadCalled = false; + +var getStripePromise = function getStripePromise() { + if (stripePromise$1) { + return stripePromise$1; + } + + stripePromise$1 = loadScript(null)["catch"](function (error) { + // clear cache on error + stripePromise$1 = null; + return Promise.reject(error); + }); + return stripePromise$1; +}; // Execute our own script injection after a tick to give users time to do their +// own script injection. + + +Promise.resolve().then(function () { + return getStripePromise(); +})["catch"](function (error) { + if (!loadCalled) { + console.warn(error); + } +}); +var loadStripe = function loadStripe() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + loadCalled = true; + var startTime = Date.now(); // if previous attempts are unsuccessful, will re-load script + + return getStripePromise().then(function (maybeStripe) { + return initStripe(maybeStripe, args, startTime); + }); +}; + +export { loadStripe }; diff --git a/node_modules/@stripe/stripe-js/dist/pure.d.mts b/node_modules/@stripe/stripe-js/dist/pure.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e19c7a62996af5e43fe20dd53e0b02afd2c53683 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/pure.d.mts @@ -0,0 +1,5 @@ +import {loadStripe as _loadStripe} from './shared'; + +export const loadStripe: typeof _loadStripe & { + setLoadParameters: (params: {advancedFraudSignals: boolean}) => void; +}; diff --git a/node_modules/@stripe/stripe-js/dist/pure.d.ts b/node_modules/@stripe/stripe-js/dist/pure.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e19c7a62996af5e43fe20dd53e0b02afd2c53683 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/pure.d.ts @@ -0,0 +1,5 @@ +import {loadStripe as _loadStripe} from './shared'; + +export const loadStripe: typeof _loadStripe & { + setLoadParameters: (params: {advancedFraudSignals: boolean}) => void; +}; diff --git a/node_modules/@stripe/stripe-js/dist/pure.js b/node_modules/@stripe/stripe-js/dist/pure.js new file mode 100644 index 0000000000000000000000000000000000000000..349dcf7b803f5a5e0e63a354653bb9a917a8e132 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/pure.js @@ -0,0 +1,204 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function (obj) { + return typeof obj; + }; + } else { + _typeof = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); +} + +var V3_URL = 'https://js.stripe.com/v3'; +var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/; +var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used'; +var findScript = function findScript() { + var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]")); + + for (var i = 0; i < scripts.length; i++) { + var script = scripts[i]; + + if (!V3_URL_REGEX.test(script.src)) { + continue; + } + + return script; + } + + return null; +}; + +var injectScript = function injectScript(params) { + var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : ''; + var script = document.createElement('script'); + script.src = "".concat(V3_URL).concat(queryString); + var headOrBody = document.head || document.body; + + if (!headOrBody) { + throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.'); + } + + headOrBody.appendChild(script); + return script; +}; + +var registerWrapper = function registerWrapper(stripe, startTime) { + if (!stripe || !stripe._registerWrapper) { + return; + } + + stripe._registerWrapper({ + name: 'stripe-js', + version: "3.3.0", + startTime: startTime + }); +}; + +var stripePromise = null; +var onErrorListener = null; +var onLoadListener = null; + +var onError = function onError(reject) { + return function () { + reject(new Error('Failed to load Stripe.js')); + }; +}; + +var onLoad = function onLoad(resolve, reject) { + return function () { + if (window.Stripe) { + resolve(window.Stripe); + } else { + reject(new Error('Stripe.js not available')); + } + }; +}; + +var loadScript = function loadScript(params) { + // Ensure that we only attempt to load Stripe.js at most once + if (stripePromise !== null) { + return stripePromise; + } + + stripePromise = new Promise(function (resolve, reject) { + if (typeof window === 'undefined' || typeof document === 'undefined') { + // Resolve to null when imported server side. This makes the module + // safe to import in an isomorphic code base. + resolve(null); + return; + } + + if (window.Stripe && params) { + console.warn(EXISTING_SCRIPT_MESSAGE); + } + + if (window.Stripe) { + resolve(window.Stripe); + return; + } + + try { + var script = findScript(); + + if (script && params) { + console.warn(EXISTING_SCRIPT_MESSAGE); + } else if (!script) { + script = injectScript(params); + } else if (script && onLoadListener !== null && onErrorListener !== null) { + var _script$parentNode; + + // remove event listeners + script.removeEventListener('load', onLoadListener); + script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error, + // reload script to trigger 'load' event + + (_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script); + script = injectScript(params); + } + + onLoadListener = onLoad(resolve, reject); + onErrorListener = onError(reject); + script.addEventListener('load', onLoadListener); + script.addEventListener('error', onErrorListener); + } catch (error) { + reject(error); + return; + } + }); // Resets stripePromise on error + + return stripePromise["catch"](function (error) { + stripePromise = null; + return Promise.reject(error); + }); +}; +var initStripe = function initStripe(maybeStripe, args, startTime) { + if (maybeStripe === null) { + return null; + } + + var stripe = maybeStripe.apply(undefined, args); + registerWrapper(stripe, startTime); + return stripe; +}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + +var validateLoadParams = function validateLoadParams(params) { + var errorMessage = "invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(params), "\n"); + + if (params === null || _typeof(params) !== 'object') { + throw new Error(errorMessage); + } + + if (Object.keys(params).length === 1 && typeof params.advancedFraudSignals === 'boolean') { + return params; + } + + throw new Error(errorMessage); +}; + +var loadParams; +var loadStripeCalled = false; +var loadStripe = function loadStripe() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + loadStripeCalled = true; + var startTime = Date.now(); + return loadScript(loadParams).then(function (maybeStripe) { + return initStripe(maybeStripe, args, startTime); + }); +}; + +loadStripe.setLoadParameters = function (params) { + // we won't throw an error if setLoadParameters is called with the same values as before + if (loadStripeCalled && loadParams) { + var validatedParams = validateLoadParams(params); + var parameterKeys = Object.keys(validatedParams); + var sameParameters = parameterKeys.reduce(function (previousValue, currentValue) { + var _loadParams; + + return previousValue && params[currentValue] === ((_loadParams = loadParams) === null || _loadParams === void 0 ? void 0 : _loadParams[currentValue]); + }, true); + + if (sameParameters) { + return; + } + } + + if (loadStripeCalled) { + throw new Error('You cannot change load parameters after calling loadStripe'); + } + + loadParams = validateLoadParams(params); +}; + +exports.loadStripe = loadStripe; diff --git a/node_modules/@stripe/stripe-js/dist/pure.mjs b/node_modules/@stripe/stripe-js/dist/pure.mjs new file mode 100644 index 0000000000000000000000000000000000000000..cd595dde2577f6ac0f6fcf53efa8de6e1d336966 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/pure.mjs @@ -0,0 +1,200 @@ +function _typeof(obj) { + "@babel/helpers - typeof"; + + if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { + _typeof = function (obj) { + return typeof obj; + }; + } else { + _typeof = function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + } + + return _typeof(obj); +} + +var V3_URL = 'https://js.stripe.com/v3'; +var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/; +var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used'; +var findScript = function findScript() { + var scripts = document.querySelectorAll("script[src^=\"".concat(V3_URL, "\"]")); + + for (var i = 0; i < scripts.length; i++) { + var script = scripts[i]; + + if (!V3_URL_REGEX.test(script.src)) { + continue; + } + + return script; + } + + return null; +}; + +var injectScript = function injectScript(params) { + var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : ''; + var script = document.createElement('script'); + script.src = "".concat(V3_URL).concat(queryString); + var headOrBody = document.head || document.body; + + if (!headOrBody) { + throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.'); + } + + headOrBody.appendChild(script); + return script; +}; + +var registerWrapper = function registerWrapper(stripe, startTime) { + if (!stripe || !stripe._registerWrapper) { + return; + } + + stripe._registerWrapper({ + name: 'stripe-js', + version: "3.3.0", + startTime: startTime + }); +}; + +var stripePromise = null; +var onErrorListener = null; +var onLoadListener = null; + +var onError = function onError(reject) { + return function () { + reject(new Error('Failed to load Stripe.js')); + }; +}; + +var onLoad = function onLoad(resolve, reject) { + return function () { + if (window.Stripe) { + resolve(window.Stripe); + } else { + reject(new Error('Stripe.js not available')); + } + }; +}; + +var loadScript = function loadScript(params) { + // Ensure that we only attempt to load Stripe.js at most once + if (stripePromise !== null) { + return stripePromise; + } + + stripePromise = new Promise(function (resolve, reject) { + if (typeof window === 'undefined' || typeof document === 'undefined') { + // Resolve to null when imported server side. This makes the module + // safe to import in an isomorphic code base. + resolve(null); + return; + } + + if (window.Stripe && params) { + console.warn(EXISTING_SCRIPT_MESSAGE); + } + + if (window.Stripe) { + resolve(window.Stripe); + return; + } + + try { + var script = findScript(); + + if (script && params) { + console.warn(EXISTING_SCRIPT_MESSAGE); + } else if (!script) { + script = injectScript(params); + } else if (script && onLoadListener !== null && onErrorListener !== null) { + var _script$parentNode; + + // remove event listeners + script.removeEventListener('load', onLoadListener); + script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error, + // reload script to trigger 'load' event + + (_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script); + script = injectScript(params); + } + + onLoadListener = onLoad(resolve, reject); + onErrorListener = onError(reject); + script.addEventListener('load', onLoadListener); + script.addEventListener('error', onErrorListener); + } catch (error) { + reject(error); + return; + } + }); // Resets stripePromise on error + + return stripePromise["catch"](function (error) { + stripePromise = null; + return Promise.reject(error); + }); +}; +var initStripe = function initStripe(maybeStripe, args, startTime) { + if (maybeStripe === null) { + return null; + } + + var stripe = maybeStripe.apply(undefined, args); + registerWrapper(stripe, startTime); + return stripe; +}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types + +var validateLoadParams = function validateLoadParams(params) { + var errorMessage = "invalid load parameters; expected object of shape\n\n {advancedFraudSignals: boolean}\n\nbut received\n\n ".concat(JSON.stringify(params), "\n"); + + if (params === null || _typeof(params) !== 'object') { + throw new Error(errorMessage); + } + + if (Object.keys(params).length === 1 && typeof params.advancedFraudSignals === 'boolean') { + return params; + } + + throw new Error(errorMessage); +}; + +var loadParams; +var loadStripeCalled = false; +var loadStripe = function loadStripe() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + loadStripeCalled = true; + var startTime = Date.now(); + return loadScript(loadParams).then(function (maybeStripe) { + return initStripe(maybeStripe, args, startTime); + }); +}; + +loadStripe.setLoadParameters = function (params) { + // we won't throw an error if setLoadParameters is called with the same values as before + if (loadStripeCalled && loadParams) { + var validatedParams = validateLoadParams(params); + var parameterKeys = Object.keys(validatedParams); + var sameParameters = parameterKeys.reduce(function (previousValue, currentValue) { + var _loadParams; + + return previousValue && params[currentValue] === ((_loadParams = loadParams) === null || _loadParams === void 0 ? void 0 : _loadParams[currentValue]); + }, true); + + if (sameParameters) { + return; + } + } + + if (loadStripeCalled) { + throw new Error('You cannot change load parameters after calling loadStripe'); + } + + loadParams = validateLoadParams(params); +}; + +export { loadStripe }; diff --git a/node_modules/@stripe/stripe-js/dist/shared.d.mts b/node_modules/@stripe/stripe-js/dist/shared.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..3058a0b428ec7dee9b620af59f1db1e5f20a02c2 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/shared.d.mts @@ -0,0 +1,6 @@ +import {StripeConstructorOptions, Stripe} from './stripe-js'; + +export const loadStripe: ( + publishableKey: string, + options?: StripeConstructorOptions | undefined +) => Promise<Stripe | null>; diff --git a/node_modules/@stripe/stripe-js/dist/shared.d.ts b/node_modules/@stripe/stripe-js/dist/shared.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3058a0b428ec7dee9b620af59f1db1e5f20a02c2 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/shared.d.ts @@ -0,0 +1,6 @@ +import {StripeConstructorOptions, Stripe} from './stripe-js'; + +export const loadStripe: ( + publishableKey: string, + options?: StripeConstructorOptions | undefined +) => Promise<Stripe | null>; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/checkout.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/checkout.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..edbf0a5248f454b25857792e0967d2b30bb7428e --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/checkout.d.mts @@ -0,0 +1,153 @@ +export interface RedirectToCheckoutServerOptions { + /** + * The ID of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions) that is used in [Checkout's server integration](https://stripe.com/docs/payments/checkout/one-time). + */ + sessionId: string; +} + +export interface RedirectToCheckoutClientOptions { + /** + * The URL to which Stripe should send customers when payment is complete. + * If you’d like access to the Checkout Session for the successful payment, read more about it in our guide on [fulfilling your payments with webhooks](https://stripe.com/docs/payments/checkout/fulfillment#webhooks). + */ + successUrl: string; + + /** + * The URL to which Stripe should send customers when payment is canceled. + */ + cancelUrl: string; + + /** + * An array of objects representing the items that your customer would like to purchase. + * These items are shown as line items in the Checkout interface and make up the total amount to be collected by Checkout. + */ + lineItems?: Array<{ + /** + * The ID of the price that the customer would like to purchase. SKU or plan IDs may also be used. + */ + price?: string; + + /** + * The quantity of units for the item. + */ + quantity?: number; + }>; + + /** + * An array of objects representing the items that your customer would like to purchase. + * These items are shown as line items in the Checkout interface and make up the total amount to be collected by Checkout. + * + * @deprecated + */ + items?: Array<{ + /** + * The ID of the SKU that the customer would like to purchase + */ + sku?: string; + + /** + * The ID of the plan that the customer would like to subscribe to. + */ + plan?: string; + + /** + * The quantity of units for the item. + */ + quantity?: number; + }>; + + /** + * The mode of the Checkout Session. Required if using lineItems. + */ + mode?: 'payment' | 'subscription'; + + /** + * A unique string to reference the Checkout session. + * This can be a customer ID, a cart ID, or similar. + * It is included in the `checkout.session.completed` webhook and can be used to fulfill the purchase. + */ + clientReferenceId?: string; + + /** + * The email address used to create the customer object. + * If you already know your customer's email address, use this attribute to prefill it on Checkout. + */ + customerEmail?: string; + + /** + * Specify whether Checkout should collect the customer’s billing address. + * If set to `required`, Checkout will attempt to collect the customer’s billing address. + * If not set or set to `auto` Checkout will only attempt to collect the billing address when necessary. + */ + billingAddressCollection?: 'auto' | 'required'; + + /** + * Provides configuration for Checkout to collect a shipping address from a customer. + */ + shippingAddressCollection?: { + /** + * An array of two-letter ISO country codes representing which countries + * Checkout should provide as options for shipping locations. The codes are + * expected to be uppercase. Unsupported country codes: AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI. + */ + allowedCountries: string[]; + }; + + /** + * The [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the locale to display Checkout in. + * Default is `auto` (Stripe detects the locale of the browser). + */ + locale?: CheckoutLocale; + + /** + * Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the **Submit** button. + * `submitType` can only be specified when using using line items or SKUs, and not subscriptions. + * The default is `auto`. + */ + submitType?: 'auto' | 'book' | 'donate' | 'pay'; +} + +export type RedirectToCheckoutOptions = + | RedirectToCheckoutServerOptions + | RedirectToCheckoutClientOptions; + +export type CheckoutLocale = + | 'auto' + | 'bg' + | 'cs' + | 'da' + | 'de' + | 'el' + | 'en' + | 'en-GB' + | 'es' + | 'es-419' + | 'et' + | 'fi' + | 'fil' + | 'fr' + | 'fr-CA' + | 'hr' + | 'hu' + | 'id' + | 'it' + | 'ja' + | 'lt' + | 'lv' + | 'ms' + | 'mt' + | 'nb' + | 'nl' + | 'pl' + | 'pt' + | 'pt-BR' + | 'ro' + | 'ru' + | 'sk' + | 'sl' + | 'sv' + | 'th' + | 'tr' + | 'zh' + | 'zh-HK' + | 'zh-TW'; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/checkout.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/checkout.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..edbf0a5248f454b25857792e0967d2b30bb7428e --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/checkout.d.ts @@ -0,0 +1,153 @@ +export interface RedirectToCheckoutServerOptions { + /** + * The ID of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions) that is used in [Checkout's server integration](https://stripe.com/docs/payments/checkout/one-time). + */ + sessionId: string; +} + +export interface RedirectToCheckoutClientOptions { + /** + * The URL to which Stripe should send customers when payment is complete. + * If you’d like access to the Checkout Session for the successful payment, read more about it in our guide on [fulfilling your payments with webhooks](https://stripe.com/docs/payments/checkout/fulfillment#webhooks). + */ + successUrl: string; + + /** + * The URL to which Stripe should send customers when payment is canceled. + */ + cancelUrl: string; + + /** + * An array of objects representing the items that your customer would like to purchase. + * These items are shown as line items in the Checkout interface and make up the total amount to be collected by Checkout. + */ + lineItems?: Array<{ + /** + * The ID of the price that the customer would like to purchase. SKU or plan IDs may also be used. + */ + price?: string; + + /** + * The quantity of units for the item. + */ + quantity?: number; + }>; + + /** + * An array of objects representing the items that your customer would like to purchase. + * These items are shown as line items in the Checkout interface and make up the total amount to be collected by Checkout. + * + * @deprecated + */ + items?: Array<{ + /** + * The ID of the SKU that the customer would like to purchase + */ + sku?: string; + + /** + * The ID of the plan that the customer would like to subscribe to. + */ + plan?: string; + + /** + * The quantity of units for the item. + */ + quantity?: number; + }>; + + /** + * The mode of the Checkout Session. Required if using lineItems. + */ + mode?: 'payment' | 'subscription'; + + /** + * A unique string to reference the Checkout session. + * This can be a customer ID, a cart ID, or similar. + * It is included in the `checkout.session.completed` webhook and can be used to fulfill the purchase. + */ + clientReferenceId?: string; + + /** + * The email address used to create the customer object. + * If you already know your customer's email address, use this attribute to prefill it on Checkout. + */ + customerEmail?: string; + + /** + * Specify whether Checkout should collect the customer’s billing address. + * If set to `required`, Checkout will attempt to collect the customer’s billing address. + * If not set or set to `auto` Checkout will only attempt to collect the billing address when necessary. + */ + billingAddressCollection?: 'auto' | 'required'; + + /** + * Provides configuration for Checkout to collect a shipping address from a customer. + */ + shippingAddressCollection?: { + /** + * An array of two-letter ISO country codes representing which countries + * Checkout should provide as options for shipping locations. The codes are + * expected to be uppercase. Unsupported country codes: AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI. + */ + allowedCountries: string[]; + }; + + /** + * The [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the locale to display Checkout in. + * Default is `auto` (Stripe detects the locale of the browser). + */ + locale?: CheckoutLocale; + + /** + * Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the **Submit** button. + * `submitType` can only be specified when using using line items or SKUs, and not subscriptions. + * The default is `auto`. + */ + submitType?: 'auto' | 'book' | 'donate' | 'pay'; +} + +export type RedirectToCheckoutOptions = + | RedirectToCheckoutServerOptions + | RedirectToCheckoutClientOptions; + +export type CheckoutLocale = + | 'auto' + | 'bg' + | 'cs' + | 'da' + | 'de' + | 'el' + | 'en' + | 'en-GB' + | 'es' + | 'es-419' + | 'et' + | 'fi' + | 'fil' + | 'fr' + | 'fr-CA' + | 'hr' + | 'hu' + | 'id' + | 'it' + | 'ja' + | 'lt' + | 'lv' + | 'ms' + | 'mt' + | 'nb' + | 'nl' + | 'pl' + | 'pt' + | 'pt-BR' + | 'ro' + | 'ru' + | 'sk' + | 'sl' + | 'sv' + | 'th' + | 'tr' + | 'zh' + | 'zh-HK' + | 'zh-TW'; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/confirmation-tokens.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/confirmation-tokens.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e6c3d78232e31142e091458eeff65cce563cdc89 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/confirmation-tokens.d.mts @@ -0,0 +1 @@ +export {CreateConfirmationToken} from '../api'; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/confirmation-tokens.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/confirmation-tokens.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e6c3d78232e31142e091458eeff65cce563cdc89 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/confirmation-tokens.d.ts @@ -0,0 +1 @@ +export {CreateConfirmationToken} from '../api'; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/custom-checkout.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/custom-checkout.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..95ec038eca070a027e91be7710c528b5dc371ac1 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/custom-checkout.d.mts @@ -0,0 +1,402 @@ +import { + LayoutObject, + Layout, + TermsOption, + StripePaymentElement, +} from './elements/payment'; +import { + AddressMode, + ContactOption, + StripeAddressElement, +} from './elements/address'; +import {Appearance, CssFontSource, CustomFontSource} from './elements-group'; +import {StripeError} from './stripe'; +import { + StripeElementBase, + StripeExpressCheckoutElement, + StripeExpressCheckoutElementConfirmEvent, + StripeExpressCheckoutElementOptions, + StripeExpressCheckoutElementReadyEvent, +} from './elements'; + +/** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + +export interface StripeCustomCheckoutElementsOptions { + appearance?: Appearance; + loader?: 'auto' | 'always' | 'never'; + fonts?: Array<CssFontSource | CustomFontSource>; +} + +export interface StripeCustomCheckoutOptions { + clientSecret: string; + elementsOptions?: StripeCustomCheckoutElementsOptions; +} + +/* Custom Checkout types */ +export type StripeCustomCheckoutAddress = { + country: string; + line1?: string | null; + line2?: string | null; + city?: string | null; + postal_code?: string | null; + state?: string | null; +}; + +export type StripeCustomCheckoutAdjustableQuantity = { + maximum: number; + minimum: number; +}; + +export type StripeCustomCheckoutBillingInterval = + | 'day' + | 'month' + | 'week' + | 'year'; + +export type StripeCustomCheckoutConfirmationRequirement = + | 'phoneNumber' + | 'shippingAddress' + | 'billingAddress' + | 'paymentDetails' + | 'email'; + +export type StripeCustomCheckoutContact = { + name?: string | null; + address: StripeCustomCheckoutAddress; +}; + +export type StripeCustomCheckoutDeliveryEstimate = { + maximum: StripeCustomCheckoutEstimate | null; + minimum: StripeCustomCheckoutEstimate | null; +}; + +export type StripeCustomCheckoutDiscountAmount = { + amount: number; + displayName: string; + promotionCode: string | null; + recurring: + | {type: 'forever'} + | {type: 'repeating'; durationInMonths: number} + | null; +}; + +export type StripeCustomCheckoutDueNext = { + amountSubtotal: number; + amountDiscount: number; + amountTaxInclusive: number; + amountTaxExclusive: number; + billingCycleAnchor: number | null; +}; + +export type StripeCustomCheckoutEstimate = { + unit: 'business_day' | 'day' | 'hour' | 'week' | 'month'; + value: number; +}; + +export type StripeCustomCheckoutLastPaymentError = { + message: string; +}; + +export type StripeCustomCheckoutTaxAmount = { + amount: number; + inclusive: boolean; + displayName: string; +}; + +export type StripeCustomCheckoutLineItem = { + id: string; + name: string; + amountDiscount: number; + amountSubtotal: number; + amountTaxExclusive: number; + amountTaxInclusive: number; + unitAmount: number; + description: string | null; + quantity: number; + discountAmounts: Array<StripeCustomCheckoutDiscountAmount> | null; + taxAmounts: Array<StripeCustomCheckoutTaxAmount> | null; + recurring: { + interval: StripeCustomCheckoutBillingInterval; + intervalCount: number; + isProrated: boolean; + usageType: 'metered' | 'licensed'; + } | null; + adjustableQuantity: StripeCustomCheckoutAdjustableQuantity | null; +}; + +export type StripeCustomCheckoutRecurring = { + interval: StripeCustomCheckoutBillingInterval; + intervalCount: number; + dueNext: StripeCustomCheckoutDueNext; + trial: StripeCustomCheckoutTrial | null; +}; + +export type StripeCustomCheckoutShipping = { + shippingOption: StripeCustomCheckoutShippingOption; + taxAmounts: Array<StripeCustomCheckoutTaxAmount> | null; +}; + +export type StripeCustomCheckoutShippingOption = { + id: string; + amount: number; + currency: string; + displayName: string | null; + deliveryEstimate: StripeCustomCheckoutDeliveryEstimate | null; +}; + +export type StripeCustomCheckoutStatus = + | {type: 'open'} + | {type: 'expired'} + | { + type: 'complete'; + paymentStatus: 'paid' | 'unpaid' | 'no_payment_required'; + }; + +export type StripeCustomCheckoutTaxStatus = + | {status: 'ready'} + | {status: 'requires_shipping_address'} + | {status: 'requires_billing_address'}; + +export type StripeCustomCheckoutTotalSummary = { + appliedBalance: number; + balanceAppliedToNextInvoice: boolean; + discount: number; + shippingRate: number; + subtotal: number; + taxExclusive: number; + taxInclusive: number; + total: number; +}; + +export type StripeCustomCheckoutTrial = { + trialEnd: number; + trialPeriodDays: number; +}; + +/* Custom Checkout session */ +export interface StripeCustomCheckoutSession { + billingAddress: StripeCustomCheckoutContact | null; + canConfirm: boolean; + confirmationRequirements: StripeCustomCheckoutConfirmationRequirement[]; + currency: string; + discountAmounts: Array<StripeCustomCheckoutDiscountAmount> | null; + email: string | null; + lastPaymentError: StripeCustomCheckoutLastPaymentError | null; + lineItems: Array<StripeCustomCheckoutLineItem>; + phoneNumber: string | null; + recurring: StripeCustomCheckoutRecurring | null; + shipping: StripeCustomCheckoutShipping | null; + shippingAddress: StripeCustomCheckoutContact | null; + shippingOptions: Array<StripeCustomCheckoutShippingOption>; + status: StripeCustomCheckoutStatus; + tax: StripeCustomCheckoutTaxStatus; + taxAmounts: Array<StripeCustomCheckoutTaxAmount> | null; + total: StripeCustomCheckoutTotalSummary; +} + +export type StripeCustomCheckoutResult = + | {session: StripeCustomCheckoutSession; error?: undefined} + | {session?: undefined; error: StripeError}; + +export type StripeCustomCheckoutPaymentElementOptions = { + layout?: Layout | LayoutObject; + paymentMethodOrder?: Array<string>; + readonly?: boolean; + terms?: TermsOption; +}; + +export type StripeCustomCheckoutAddressElementOptions = { + mode: AddressMode; + contacts?: ContactOption[]; + display?: { + name?: 'full' | 'split' | 'organization'; + }; +}; + +export type StripeCustomCheckoutExpressCheckoutElementOptions = { + buttonHeight: StripeExpressCheckoutElementOptions['buttonHeight']; + buttonTheme: StripeExpressCheckoutElementOptions['buttonTheme']; + buttonType: StripeExpressCheckoutElementOptions['buttonType']; + layout: StripeExpressCheckoutElementOptions['layout']; +}; + +export type StripeCustomCheckoutUpdateHandler = ( + session: StripeCustomCheckoutSession +) => void; + +export type StripeCustomCheckoutExpressCheckoutElementConfirmEvent = StripeExpressCheckoutElementConfirmEvent & { + confirm: () => Promise<StripeCustomCheckoutResult>; +}; + +export type StripeCustomCheckoutExpressCheckoutElement = StripeElementBase & { + /** + * Triggered when the element is fully rendered. + */ + on( + eventType: 'ready', + handler: (event: StripeExpressCheckoutElementReadyEvent) => any + ): StripeCustomCheckoutExpressCheckoutElement; + once( + eventType: 'ready', + handler: (event: StripeExpressCheckoutElementReadyEvent) => any + ): StripeCustomCheckoutExpressCheckoutElement; + off( + eventType: 'ready', + handler?: (event: StripeExpressCheckoutElementReadyEvent) => any + ): StripeCustomCheckoutExpressCheckoutElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: { + elementType: 'expressCheckout'; + error: StripeError; + }) => any + ): StripeCustomCheckoutExpressCheckoutElement; + once( + eventType: 'loaderror', + handler: (event: { + elementType: 'expressCheckout'; + error: StripeError; + }) => any + ): StripeCustomCheckoutExpressCheckoutElement; + off( + eventType: 'loaderror', + handler?: (event: { + elementType: 'expressCheckout'; + error: StripeError; + }) => any + ): StripeCustomCheckoutExpressCheckoutElement; + + /** + * Triggered when a buyer authorizes a payment within a supported payment method. + */ + on( + eventType: 'confirm', + handler: ( + event: StripeCustomCheckoutExpressCheckoutElementConfirmEvent + ) => any + ): StripeCustomCheckoutExpressCheckoutElement; + once( + eventType: 'confirm', + handler: ( + event: StripeCustomCheckoutExpressCheckoutElementConfirmEvent + ) => any + ): StripeCustomCheckoutExpressCheckoutElement; + off( + eventType: 'confirm', + handler?: ( + event: StripeCustomCheckoutExpressCheckoutElementConfirmEvent + ) => any + ): StripeCustomCheckoutExpressCheckoutElement; + + /** + * Updates the options the `ExpressCheckoutElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update: StripeExpressCheckoutElement['update']; +}; + +export interface StripeCustomCheckout { + /* Custom Checkout methods */ + applyPromotionCode: ( + promotionCode: string + ) => Promise<StripeCustomCheckoutResult>; + removePromotionCode: () => Promise<StripeCustomCheckoutResult>; + updateShippingAddress: ( + shippingAddress: StripeCustomCheckoutContact | null + ) => Promise<StripeCustomCheckoutResult>; + updateBillingAddress: ( + billingAddress: StripeCustomCheckoutContact | null + ) => Promise<StripeCustomCheckoutResult>; + updatePhoneNumber: (phoneNumber: string) => void; + updateEmail: (email: string) => void; + updateLineItemQuantity: (args: { + lineItem: string; + quantity: number; + }) => Promise<StripeCustomCheckoutResult>; + updateShippingOption: ( + shippingOption: string + ) => Promise<StripeCustomCheckoutResult>; + confirm: (args?: { + return_url?: string; + }) => Promise<StripeCustomCheckoutResult>; + session: () => StripeCustomCheckoutSession; + on: (event: 'change', handler: StripeCustomCheckoutUpdateHandler) => void; + + /* Elements methods */ + changeAppearance: (appearance: Appearance) => void; + getElement(elementType: 'payment'): StripePaymentElement | null; + getElement( + elementType: 'address', + mode: AddressMode + ): StripeAddressElement | null; + getElement( + elementType: 'expressCheckout' + ): StripeCustomCheckoutExpressCheckoutElement | null; + createElement( + elementType: 'payment', + options?: StripeCustomCheckoutPaymentElementOptions + ): StripePaymentElement; + createElement( + elementType: 'address', + options: StripeCustomCheckoutAddressElementOptions + ): StripeAddressElement; + createElement( + elementType: 'expressCheckout', + options: StripeCustomCheckoutExpressCheckoutElementOptions + ): StripeCustomCheckoutExpressCheckoutElement; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/custom-checkout.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/custom-checkout.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..95ec038eca070a027e91be7710c528b5dc371ac1 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/custom-checkout.d.ts @@ -0,0 +1,402 @@ +import { + LayoutObject, + Layout, + TermsOption, + StripePaymentElement, +} from './elements/payment'; +import { + AddressMode, + ContactOption, + StripeAddressElement, +} from './elements/address'; +import {Appearance, CssFontSource, CustomFontSource} from './elements-group'; +import {StripeError} from './stripe'; +import { + StripeElementBase, + StripeExpressCheckoutElement, + StripeExpressCheckoutElementConfirmEvent, + StripeExpressCheckoutElementOptions, + StripeExpressCheckoutElementReadyEvent, +} from './elements'; + +/** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + +export interface StripeCustomCheckoutElementsOptions { + appearance?: Appearance; + loader?: 'auto' | 'always' | 'never'; + fonts?: Array<CssFontSource | CustomFontSource>; +} + +export interface StripeCustomCheckoutOptions { + clientSecret: string; + elementsOptions?: StripeCustomCheckoutElementsOptions; +} + +/* Custom Checkout types */ +export type StripeCustomCheckoutAddress = { + country: string; + line1?: string | null; + line2?: string | null; + city?: string | null; + postal_code?: string | null; + state?: string | null; +}; + +export type StripeCustomCheckoutAdjustableQuantity = { + maximum: number; + minimum: number; +}; + +export type StripeCustomCheckoutBillingInterval = + | 'day' + | 'month' + | 'week' + | 'year'; + +export type StripeCustomCheckoutConfirmationRequirement = + | 'phoneNumber' + | 'shippingAddress' + | 'billingAddress' + | 'paymentDetails' + | 'email'; + +export type StripeCustomCheckoutContact = { + name?: string | null; + address: StripeCustomCheckoutAddress; +}; + +export type StripeCustomCheckoutDeliveryEstimate = { + maximum: StripeCustomCheckoutEstimate | null; + minimum: StripeCustomCheckoutEstimate | null; +}; + +export type StripeCustomCheckoutDiscountAmount = { + amount: number; + displayName: string; + promotionCode: string | null; + recurring: + | {type: 'forever'} + | {type: 'repeating'; durationInMonths: number} + | null; +}; + +export type StripeCustomCheckoutDueNext = { + amountSubtotal: number; + amountDiscount: number; + amountTaxInclusive: number; + amountTaxExclusive: number; + billingCycleAnchor: number | null; +}; + +export type StripeCustomCheckoutEstimate = { + unit: 'business_day' | 'day' | 'hour' | 'week' | 'month'; + value: number; +}; + +export type StripeCustomCheckoutLastPaymentError = { + message: string; +}; + +export type StripeCustomCheckoutTaxAmount = { + amount: number; + inclusive: boolean; + displayName: string; +}; + +export type StripeCustomCheckoutLineItem = { + id: string; + name: string; + amountDiscount: number; + amountSubtotal: number; + amountTaxExclusive: number; + amountTaxInclusive: number; + unitAmount: number; + description: string | null; + quantity: number; + discountAmounts: Array<StripeCustomCheckoutDiscountAmount> | null; + taxAmounts: Array<StripeCustomCheckoutTaxAmount> | null; + recurring: { + interval: StripeCustomCheckoutBillingInterval; + intervalCount: number; + isProrated: boolean; + usageType: 'metered' | 'licensed'; + } | null; + adjustableQuantity: StripeCustomCheckoutAdjustableQuantity | null; +}; + +export type StripeCustomCheckoutRecurring = { + interval: StripeCustomCheckoutBillingInterval; + intervalCount: number; + dueNext: StripeCustomCheckoutDueNext; + trial: StripeCustomCheckoutTrial | null; +}; + +export type StripeCustomCheckoutShipping = { + shippingOption: StripeCustomCheckoutShippingOption; + taxAmounts: Array<StripeCustomCheckoutTaxAmount> | null; +}; + +export type StripeCustomCheckoutShippingOption = { + id: string; + amount: number; + currency: string; + displayName: string | null; + deliveryEstimate: StripeCustomCheckoutDeliveryEstimate | null; +}; + +export type StripeCustomCheckoutStatus = + | {type: 'open'} + | {type: 'expired'} + | { + type: 'complete'; + paymentStatus: 'paid' | 'unpaid' | 'no_payment_required'; + }; + +export type StripeCustomCheckoutTaxStatus = + | {status: 'ready'} + | {status: 'requires_shipping_address'} + | {status: 'requires_billing_address'}; + +export type StripeCustomCheckoutTotalSummary = { + appliedBalance: number; + balanceAppliedToNextInvoice: boolean; + discount: number; + shippingRate: number; + subtotal: number; + taxExclusive: number; + taxInclusive: number; + total: number; +}; + +export type StripeCustomCheckoutTrial = { + trialEnd: number; + trialPeriodDays: number; +}; + +/* Custom Checkout session */ +export interface StripeCustomCheckoutSession { + billingAddress: StripeCustomCheckoutContact | null; + canConfirm: boolean; + confirmationRequirements: StripeCustomCheckoutConfirmationRequirement[]; + currency: string; + discountAmounts: Array<StripeCustomCheckoutDiscountAmount> | null; + email: string | null; + lastPaymentError: StripeCustomCheckoutLastPaymentError | null; + lineItems: Array<StripeCustomCheckoutLineItem>; + phoneNumber: string | null; + recurring: StripeCustomCheckoutRecurring | null; + shipping: StripeCustomCheckoutShipping | null; + shippingAddress: StripeCustomCheckoutContact | null; + shippingOptions: Array<StripeCustomCheckoutShippingOption>; + status: StripeCustomCheckoutStatus; + tax: StripeCustomCheckoutTaxStatus; + taxAmounts: Array<StripeCustomCheckoutTaxAmount> | null; + total: StripeCustomCheckoutTotalSummary; +} + +export type StripeCustomCheckoutResult = + | {session: StripeCustomCheckoutSession; error?: undefined} + | {session?: undefined; error: StripeError}; + +export type StripeCustomCheckoutPaymentElementOptions = { + layout?: Layout | LayoutObject; + paymentMethodOrder?: Array<string>; + readonly?: boolean; + terms?: TermsOption; +}; + +export type StripeCustomCheckoutAddressElementOptions = { + mode: AddressMode; + contacts?: ContactOption[]; + display?: { + name?: 'full' | 'split' | 'organization'; + }; +}; + +export type StripeCustomCheckoutExpressCheckoutElementOptions = { + buttonHeight: StripeExpressCheckoutElementOptions['buttonHeight']; + buttonTheme: StripeExpressCheckoutElementOptions['buttonTheme']; + buttonType: StripeExpressCheckoutElementOptions['buttonType']; + layout: StripeExpressCheckoutElementOptions['layout']; +}; + +export type StripeCustomCheckoutUpdateHandler = ( + session: StripeCustomCheckoutSession +) => void; + +export type StripeCustomCheckoutExpressCheckoutElementConfirmEvent = StripeExpressCheckoutElementConfirmEvent & { + confirm: () => Promise<StripeCustomCheckoutResult>; +}; + +export type StripeCustomCheckoutExpressCheckoutElement = StripeElementBase & { + /** + * Triggered when the element is fully rendered. + */ + on( + eventType: 'ready', + handler: (event: StripeExpressCheckoutElementReadyEvent) => any + ): StripeCustomCheckoutExpressCheckoutElement; + once( + eventType: 'ready', + handler: (event: StripeExpressCheckoutElementReadyEvent) => any + ): StripeCustomCheckoutExpressCheckoutElement; + off( + eventType: 'ready', + handler?: (event: StripeExpressCheckoutElementReadyEvent) => any + ): StripeCustomCheckoutExpressCheckoutElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeCustomCheckoutExpressCheckoutElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: { + elementType: 'expressCheckout'; + error: StripeError; + }) => any + ): StripeCustomCheckoutExpressCheckoutElement; + once( + eventType: 'loaderror', + handler: (event: { + elementType: 'expressCheckout'; + error: StripeError; + }) => any + ): StripeCustomCheckoutExpressCheckoutElement; + off( + eventType: 'loaderror', + handler?: (event: { + elementType: 'expressCheckout'; + error: StripeError; + }) => any + ): StripeCustomCheckoutExpressCheckoutElement; + + /** + * Triggered when a buyer authorizes a payment within a supported payment method. + */ + on( + eventType: 'confirm', + handler: ( + event: StripeCustomCheckoutExpressCheckoutElementConfirmEvent + ) => any + ): StripeCustomCheckoutExpressCheckoutElement; + once( + eventType: 'confirm', + handler: ( + event: StripeCustomCheckoutExpressCheckoutElementConfirmEvent + ) => any + ): StripeCustomCheckoutExpressCheckoutElement; + off( + eventType: 'confirm', + handler?: ( + event: StripeCustomCheckoutExpressCheckoutElementConfirmEvent + ) => any + ): StripeCustomCheckoutExpressCheckoutElement; + + /** + * Updates the options the `ExpressCheckoutElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update: StripeExpressCheckoutElement['update']; +}; + +export interface StripeCustomCheckout { + /* Custom Checkout methods */ + applyPromotionCode: ( + promotionCode: string + ) => Promise<StripeCustomCheckoutResult>; + removePromotionCode: () => Promise<StripeCustomCheckoutResult>; + updateShippingAddress: ( + shippingAddress: StripeCustomCheckoutContact | null + ) => Promise<StripeCustomCheckoutResult>; + updateBillingAddress: ( + billingAddress: StripeCustomCheckoutContact | null + ) => Promise<StripeCustomCheckoutResult>; + updatePhoneNumber: (phoneNumber: string) => void; + updateEmail: (email: string) => void; + updateLineItemQuantity: (args: { + lineItem: string; + quantity: number; + }) => Promise<StripeCustomCheckoutResult>; + updateShippingOption: ( + shippingOption: string + ) => Promise<StripeCustomCheckoutResult>; + confirm: (args?: { + return_url?: string; + }) => Promise<StripeCustomCheckoutResult>; + session: () => StripeCustomCheckoutSession; + on: (event: 'change', handler: StripeCustomCheckoutUpdateHandler) => void; + + /* Elements methods */ + changeAppearance: (appearance: Appearance) => void; + getElement(elementType: 'payment'): StripePaymentElement | null; + getElement( + elementType: 'address', + mode: AddressMode + ): StripeAddressElement | null; + getElement( + elementType: 'expressCheckout' + ): StripeCustomCheckoutExpressCheckoutElement | null; + createElement( + elementType: 'payment', + options?: StripeCustomCheckoutPaymentElementOptions + ): StripePaymentElement; + createElement( + elementType: 'address', + options: StripeCustomCheckoutAddressElementOptions + ): StripeAddressElement; + createElement( + elementType: 'expressCheckout', + options: StripeCustomCheckoutExpressCheckoutElementOptions + ): StripeCustomCheckoutExpressCheckoutElement; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements-group.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements-group.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..d976c74a686c69e3f5275d57caf31b6ba45357aa --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements-group.d.mts @@ -0,0 +1,1116 @@ +import { + StripeAddressElement, + StripeAddressElementOptions, + StripeShippingAddressElement, + StripeShippingAddressElementOptions, + StripePaymentRequestButtonElement, + StripePaymentRequestButtonElementOptions, + StripePaymentElement, + StripePaymentElementOptions, + StripeLinkAuthenticationElement, + StripeLinkAuthenticationElementOptions, + StripeIdealBankElement, + StripeIdealBankElementOptions, + StripeIbanElement, + StripeIbanElementOptions, + StripeP24BankElement, + StripeP24BankElementOptions, + StripeEpsBankElement, + StripeEpsBankElementOptions, + StripeFpxBankElement, + StripeFpxBankElementOptions, + StripeCardCvcElement, + StripeCardCvcElementOptions, + StripeCardExpiryElement, + StripeCardExpiryElementOptions, + StripeCardNumberElement, + StripeCardNumberElementOptions, + StripeCardElement, + StripeCardElementOptions, + StripeAuBankAccountElement, + StripeAfterpayClearpayMessageElementOptions, + StripeAffirmMessageElement, + StripeAffirmMessageElementOptions, + StripePaymentMethodMessagingElementOptions, + StripePaymentMethodMessagingElement, + StripeAfterpayClearpayMessageElement, + StripeAuBankAccountElementOptions, + StripeIssuingCardNumberDisplayElement, + StripeIssuingCardNumberDisplayElementOptions, + StripeIssuingCardCvcDisplayElement, + StripeIssuingCardCvcDisplayElementOptions, + StripeIssuingCardExpiryDisplayElement, + StripeIssuingCardExpiryDisplayElementOptions, + StripeIssuingCardPinDisplayElement, + StripeIssuingCardPinDisplayElementOptions, + StripeIssuingCardCopyButtonElement, + StripeIssuingCardCopyButtonElementOptions, + StripeExpressCheckoutElement, + StripeExpressCheckoutElementOptions, +} from './elements'; +import {StripeError} from './stripe'; + +export interface StripeElements { + /** + * Updates the options that `Elements` was initialized with. + * Updates are shallowly merged into the existing configuration. + */ + update(options: StripeElementsUpdateOptions): void; + + /** + * Fetches updates from the associated PaymentIntent or SetupIntent on an existing + * instance of Elements, and reflects these updates in the Payment Element. + */ + fetchUpdates(): Promise<{error?: {message: string; status?: string}}>; + + /** + * Before confirming payment, call elements.submit() to validate the state of the + * Payment Element and collect any data required for wallets. + */ + submit(): Promise<{error?: StripeError}>; + + ///////////////////////////// + /// address + ///////////////////////////// + + /** + * Creates an `AddressElement`. + */ + create( + elementType: 'address', + options: StripeAddressElementOptions + ): StripeAddressElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'address'): StripeAddressElement | null; + + ///////////////////////////// + /// paymentMethodMessaging + ///////////////////////////// + + /** + * Creates an `paymentMethodMessagingElement`. + */ + create( + elementType: 'paymentMethodMessaging', + options: StripePaymentMethodMessagingElementOptions + ): StripePaymentMethodMessagingElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement( + elementType: 'paymentMethodMessaging' + ): StripePaymentMethodMessagingElement | null; + + ///////////////////////////// + /// affirmMessage + ///////////////////////////// + + /** + * Creates an `AffirmMessageElement`. + */ + create( + elementType: 'affirmMessage', + options: StripeAffirmMessageElementOptions + ): StripeAffirmMessageElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'affirmMessage'): StripeAffirmMessageElement | null; + + ///////////////////////////// + /// afterpayClearpayMessage + ///////////////////////////// + + /** + * Creates an `AfterpayClearpayMessageElement`. + */ + create( + elementType: 'afterpayClearpayMessage', + options: StripeAfterpayClearpayMessageElementOptions + ): StripeAfterpayClearpayMessageElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement( + elementType: 'afterpayClearpayMessage' + ): StripeAfterpayClearpayMessageElement | null; + + ///////////////////////////// + /// auBankAccount + ///////////////////////////// + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Creates an `AuBankAccountElement`. + */ + create( + elementType: 'auBankAccount', + options?: StripeAuBankAccountElementOptions + ): StripeAuBankAccountElement; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'auBankAccount'): StripeAuBankAccountElement | null; + + ///////////////////////////// + /// card + ///////////////////////////// + + /** + * Creates a `CardElement`. + */ + create( + elementType: 'card', + options?: StripeCardElementOptions + ): StripeCardElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'card'): StripeCardElement | null; + + ///////////////////////////// + /// cardNumber + ///////////////////////////// + + /** + * Creates a `CardNumberElement`. + */ + create( + elementType: 'cardNumber', + options?: StripeCardNumberElementOptions + ): StripeCardNumberElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'cardNumber'): StripeCardNumberElement | null; + + ///////////////////////////// + /// cardExpiry + ///////////////////////////// + + /** + * Creates a `CardExpiryElement`. + */ + create( + elementType: 'cardExpiry', + options?: StripeCardExpiryElementOptions + ): StripeCardExpiryElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'cardExpiry'): StripeCardExpiryElement | null; + + ///////////////////////////// + /// cardCvc + ///////////////////////////// + + /** + * Creates a `CardCvcElement`. + */ + create( + elementType: 'cardCvc', + options?: StripeCardCvcElementOptions + ): StripeCardCvcElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'cardCvc'): StripeCardCvcElement | null; + + ///////////////////////////// + /// fpxBank + ///////////////////////////// + + /** + * Creates an `FpxBankElement`. + */ + create( + elementType: 'fpxBank', + options: StripeFpxBankElementOptions + ): StripeFpxBankElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'fpxBank'): StripeFpxBankElement | null; + + ///////////////////////////// + /// epsBank + ///////////////////////////// + + /** + * + * Creates an `EpsBankElement`. + */ + create( + elementType: 'epsBank', + options: StripeEpsBankElementOptions + ): StripeEpsBankElement; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'epsBank'): StripeEpsBankElement | null; + + ///////////////////////////// + /// p24Bank + ///////////////////////////// + + /** + * + * Creates an `P24BankElement`. + */ + create( + elementType: 'p24Bank', + options: StripeP24BankElementOptions + ): StripeP24BankElement; + + /** + * + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'p24Bank'): StripeP24BankElement | null; + + ///////////////////////////// + /// iban + ///////////////////////////// + + /** + * Creates an `IbanElement`. + */ + create( + elementType: 'iban', + options?: StripeIbanElementOptions + ): StripeIbanElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'iban'): StripeIbanElement | null; + + ///////////////////////////// + /// idealBank + ///////////////////////////// + + /** + * Creates an `IdealBankElement`. + */ + create( + elementType: 'idealBank', + options?: StripeIdealBankElementOptions + ): StripeIdealBankElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'idealBank'): StripeIdealBankElement | null; + + ///////////////////////////// + /// linkAuthentication + ///////////////////////////// + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Creates a `LinkAuthenticationElement`. + */ + create( + elementType: 'linkAuthentication', + options?: StripeLinkAuthenticationElementOptions + ): StripeLinkAuthenticationElement; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Looks up a previously created `Element` by its type. + */ + getElement( + elementType: 'linkAuthentication' + ): StripeLinkAuthenticationElement | null; + + ///////////////////////////// + /// expressCheckout + ///////////////////////////// + + /** + * Creates an `ExpressCheckoutElement`. + */ + create( + elementType: 'expressCheckout', + options?: StripeExpressCheckoutElementOptions + ): StripeExpressCheckoutElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement( + elementType: 'expressCheckout' + ): StripeExpressCheckoutElement | null; + + ///////////////////////////// + /// payment + ///////////////////////////// + + /** + * Creates a `PaymentElement`. + * + * @docs https://stripe.com/docs/payments/payment-element + */ + create( + elementType: 'payment', + options?: StripePaymentElementOptions + ): StripePaymentElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'payment'): StripePaymentElement | null; + + ///////////////////////////// + /// paymentRequestButton + ///////////////////////////// + + /** + * Creates a `PaymentRequestButtonElement`. + * + * @docs https://stripe.com/docs/stripe-js/elements/payment-request-button + */ + create( + elementType: 'paymentRequestButton', + options: StripePaymentRequestButtonElementOptions + ): StripePaymentRequestButtonElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement( + elementType: 'paymentRequestButton' + ): StripePaymentRequestButtonElement | null; + + ///////////////////////////// + /// shippingAddress + ///////////////////////////// + + /** + * @deprecated + * Use `Address` element instead. + * + * Creates a `ShippingAddressElement`. + */ + create( + elementType: 'shippingAddress', + options?: StripeShippingAddressElementOptions + ): StripeShippingAddressElement; + + /** + * @deprecated + * Use `Address` element instead. + * + * Looks up a previously created `Element` by its type. + */ + getElement( + elementType: 'shippingAddress' + ): StripeShippingAddressElement | null; + + ///////////////////////////// + /// issuing + ///////////////////////////// + + /** + * Creates an `issuingCardNumberDisplay` Element + * + * @docs https://stripe.com/docs/js/issuing_elements/create?type=issuingCardNumberDisplay + */ + create( + elementType: 'issuingCardNumberDisplay', + options: StripeIssuingCardNumberDisplayElementOptions + ): StripeIssuingCardNumberDisplayElement; + + /** + * Creates an `issuingCardCvcDisplay` Element + * + * @docs https://stripe.com/docs/js/issuing_elements/create?type=issuingCardCvcDisplay + */ + create( + elementType: 'issuingCardCvcDisplay', + options: StripeIssuingCardCvcDisplayElementOptions + ): StripeIssuingCardCvcDisplayElement; + + /** + * Creates an `issuingCardExpiryDisplay` Element + * + * @docs https://stripe.com/docs/js/issuing_elements/create?type=issuingCardExpiryDisplay + */ + create( + elementType: 'issuingCardExpiryDisplay', + options: StripeIssuingCardExpiryDisplayElementOptions + ): StripeIssuingCardExpiryDisplayElement; + + /** + * Creates an `issuingCardPinDisplay` Element + * + * @docs https://stripe.com/docs/js/issuing_elements/create?type=issuingCardPinDisplay + */ + create( + elementType: 'issuingCardPinDisplay', + options: StripeIssuingCardPinDisplayElementOptions + ): StripeIssuingCardPinDisplayElement; + + /** + * Creates an `issuingCardCopyButton` Element + * + * @docs https://stripe.com/docs/js/issuing_elements/create?type=issuingCardCopyButton + */ + create( + elementType: 'issuingCardCopyButton', + options: StripeIssuingCardCopyButtonElementOptions + ): StripeIssuingCardCopyButtonElement; +} + +export type StripeElementType = + | 'address' + | 'affirmMessage' + | 'afterpayClearpayMessage' + | 'auBankAccount' + | 'card' + | 'cardNumber' + | 'cardExpiry' + | 'cardCvc' + | 'epsBank' + | 'expressCheckout' + | 'fpxBank' + | 'iban' + | 'idealBank' + | 'p24Bank' + | 'payment' + | 'paymentMethodMessaging' + | 'paymentRequestButton' + | 'linkAuthentication' + | 'shippingAddress' + | 'issuingCardNumberDisplay' + | 'issuingCardCvcDisplay' + | 'issuingCardExpiryDisplay' + | 'issuingCardPinDisplay' + | 'issuingCardCopyButton'; + +export type StripeElement = + | StripeAddressElement + | StripeAffirmMessageElement + | StripeAfterpayClearpayMessageElement + | StripeAuBankAccountElement + | StripeCardElement + | StripeCardNumberElement + | StripeCardExpiryElement + | StripeCardCvcElement + | StripeEpsBankElement + | StripeFpxBankElement + | StripeIbanElement + | StripeIdealBankElement + | StripeP24BankElement + | StripeExpressCheckoutElement + | StripePaymentElement + | StripePaymentMethodMessagingElement + | StripePaymentRequestButtonElement + | StripeIssuingCardNumberDisplayElement + | StripeIssuingCardCvcDisplayElement + | StripeIssuingCardExpiryDisplayElement + | StripeIssuingCardPinDisplayElement + | StripeIssuingCardCopyButtonElement + | StripeShippingAddressElement; + +export type StripeElementLocale = + | 'auto' + | 'ar' + | 'bg' + | 'cs' + | 'da' + | 'de' + | 'el' + | 'en' + | 'en-AU' + | 'en-CA' + | 'en-NZ' + | 'en-GB' + | 'es' + | 'es-ES' + | 'es-419' + | 'et' + | 'fi' + | 'fil' + | 'fr' + | 'fr-CA' + | 'fr-FR' + | 'he' + | 'hu' + | 'hr' + | 'id' + | 'it' + | 'it-IT' + | 'ja' + | 'ko' + | 'lt' + | 'lv' + | 'ms' + | 'mt' + | 'nb' + | 'nl' + | 'no' + | 'pl' + | 'pt' + | 'pt-BR' + | 'ro' + | 'ru' + | 'sk' + | 'sl' + | 'sv' + | 'th' + | 'tr' + | 'vi' + | 'zh' + | 'zh-HK' + | 'zh-TW'; + +export type CardNetworkBrand = + | 'accel' + | 'amex' + | 'carnet' + | 'cartes_bancaires' + | 'diners' + | 'discover' + | 'eftpos_au' + | 'elo' + | 'girocard' + | 'interac' + | 'jcb' + | 'mastercard' + | 'nyce' + | 'pulse' + | 'rupay' + | 'star' + | 'unionpay' + | 'visa'; + +type PaymentMethodOptions = { + card?: {require_cvc_recollection?: boolean}; + us_bank_account?: { + financial_connections?: { + permissions?: Array< + 'balances' | 'ownership' | 'payment_method' | 'transactions' + >; + }; + verification_method?: 'automatic' | 'instant'; + }; +}; + +/** + * Options to create an `Elements` instance with. + */ +interface BaseStripeElementsOptions { + /** + * An array of custom fonts, which elements created from the `Elements` object can use. + */ + fonts?: Array<CssFontSource | CustomFontSource>; + + /** + * The [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the locale to display placeholders and error strings in. + * Default is `auto` (Stripe detects the locale of the browser). + * Setting the locale does not affect the behavior of postal code validation—a valid postal code for the billing country of the card is still required. + */ + locale?: StripeElementLocale; + + /** + * Match the Payment Element with the design of your site with the appearance option. + * The layout of the Payment Element stays consistent, but you can modify colors, fonts, borders, padding, and more. + * + * @docs https://stripe.com/docs/stripe-js/appearance-api + */ + appearance?: Appearance; + + /** + * Display skeleton loader UI while waiting for Elements to be fully loaded, after they are mounted. + * Supported for the `payment`, `shippingAddress`, and `linkAuthentication` Elements. + * Default is `'auto'` (Stripe determines if a loader UI should be shown). + */ + loader?: 'auto' | 'always' | 'never'; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Display saved PaymentMethods and Customer information. + * Supported for the `payment`, `shippingAddress`, and `linkAuthentication` Elements. + */ + customerOptions?: CustomerOptions; +} + +export interface StripeElementsOptionsClientSecret + extends BaseStripeElementsOptions { + /** + * The client secret for a PaymentIntent or SetupIntent used by the Payment Element. + * + * @docs https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret + */ + clientSecret?: string; + + /** + * Either use mode or clientSecret when creating an Elements group + */ + mode?: never; +} + +export interface StripeElementsOptionsMode extends BaseStripeElementsOptions { + /** + * Whether the Payment Element will be used to create a PaymentIntent, SetupIntent, or Subscription. + */ + mode?: 'payment' | 'setup' | 'subscription'; + + /** + * Three character currency code (e.g., usd). + */ + currency?: string; + + /** + * The amount to be charged. Shown in Apple Pay, Google Pay, or Buy now pay later UIs, and influences available payment methods. + */ + amount?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent’s payment method. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage + */ + setupFutureUsage?: 'off_session' | 'on_session' | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent’s payment method. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage + */ + setup_future_usage?: 'off_session' | 'on_session' | null; + + /** + * Controls when the funds will be captured from the customer’s account. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method + */ + captureMethod?: 'manual' | 'automatic'; + + /** + * Controls when the funds will be captured from the customer’s account. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method + */ + capture_method?: 'manual' | 'automatic'; + + /** + * The Stripe account ID which is the business of record. + * + * @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-onBehalfOf + */ + onBehalfOf?: string; + + /** + * The Stripe account ID which is the business of record. + * + * @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-onBehalfOf + */ + on_behalf_of?: string; + + /** + * Instead of using automatic payment methods, declare specific payment methods to enable. + * + * @docs https://stripe.com/docs/payments/payment-methods/overview + */ + paymentMethodTypes?: string[]; + + /** + * Instead of using automatic payment methods, declare specific payment methods to enable. + * + * @docs https://stripe.com/docs/payments/payment-methods/overview + */ + payment_method_types?: string[]; + + /** + * When using automatic payment methods (omitting paymentMethodTypes), provide a + * payment method configuration ID for deriving payment methods. + * + * @docs https://stripe.com/docs/connect/payment-method-configurations + */ + paymentMethodConfiguration?: string; + + /** + * When using automatic payment methods (omitting payment_method_types), provide a + * payment method configuration ID for deriving payment methods. + * + * @docs https://stripe.com/docs/connect/payment-method-configurations + */ + payment_method_configuration?: string; + + /** + * Allows PaymentMethods to be created from the Elements instance. + */ + paymentMethodCreation?: 'manual'; + + /** + * Additional payment-method-specific options for configuring Payment Element behavior. + * + * @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-paymentMethodOptions + */ + paymentMethodOptions?: PaymentMethodOptions; + + /** + * Additional payment-method-specific options for configuring Payment Element behavior. + * + * @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-paymentMethodOptions + */ + payment_method_options?: PaymentMethodOptions; + + /** + * Either use mode or clientSecret when creating an Elements group + */ + clientSecret?: never; + + /** + * The external payment methods to be displayed in the Payment Element that you are already integrated with. + * + * @docs https://stripe.com/docs/js/elements_object/create#stripe_elements-options-externalPaymentMethodTypes + */ + externalPaymentMethodTypes?: string[]; +} + +export type StripeElementsOptions = + | StripeElementsOptionsClientSecret + | StripeElementsOptionsMode; + +/* + * Updatable options for an `Elements` instance + */ +export interface StripeElementsUpdateOptions { + /** + * The [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the locale to display placeholders and error strings in. + * Default is `auto` (Stripe detects the locale of the browser). + * Setting the locale does not affect the behavior of postal code validation—a valid postal code for the billing country of the card is still required. + */ + locale?: StripeElementLocale; + + /** + * Match the design of your site with the appearance option. + * The layout of each Element stays consistent, but you can modify colors, fonts, borders, padding, and more. + * + * @docs https://stripe.com/docs/stripe-js/appearance-api + */ + appearance?: Appearance; + + /** + * Whether the Payment Element will be used to create a PaymentIntent, SetupIntent, or Subscription. + */ + mode?: 'payment' | 'setup' | 'subscription'; + + /** + * Three character currency code (e.g., usd). + */ + currency?: string; + + /** + * The amount to be charged. Shown in Apple Pay, Google Pay, or Buy now pay later UIs, and influences available payment methods. + */ + amount?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent’s payment method. + * + * @docs https://stripe.com/docs/api/payment_intents/update#update_payment_intent-setup_future_usage + */ + setupFutureUsage?: 'off_session' | 'on_session' | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent’s payment method. + * + * @docs https://stripe.com/docs/api/payment_intents/update#update_payment_intent-setup_future_usage + */ + setup_future_usage?: 'off_session' | 'on_session' | null; + + /** + * Controls when the funds will be captured from the customer’s account. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method + */ + captureMethod?: 'manual' | 'automatic'; + + /** + * Controls when the funds will be captured from the customer’s account. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method + */ + capture_method?: 'manual' | 'automatic'; + + /** + * Instead of using automatic payment methods, declare specific payment methods to enable. + * + * @docs https://stripe.com/docs/payments/payment-methods/overview + */ + payment_method_types?: string[]; + + /** + * Instead of using automatic payment methods, declare specific payment methods to enable. + * + * @docs https://stripe.com/docs/payments/payment-methods/overview + */ + paymentMethodTypes?: string[]; + + /** + * The Stripe account ID which is the business of record. + * + * @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-onBehalfOf + */ + onBehalfOf?: string; + + /** + * The Stripe account ID which is the business of record. + * + * @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-onBehalfOf + */ + on_behalf_of?: string; +} + +/* + * Use a `CssFontSource` to pass custom fonts via a stylesheet URL when creating an `Elements` object. + */ +export interface CssFontSource { + /** + * A relative or absolute URL pointing to a CSS file with [@font-face](https://developer.mozilla.org/en/docs/Web/CSS/@font-face) definitions, for example: + * + * https://fonts.googleapis.com/css?family=Open+Sans + * + * Note that if you are using a [content security policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) (CSP), [additional directives](https://stripe.com/docs/security#content-security-policy) may be necessary. + */ + cssSrc: string; +} + +/* + * Use a `CustomFontSource` to pass custom fonts when creating an `Elements` object. + */ +export interface CustomFontSource { + /** + * The name to give the font + */ + family: string; + + /** + * A valid [src](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src) value pointing to your custom font file. + * This is usually (though not always) a link to a file with a `.woff` , `.otf`, or `.svg` suffix. + */ + src: string; + + /** + * A valid [font-display](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display) value. + */ + display?: string; + + /** + * Defaults to `normal`. + */ + style?: 'normal' | 'italic' | 'oblique'; + + /** + * A valid [unicode-range](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range) value. + */ + unicodeRange?: string; + + /** + * A valid [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight), as a string. + */ + weight?: string; +} + +/* + * @docs https://stripe.com/docs/stripe-js/appearance-api + */ +export interface Appearance { + disableAnimations?: boolean; + + theme?: 'stripe' | 'night' | 'flat'; + + variables?: { + // General font styles + fontFamily?: string; + fontSmooth?: string; + fontVariantLigatures?: string; + fontVariationSettings?: string; + fontLineHeight?: string; + + // Font sizes + fontSizeBase?: string; + fontSizeSm?: string; + fontSizeXs?: string; + fontSize2Xs?: string; + fontSize3Xs?: string; + fontSizeLg?: string; + fontSizeXl?: string; + + // Font weights + fontWeightLight?: string; + fontWeightNormal?: string; + fontWeightMedium?: string; + fontWeightBold?: string; + + // Spacing + spacingUnit?: string; + gridRowSpacing?: string; + gridColumnSpacing?: string; + tabSpacing?: string; + accordionItemSpacing?: string; + /** @deprecated Use gridRowSpacing instead. */ + spacingGridRow?: string; + /** @deprecated Use gridColumnSpacing instead. */ + spacingGridColumn?: string; + /** @deprecated Use tabSpacing instead. */ + spacingTab?: string; + /** @deprecated Use accordionItemSpacing instead. */ + spacingAccordionItem?: string; + + // Colors + colorPrimary?: string; + colorBackground?: string; + colorText?: string; + colorSuccess?: string; + colorDanger?: string; + colorWarning?: string; + + // Text variations + colorTextSecondary?: string; + colorTextPlaceholder?: string; + + // Accessible text + accessibleColorOnColorPrimary?: string; + accessibleColorOnColorBackground?: string; + accessibleColorOnColorSuccess?: string; + accessibleColorOnColorDanger?: string; + accessibleColorOnColorWarning?: string; + /** @deprecated Use accessibleColorOnColorPrimary instead. */ + colorPrimaryText?: string; + /** @deprecated Use accessibleColorOnColorBackground instead. */ + colorBackgroundText?: string; + /** @deprecated Use accessibleColorOnColorSuccess instead. */ + colorSuccessText?: string; + /** @deprecated Use accessibleColorOnColorDanger instead. */ + colorDangerText?: string; + /** @deprecated Use accessibleColorOnColorWarning instead. */ + colorWarningText?: string; + + // Icons + iconColor?: string; + iconHoverColor?: string; + iconCardErrorColor?: string; + iconCardCvcColor?: string; + iconCardCvcErrorColor?: string; + iconCheckmarkColor?: string; + iconChevronDownColor?: string; + iconChevronDownHoverColor?: string; + iconCloseColor?: string; + iconCloseHoverColor?: string; + iconLoadingIndicatorColor?: string; + iconMenuColor?: string; + iconMenuHoverColor?: string; + iconPasscodeDeviceColor?: string; + iconPasscodeDeviceHoverColor?: string; + iconPasscodeDeviceNotificationColor?: string; + iconRedirectColor?: string; + /** @deprecated Use iconColor instead. */ + colorIcon?: string; + /** @deprecated Use iconHoverColor instead. */ + colorIconHover?: string; + /** @deprecated Use iconCardErrorColor instead. */ + colorIconCardError?: string; + /** @deprecated Use iconCardCvcColor instead. */ + colorIconCardCvc?: string; + /** @deprecated Use iconCardCvcErrorColor instead. */ + colorIconCardCvcError?: string; + /** @deprecated Use iconCheckmarkColor instead. */ + colorIconCheckmark?: string; + /** @deprecated Use iconChevronDownColor instead. */ + colorIconChevronDown?: string; + /** @deprecated Use iconChevronDownHoverColor instead. */ + colorIconChevronDownHover?: string; + /** @deprecated Use iconRedirectColor instead. */ + colorIconRedirect?: string; + + // TabIcons + tabIconColor?: string; + tabIconHoverColor?: string; + tabIconSelectedColor?: string; + tabIconMoreColor?: string; + tabIconMoreHoverColor?: string; + /** @deprecated Use tabIconColor instead. */ + colorIconTab?: string; + /** @deprecated Use tabIconHoverColor instead. */ + colorIconTabHover?: string; + /** @deprecated Use tabIconHoverColor instead. */ + colorIconTabSelected?: string; + /** @deprecated Use tabIconMoreColor instead. */ + colorIconTabMore?: string; + /** @deprecated Use tabIconMoreHoverColor instead. */ + colorIconTabMoreHover?: string; + + // Logos + logoColor?: string; + tabLogoColor?: string; + tabLogoSelectedColor?: string; + blockLogoColor?: string; + /** @deprecated Use logoColor instead. */ + colorLogo?: string; + /** @deprecated Use tabLogoColor instead. */ + colorLogoTab?: string; + /** @deprecated Use tabLogoSelectedColor instead. */ + colorLogoTabSelected?: string; + /** @deprecated Use blockLogoColor instead. */ + colorLogoBlock?: string; + + // Focus + focusBoxShadow?: string; + focusOutline?: string; + + // Radius + borderRadius?: string; + }; + + rules?: { + [selector: string]: { + [cssPropertyName: string]: string; + }; + }; + + labels?: 'above' | 'floating'; +} + +export interface CustomerOptions { + /** + * The Customer id. + */ + customer: string; + + /** + * The ephemeral key for a Customer that grants temporary access to Customer data. + */ + ephemeralKey: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements-group.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements-group.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d976c74a686c69e3f5275d57caf31b6ba45357aa --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements-group.d.ts @@ -0,0 +1,1116 @@ +import { + StripeAddressElement, + StripeAddressElementOptions, + StripeShippingAddressElement, + StripeShippingAddressElementOptions, + StripePaymentRequestButtonElement, + StripePaymentRequestButtonElementOptions, + StripePaymentElement, + StripePaymentElementOptions, + StripeLinkAuthenticationElement, + StripeLinkAuthenticationElementOptions, + StripeIdealBankElement, + StripeIdealBankElementOptions, + StripeIbanElement, + StripeIbanElementOptions, + StripeP24BankElement, + StripeP24BankElementOptions, + StripeEpsBankElement, + StripeEpsBankElementOptions, + StripeFpxBankElement, + StripeFpxBankElementOptions, + StripeCardCvcElement, + StripeCardCvcElementOptions, + StripeCardExpiryElement, + StripeCardExpiryElementOptions, + StripeCardNumberElement, + StripeCardNumberElementOptions, + StripeCardElement, + StripeCardElementOptions, + StripeAuBankAccountElement, + StripeAfterpayClearpayMessageElementOptions, + StripeAffirmMessageElement, + StripeAffirmMessageElementOptions, + StripePaymentMethodMessagingElementOptions, + StripePaymentMethodMessagingElement, + StripeAfterpayClearpayMessageElement, + StripeAuBankAccountElementOptions, + StripeIssuingCardNumberDisplayElement, + StripeIssuingCardNumberDisplayElementOptions, + StripeIssuingCardCvcDisplayElement, + StripeIssuingCardCvcDisplayElementOptions, + StripeIssuingCardExpiryDisplayElement, + StripeIssuingCardExpiryDisplayElementOptions, + StripeIssuingCardPinDisplayElement, + StripeIssuingCardPinDisplayElementOptions, + StripeIssuingCardCopyButtonElement, + StripeIssuingCardCopyButtonElementOptions, + StripeExpressCheckoutElement, + StripeExpressCheckoutElementOptions, +} from './elements'; +import {StripeError} from './stripe'; + +export interface StripeElements { + /** + * Updates the options that `Elements` was initialized with. + * Updates are shallowly merged into the existing configuration. + */ + update(options: StripeElementsUpdateOptions): void; + + /** + * Fetches updates from the associated PaymentIntent or SetupIntent on an existing + * instance of Elements, and reflects these updates in the Payment Element. + */ + fetchUpdates(): Promise<{error?: {message: string; status?: string}}>; + + /** + * Before confirming payment, call elements.submit() to validate the state of the + * Payment Element and collect any data required for wallets. + */ + submit(): Promise<{error?: StripeError}>; + + ///////////////////////////// + /// address + ///////////////////////////// + + /** + * Creates an `AddressElement`. + */ + create( + elementType: 'address', + options: StripeAddressElementOptions + ): StripeAddressElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'address'): StripeAddressElement | null; + + ///////////////////////////// + /// paymentMethodMessaging + ///////////////////////////// + + /** + * Creates an `paymentMethodMessagingElement`. + */ + create( + elementType: 'paymentMethodMessaging', + options: StripePaymentMethodMessagingElementOptions + ): StripePaymentMethodMessagingElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement( + elementType: 'paymentMethodMessaging' + ): StripePaymentMethodMessagingElement | null; + + ///////////////////////////// + /// affirmMessage + ///////////////////////////// + + /** + * Creates an `AffirmMessageElement`. + */ + create( + elementType: 'affirmMessage', + options: StripeAffirmMessageElementOptions + ): StripeAffirmMessageElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'affirmMessage'): StripeAffirmMessageElement | null; + + ///////////////////////////// + /// afterpayClearpayMessage + ///////////////////////////// + + /** + * Creates an `AfterpayClearpayMessageElement`. + */ + create( + elementType: 'afterpayClearpayMessage', + options: StripeAfterpayClearpayMessageElementOptions + ): StripeAfterpayClearpayMessageElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement( + elementType: 'afterpayClearpayMessage' + ): StripeAfterpayClearpayMessageElement | null; + + ///////////////////////////// + /// auBankAccount + ///////////////////////////// + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Creates an `AuBankAccountElement`. + */ + create( + elementType: 'auBankAccount', + options?: StripeAuBankAccountElementOptions + ): StripeAuBankAccountElement; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'auBankAccount'): StripeAuBankAccountElement | null; + + ///////////////////////////// + /// card + ///////////////////////////// + + /** + * Creates a `CardElement`. + */ + create( + elementType: 'card', + options?: StripeCardElementOptions + ): StripeCardElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'card'): StripeCardElement | null; + + ///////////////////////////// + /// cardNumber + ///////////////////////////// + + /** + * Creates a `CardNumberElement`. + */ + create( + elementType: 'cardNumber', + options?: StripeCardNumberElementOptions + ): StripeCardNumberElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'cardNumber'): StripeCardNumberElement | null; + + ///////////////////////////// + /// cardExpiry + ///////////////////////////// + + /** + * Creates a `CardExpiryElement`. + */ + create( + elementType: 'cardExpiry', + options?: StripeCardExpiryElementOptions + ): StripeCardExpiryElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'cardExpiry'): StripeCardExpiryElement | null; + + ///////////////////////////// + /// cardCvc + ///////////////////////////// + + /** + * Creates a `CardCvcElement`. + */ + create( + elementType: 'cardCvc', + options?: StripeCardCvcElementOptions + ): StripeCardCvcElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'cardCvc'): StripeCardCvcElement | null; + + ///////////////////////////// + /// fpxBank + ///////////////////////////// + + /** + * Creates an `FpxBankElement`. + */ + create( + elementType: 'fpxBank', + options: StripeFpxBankElementOptions + ): StripeFpxBankElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'fpxBank'): StripeFpxBankElement | null; + + ///////////////////////////// + /// epsBank + ///////////////////////////// + + /** + * + * Creates an `EpsBankElement`. + */ + create( + elementType: 'epsBank', + options: StripeEpsBankElementOptions + ): StripeEpsBankElement; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'epsBank'): StripeEpsBankElement | null; + + ///////////////////////////// + /// p24Bank + ///////////////////////////// + + /** + * + * Creates an `P24BankElement`. + */ + create( + elementType: 'p24Bank', + options: StripeP24BankElementOptions + ): StripeP24BankElement; + + /** + * + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'p24Bank'): StripeP24BankElement | null; + + ///////////////////////////// + /// iban + ///////////////////////////// + + /** + * Creates an `IbanElement`. + */ + create( + elementType: 'iban', + options?: StripeIbanElementOptions + ): StripeIbanElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'iban'): StripeIbanElement | null; + + ///////////////////////////// + /// idealBank + ///////////////////////////// + + /** + * Creates an `IdealBankElement`. + */ + create( + elementType: 'idealBank', + options?: StripeIdealBankElementOptions + ): StripeIdealBankElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'idealBank'): StripeIdealBankElement | null; + + ///////////////////////////// + /// linkAuthentication + ///////////////////////////// + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Creates a `LinkAuthenticationElement`. + */ + create( + elementType: 'linkAuthentication', + options?: StripeLinkAuthenticationElementOptions + ): StripeLinkAuthenticationElement; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Looks up a previously created `Element` by its type. + */ + getElement( + elementType: 'linkAuthentication' + ): StripeLinkAuthenticationElement | null; + + ///////////////////////////// + /// expressCheckout + ///////////////////////////// + + /** + * Creates an `ExpressCheckoutElement`. + */ + create( + elementType: 'expressCheckout', + options?: StripeExpressCheckoutElementOptions + ): StripeExpressCheckoutElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement( + elementType: 'expressCheckout' + ): StripeExpressCheckoutElement | null; + + ///////////////////////////// + /// payment + ///////////////////////////// + + /** + * Creates a `PaymentElement`. + * + * @docs https://stripe.com/docs/payments/payment-element + */ + create( + elementType: 'payment', + options?: StripePaymentElementOptions + ): StripePaymentElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement(elementType: 'payment'): StripePaymentElement | null; + + ///////////////////////////// + /// paymentRequestButton + ///////////////////////////// + + /** + * Creates a `PaymentRequestButtonElement`. + * + * @docs https://stripe.com/docs/stripe-js/elements/payment-request-button + */ + create( + elementType: 'paymentRequestButton', + options: StripePaymentRequestButtonElementOptions + ): StripePaymentRequestButtonElement; + + /** + * Looks up a previously created `Element` by its type. + */ + getElement( + elementType: 'paymentRequestButton' + ): StripePaymentRequestButtonElement | null; + + ///////////////////////////// + /// shippingAddress + ///////////////////////////// + + /** + * @deprecated + * Use `Address` element instead. + * + * Creates a `ShippingAddressElement`. + */ + create( + elementType: 'shippingAddress', + options?: StripeShippingAddressElementOptions + ): StripeShippingAddressElement; + + /** + * @deprecated + * Use `Address` element instead. + * + * Looks up a previously created `Element` by its type. + */ + getElement( + elementType: 'shippingAddress' + ): StripeShippingAddressElement | null; + + ///////////////////////////// + /// issuing + ///////////////////////////// + + /** + * Creates an `issuingCardNumberDisplay` Element + * + * @docs https://stripe.com/docs/js/issuing_elements/create?type=issuingCardNumberDisplay + */ + create( + elementType: 'issuingCardNumberDisplay', + options: StripeIssuingCardNumberDisplayElementOptions + ): StripeIssuingCardNumberDisplayElement; + + /** + * Creates an `issuingCardCvcDisplay` Element + * + * @docs https://stripe.com/docs/js/issuing_elements/create?type=issuingCardCvcDisplay + */ + create( + elementType: 'issuingCardCvcDisplay', + options: StripeIssuingCardCvcDisplayElementOptions + ): StripeIssuingCardCvcDisplayElement; + + /** + * Creates an `issuingCardExpiryDisplay` Element + * + * @docs https://stripe.com/docs/js/issuing_elements/create?type=issuingCardExpiryDisplay + */ + create( + elementType: 'issuingCardExpiryDisplay', + options: StripeIssuingCardExpiryDisplayElementOptions + ): StripeIssuingCardExpiryDisplayElement; + + /** + * Creates an `issuingCardPinDisplay` Element + * + * @docs https://stripe.com/docs/js/issuing_elements/create?type=issuingCardPinDisplay + */ + create( + elementType: 'issuingCardPinDisplay', + options: StripeIssuingCardPinDisplayElementOptions + ): StripeIssuingCardPinDisplayElement; + + /** + * Creates an `issuingCardCopyButton` Element + * + * @docs https://stripe.com/docs/js/issuing_elements/create?type=issuingCardCopyButton + */ + create( + elementType: 'issuingCardCopyButton', + options: StripeIssuingCardCopyButtonElementOptions + ): StripeIssuingCardCopyButtonElement; +} + +export type StripeElementType = + | 'address' + | 'affirmMessage' + | 'afterpayClearpayMessage' + | 'auBankAccount' + | 'card' + | 'cardNumber' + | 'cardExpiry' + | 'cardCvc' + | 'epsBank' + | 'expressCheckout' + | 'fpxBank' + | 'iban' + | 'idealBank' + | 'p24Bank' + | 'payment' + | 'paymentMethodMessaging' + | 'paymentRequestButton' + | 'linkAuthentication' + | 'shippingAddress' + | 'issuingCardNumberDisplay' + | 'issuingCardCvcDisplay' + | 'issuingCardExpiryDisplay' + | 'issuingCardPinDisplay' + | 'issuingCardCopyButton'; + +export type StripeElement = + | StripeAddressElement + | StripeAffirmMessageElement + | StripeAfterpayClearpayMessageElement + | StripeAuBankAccountElement + | StripeCardElement + | StripeCardNumberElement + | StripeCardExpiryElement + | StripeCardCvcElement + | StripeEpsBankElement + | StripeFpxBankElement + | StripeIbanElement + | StripeIdealBankElement + | StripeP24BankElement + | StripeExpressCheckoutElement + | StripePaymentElement + | StripePaymentMethodMessagingElement + | StripePaymentRequestButtonElement + | StripeIssuingCardNumberDisplayElement + | StripeIssuingCardCvcDisplayElement + | StripeIssuingCardExpiryDisplayElement + | StripeIssuingCardPinDisplayElement + | StripeIssuingCardCopyButtonElement + | StripeShippingAddressElement; + +export type StripeElementLocale = + | 'auto' + | 'ar' + | 'bg' + | 'cs' + | 'da' + | 'de' + | 'el' + | 'en' + | 'en-AU' + | 'en-CA' + | 'en-NZ' + | 'en-GB' + | 'es' + | 'es-ES' + | 'es-419' + | 'et' + | 'fi' + | 'fil' + | 'fr' + | 'fr-CA' + | 'fr-FR' + | 'he' + | 'hu' + | 'hr' + | 'id' + | 'it' + | 'it-IT' + | 'ja' + | 'ko' + | 'lt' + | 'lv' + | 'ms' + | 'mt' + | 'nb' + | 'nl' + | 'no' + | 'pl' + | 'pt' + | 'pt-BR' + | 'ro' + | 'ru' + | 'sk' + | 'sl' + | 'sv' + | 'th' + | 'tr' + | 'vi' + | 'zh' + | 'zh-HK' + | 'zh-TW'; + +export type CardNetworkBrand = + | 'accel' + | 'amex' + | 'carnet' + | 'cartes_bancaires' + | 'diners' + | 'discover' + | 'eftpos_au' + | 'elo' + | 'girocard' + | 'interac' + | 'jcb' + | 'mastercard' + | 'nyce' + | 'pulse' + | 'rupay' + | 'star' + | 'unionpay' + | 'visa'; + +type PaymentMethodOptions = { + card?: {require_cvc_recollection?: boolean}; + us_bank_account?: { + financial_connections?: { + permissions?: Array< + 'balances' | 'ownership' | 'payment_method' | 'transactions' + >; + }; + verification_method?: 'automatic' | 'instant'; + }; +}; + +/** + * Options to create an `Elements` instance with. + */ +interface BaseStripeElementsOptions { + /** + * An array of custom fonts, which elements created from the `Elements` object can use. + */ + fonts?: Array<CssFontSource | CustomFontSource>; + + /** + * The [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the locale to display placeholders and error strings in. + * Default is `auto` (Stripe detects the locale of the browser). + * Setting the locale does not affect the behavior of postal code validation—a valid postal code for the billing country of the card is still required. + */ + locale?: StripeElementLocale; + + /** + * Match the Payment Element with the design of your site with the appearance option. + * The layout of the Payment Element stays consistent, but you can modify colors, fonts, borders, padding, and more. + * + * @docs https://stripe.com/docs/stripe-js/appearance-api + */ + appearance?: Appearance; + + /** + * Display skeleton loader UI while waiting for Elements to be fully loaded, after they are mounted. + * Supported for the `payment`, `shippingAddress`, and `linkAuthentication` Elements. + * Default is `'auto'` (Stripe determines if a loader UI should be shown). + */ + loader?: 'auto' | 'always' | 'never'; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Display saved PaymentMethods and Customer information. + * Supported for the `payment`, `shippingAddress`, and `linkAuthentication` Elements. + */ + customerOptions?: CustomerOptions; +} + +export interface StripeElementsOptionsClientSecret + extends BaseStripeElementsOptions { + /** + * The client secret for a PaymentIntent or SetupIntent used by the Payment Element. + * + * @docs https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret + */ + clientSecret?: string; + + /** + * Either use mode or clientSecret when creating an Elements group + */ + mode?: never; +} + +export interface StripeElementsOptionsMode extends BaseStripeElementsOptions { + /** + * Whether the Payment Element will be used to create a PaymentIntent, SetupIntent, or Subscription. + */ + mode?: 'payment' | 'setup' | 'subscription'; + + /** + * Three character currency code (e.g., usd). + */ + currency?: string; + + /** + * The amount to be charged. Shown in Apple Pay, Google Pay, or Buy now pay later UIs, and influences available payment methods. + */ + amount?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent’s payment method. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage + */ + setupFutureUsage?: 'off_session' | 'on_session' | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent’s payment method. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage + */ + setup_future_usage?: 'off_session' | 'on_session' | null; + + /** + * Controls when the funds will be captured from the customer’s account. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method + */ + captureMethod?: 'manual' | 'automatic'; + + /** + * Controls when the funds will be captured from the customer’s account. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method + */ + capture_method?: 'manual' | 'automatic'; + + /** + * The Stripe account ID which is the business of record. + * + * @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-onBehalfOf + */ + onBehalfOf?: string; + + /** + * The Stripe account ID which is the business of record. + * + * @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-onBehalfOf + */ + on_behalf_of?: string; + + /** + * Instead of using automatic payment methods, declare specific payment methods to enable. + * + * @docs https://stripe.com/docs/payments/payment-methods/overview + */ + paymentMethodTypes?: string[]; + + /** + * Instead of using automatic payment methods, declare specific payment methods to enable. + * + * @docs https://stripe.com/docs/payments/payment-methods/overview + */ + payment_method_types?: string[]; + + /** + * When using automatic payment methods (omitting paymentMethodTypes), provide a + * payment method configuration ID for deriving payment methods. + * + * @docs https://stripe.com/docs/connect/payment-method-configurations + */ + paymentMethodConfiguration?: string; + + /** + * When using automatic payment methods (omitting payment_method_types), provide a + * payment method configuration ID for deriving payment methods. + * + * @docs https://stripe.com/docs/connect/payment-method-configurations + */ + payment_method_configuration?: string; + + /** + * Allows PaymentMethods to be created from the Elements instance. + */ + paymentMethodCreation?: 'manual'; + + /** + * Additional payment-method-specific options for configuring Payment Element behavior. + * + * @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-paymentMethodOptions + */ + paymentMethodOptions?: PaymentMethodOptions; + + /** + * Additional payment-method-specific options for configuring Payment Element behavior. + * + * @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-paymentMethodOptions + */ + payment_method_options?: PaymentMethodOptions; + + /** + * Either use mode or clientSecret when creating an Elements group + */ + clientSecret?: never; + + /** + * The external payment methods to be displayed in the Payment Element that you are already integrated with. + * + * @docs https://stripe.com/docs/js/elements_object/create#stripe_elements-options-externalPaymentMethodTypes + */ + externalPaymentMethodTypes?: string[]; +} + +export type StripeElementsOptions = + | StripeElementsOptionsClientSecret + | StripeElementsOptionsMode; + +/* + * Updatable options for an `Elements` instance + */ +export interface StripeElementsUpdateOptions { + /** + * The [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) of the locale to display placeholders and error strings in. + * Default is `auto` (Stripe detects the locale of the browser). + * Setting the locale does not affect the behavior of postal code validation—a valid postal code for the billing country of the card is still required. + */ + locale?: StripeElementLocale; + + /** + * Match the design of your site with the appearance option. + * The layout of each Element stays consistent, but you can modify colors, fonts, borders, padding, and more. + * + * @docs https://stripe.com/docs/stripe-js/appearance-api + */ + appearance?: Appearance; + + /** + * Whether the Payment Element will be used to create a PaymentIntent, SetupIntent, or Subscription. + */ + mode?: 'payment' | 'setup' | 'subscription'; + + /** + * Three character currency code (e.g., usd). + */ + currency?: string; + + /** + * The amount to be charged. Shown in Apple Pay, Google Pay, or Buy now pay later UIs, and influences available payment methods. + */ + amount?: number; + + /** + * Indicates that you intend to make future payments with this PaymentIntent’s payment method. + * + * @docs https://stripe.com/docs/api/payment_intents/update#update_payment_intent-setup_future_usage + */ + setupFutureUsage?: 'off_session' | 'on_session' | null; + + /** + * Indicates that you intend to make future payments with this PaymentIntent’s payment method. + * + * @docs https://stripe.com/docs/api/payment_intents/update#update_payment_intent-setup_future_usage + */ + setup_future_usage?: 'off_session' | 'on_session' | null; + + /** + * Controls when the funds will be captured from the customer’s account. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method + */ + captureMethod?: 'manual' | 'automatic'; + + /** + * Controls when the funds will be captured from the customer’s account. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-capture_method + */ + capture_method?: 'manual' | 'automatic'; + + /** + * Instead of using automatic payment methods, declare specific payment methods to enable. + * + * @docs https://stripe.com/docs/payments/payment-methods/overview + */ + payment_method_types?: string[]; + + /** + * Instead of using automatic payment methods, declare specific payment methods to enable. + * + * @docs https://stripe.com/docs/payments/payment-methods/overview + */ + paymentMethodTypes?: string[]; + + /** + * The Stripe account ID which is the business of record. + * + * @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-onBehalfOf + */ + onBehalfOf?: string; + + /** + * The Stripe account ID which is the business of record. + * + * @docs https://stripe.com/docs/js/elements_object/create_without_intent#stripe_elements_no_intent-options-onBehalfOf + */ + on_behalf_of?: string; +} + +/* + * Use a `CssFontSource` to pass custom fonts via a stylesheet URL when creating an `Elements` object. + */ +export interface CssFontSource { + /** + * A relative or absolute URL pointing to a CSS file with [@font-face](https://developer.mozilla.org/en/docs/Web/CSS/@font-face) definitions, for example: + * + * https://fonts.googleapis.com/css?family=Open+Sans + * + * Note that if you are using a [content security policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy) (CSP), [additional directives](https://stripe.com/docs/security#content-security-policy) may be necessary. + */ + cssSrc: string; +} + +/* + * Use a `CustomFontSource` to pass custom fonts when creating an `Elements` object. + */ +export interface CustomFontSource { + /** + * The name to give the font + */ + family: string; + + /** + * A valid [src](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src) value pointing to your custom font file. + * This is usually (though not always) a link to a file with a `.woff` , `.otf`, or `.svg` suffix. + */ + src: string; + + /** + * A valid [font-display](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display) value. + */ + display?: string; + + /** + * Defaults to `normal`. + */ + style?: 'normal' | 'italic' | 'oblique'; + + /** + * A valid [unicode-range](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range) value. + */ + unicodeRange?: string; + + /** + * A valid [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight), as a string. + */ + weight?: string; +} + +/* + * @docs https://stripe.com/docs/stripe-js/appearance-api + */ +export interface Appearance { + disableAnimations?: boolean; + + theme?: 'stripe' | 'night' | 'flat'; + + variables?: { + // General font styles + fontFamily?: string; + fontSmooth?: string; + fontVariantLigatures?: string; + fontVariationSettings?: string; + fontLineHeight?: string; + + // Font sizes + fontSizeBase?: string; + fontSizeSm?: string; + fontSizeXs?: string; + fontSize2Xs?: string; + fontSize3Xs?: string; + fontSizeLg?: string; + fontSizeXl?: string; + + // Font weights + fontWeightLight?: string; + fontWeightNormal?: string; + fontWeightMedium?: string; + fontWeightBold?: string; + + // Spacing + spacingUnit?: string; + gridRowSpacing?: string; + gridColumnSpacing?: string; + tabSpacing?: string; + accordionItemSpacing?: string; + /** @deprecated Use gridRowSpacing instead. */ + spacingGridRow?: string; + /** @deprecated Use gridColumnSpacing instead. */ + spacingGridColumn?: string; + /** @deprecated Use tabSpacing instead. */ + spacingTab?: string; + /** @deprecated Use accordionItemSpacing instead. */ + spacingAccordionItem?: string; + + // Colors + colorPrimary?: string; + colorBackground?: string; + colorText?: string; + colorSuccess?: string; + colorDanger?: string; + colorWarning?: string; + + // Text variations + colorTextSecondary?: string; + colorTextPlaceholder?: string; + + // Accessible text + accessibleColorOnColorPrimary?: string; + accessibleColorOnColorBackground?: string; + accessibleColorOnColorSuccess?: string; + accessibleColorOnColorDanger?: string; + accessibleColorOnColorWarning?: string; + /** @deprecated Use accessibleColorOnColorPrimary instead. */ + colorPrimaryText?: string; + /** @deprecated Use accessibleColorOnColorBackground instead. */ + colorBackgroundText?: string; + /** @deprecated Use accessibleColorOnColorSuccess instead. */ + colorSuccessText?: string; + /** @deprecated Use accessibleColorOnColorDanger instead. */ + colorDangerText?: string; + /** @deprecated Use accessibleColorOnColorWarning instead. */ + colorWarningText?: string; + + // Icons + iconColor?: string; + iconHoverColor?: string; + iconCardErrorColor?: string; + iconCardCvcColor?: string; + iconCardCvcErrorColor?: string; + iconCheckmarkColor?: string; + iconChevronDownColor?: string; + iconChevronDownHoverColor?: string; + iconCloseColor?: string; + iconCloseHoverColor?: string; + iconLoadingIndicatorColor?: string; + iconMenuColor?: string; + iconMenuHoverColor?: string; + iconPasscodeDeviceColor?: string; + iconPasscodeDeviceHoverColor?: string; + iconPasscodeDeviceNotificationColor?: string; + iconRedirectColor?: string; + /** @deprecated Use iconColor instead. */ + colorIcon?: string; + /** @deprecated Use iconHoverColor instead. */ + colorIconHover?: string; + /** @deprecated Use iconCardErrorColor instead. */ + colorIconCardError?: string; + /** @deprecated Use iconCardCvcColor instead. */ + colorIconCardCvc?: string; + /** @deprecated Use iconCardCvcErrorColor instead. */ + colorIconCardCvcError?: string; + /** @deprecated Use iconCheckmarkColor instead. */ + colorIconCheckmark?: string; + /** @deprecated Use iconChevronDownColor instead. */ + colorIconChevronDown?: string; + /** @deprecated Use iconChevronDownHoverColor instead. */ + colorIconChevronDownHover?: string; + /** @deprecated Use iconRedirectColor instead. */ + colorIconRedirect?: string; + + // TabIcons + tabIconColor?: string; + tabIconHoverColor?: string; + tabIconSelectedColor?: string; + tabIconMoreColor?: string; + tabIconMoreHoverColor?: string; + /** @deprecated Use tabIconColor instead. */ + colorIconTab?: string; + /** @deprecated Use tabIconHoverColor instead. */ + colorIconTabHover?: string; + /** @deprecated Use tabIconHoverColor instead. */ + colorIconTabSelected?: string; + /** @deprecated Use tabIconMoreColor instead. */ + colorIconTabMore?: string; + /** @deprecated Use tabIconMoreHoverColor instead. */ + colorIconTabMoreHover?: string; + + // Logos + logoColor?: string; + tabLogoColor?: string; + tabLogoSelectedColor?: string; + blockLogoColor?: string; + /** @deprecated Use logoColor instead. */ + colorLogo?: string; + /** @deprecated Use tabLogoColor instead. */ + colorLogoTab?: string; + /** @deprecated Use tabLogoSelectedColor instead. */ + colorLogoTabSelected?: string; + /** @deprecated Use blockLogoColor instead. */ + colorLogoBlock?: string; + + // Focus + focusBoxShadow?: string; + focusOutline?: string; + + // Radius + borderRadius?: string; + }; + + rules?: { + [selector: string]: { + [cssPropertyName: string]: string; + }; + }; + + labels?: 'above' | 'floating'; +} + +export interface CustomerOptions { + /** + * The Customer id. + */ + customer: string; + + /** + * The ephemeral key for a Customer that grants temporary access to Customer data. + */ + ephemeralKey: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/address.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/address.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..35ec366e93e6fc29bb98552515f049c7b8b13e67 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/address.d.mts @@ -0,0 +1,261 @@ +import {StripeElementBase} from './base'; +import {StripeError} from '../stripe'; + +export type StripeAddressElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeAddressElementChangeEvent) => any + ): StripeAddressElement; + once( + eventType: 'change', + handler: (event: StripeAddressElementChangeEvent) => any + ): StripeAddressElement; + off( + eventType: 'change', + handler?: (event: StripeAddressElementChangeEvent) => any + ): StripeAddressElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: {elementType: 'address'; error: StripeError}) => any + ): StripeAddressElement; + once( + eventType: 'loaderror', + handler: (event: {elementType: 'address'; error: StripeError}) => any + ): StripeAddressElement; + off( + eventType: 'loaderror', + handler?: (event: {elementType: 'address'; error: StripeError}) => any + ): StripeAddressElement; + + /** + * Triggered when the loader UI is mounted to the DOM and ready to be displayed. + */ + on( + eventType: 'loaderstart', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + once( + eventType: 'loaderstart', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + off( + eventType: 'loaderstart', + handler?: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + + /** + * Updates the options the `AddressElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update(options: Partial<StripeAddressElementOptions>): StripeAddressElement; + + /** + * Validates and retrieves form values from the `AddressElement`. + */ + getValue(): Promise< + Pick<StripeAddressElementChangeEvent, 'complete' | 'isNewAddress' | 'value'> + >; +}; + +export interface ContactOption { + name: string; + phone?: string; + address: { + line1: string; + line2?: string; + city: string; + state: string; + postal_code: string; + country: string; + }; +} + +export type AddressMode = 'shipping' | 'billing'; + +export interface StripeAddressElementOptions { + /** + * Control which mode the AddressElement will be used for. + */ + mode: AddressMode; + + /** + * An array of two-letter ISO country codes representing which countries + * are displayed in the AddressElement. + */ + allowedCountries?: string[] | null; + + /** + * Control autocomplete settings in the AddressElement. + */ + autocomplete?: + | {mode: 'automatic'} + | {mode: 'disabled'} + | {mode: 'google_maps_api'; apiKey: string}; + + /** + * Whether or not AddressElement accepts PO boxes + */ + blockPoBox?: boolean; + + /** + * An array of saved addresses. + */ + contacts?: ContactOption[]; + + /** + * Default value for AddressElement fields + */ + defaultValues?: { + name?: string | null; + firstName?: string | null; + lastName?: string | null; + address?: { + line1?: string | null; + line2?: string | null; + city?: string | null; + state?: string | null; + postal_code?: string | null; + country: string; + }; + phone?: string | null; + }; + + /** + * Control which additional fields to display in the AddressElement. + */ + fields?: { + phone?: 'always' | 'never' | 'auto'; + }; + + /** + * Specify validation rules for the above additional fields. + */ + validation?: { + phone?: { + required: 'always' | 'never' | 'auto'; + }; + }; + + /** + * Specify display options in the AddressElement + */ + display?: { + name?: 'full' | 'split' | 'organization'; + }; +} + +export interface StripeAddressElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'address'; + + /** + * The mode of the AddressElement that emitted this event. + */ + elementMode: AddressMode; + + /** + * Whether or not the AddressElement is currently empty. + */ + empty: boolean; + + /** + * Whether or not the AddressElement is complete. + */ + complete: boolean; + + /** + * Whether or not the address is new. + */ + isNewAddress: boolean; + + /** + * An object containing the current address. + */ + value: { + name: string; + firstName?: string; + lastName?: string; + address: { + line1: string; + line2: string | null; + city: string; + state: string; + postal_code: string; + country: string; + }; + phone?: string; + }; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/address.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/address.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..35ec366e93e6fc29bb98552515f049c7b8b13e67 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/address.d.ts @@ -0,0 +1,261 @@ +import {StripeElementBase} from './base'; +import {StripeError} from '../stripe'; + +export type StripeAddressElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeAddressElementChangeEvent) => any + ): StripeAddressElement; + once( + eventType: 'change', + handler: (event: StripeAddressElementChangeEvent) => any + ): StripeAddressElement; + off( + eventType: 'change', + handler?: (event: StripeAddressElementChangeEvent) => any + ): StripeAddressElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: {elementType: 'address'; error: StripeError}) => any + ): StripeAddressElement; + once( + eventType: 'loaderror', + handler: (event: {elementType: 'address'; error: StripeError}) => any + ): StripeAddressElement; + off( + eventType: 'loaderror', + handler?: (event: {elementType: 'address'; error: StripeError}) => any + ): StripeAddressElement; + + /** + * Triggered when the loader UI is mounted to the DOM and ready to be displayed. + */ + on( + eventType: 'loaderstart', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + once( + eventType: 'loaderstart', + handler: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + off( + eventType: 'loaderstart', + handler?: (event: {elementType: 'address'}) => any + ): StripeAddressElement; + + /** + * Updates the options the `AddressElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update(options: Partial<StripeAddressElementOptions>): StripeAddressElement; + + /** + * Validates and retrieves form values from the `AddressElement`. + */ + getValue(): Promise< + Pick<StripeAddressElementChangeEvent, 'complete' | 'isNewAddress' | 'value'> + >; +}; + +export interface ContactOption { + name: string; + phone?: string; + address: { + line1: string; + line2?: string; + city: string; + state: string; + postal_code: string; + country: string; + }; +} + +export type AddressMode = 'shipping' | 'billing'; + +export interface StripeAddressElementOptions { + /** + * Control which mode the AddressElement will be used for. + */ + mode: AddressMode; + + /** + * An array of two-letter ISO country codes representing which countries + * are displayed in the AddressElement. + */ + allowedCountries?: string[] | null; + + /** + * Control autocomplete settings in the AddressElement. + */ + autocomplete?: + | {mode: 'automatic'} + | {mode: 'disabled'} + | {mode: 'google_maps_api'; apiKey: string}; + + /** + * Whether or not AddressElement accepts PO boxes + */ + blockPoBox?: boolean; + + /** + * An array of saved addresses. + */ + contacts?: ContactOption[]; + + /** + * Default value for AddressElement fields + */ + defaultValues?: { + name?: string | null; + firstName?: string | null; + lastName?: string | null; + address?: { + line1?: string | null; + line2?: string | null; + city?: string | null; + state?: string | null; + postal_code?: string | null; + country: string; + }; + phone?: string | null; + }; + + /** + * Control which additional fields to display in the AddressElement. + */ + fields?: { + phone?: 'always' | 'never' | 'auto'; + }; + + /** + * Specify validation rules for the above additional fields. + */ + validation?: { + phone?: { + required: 'always' | 'never' | 'auto'; + }; + }; + + /** + * Specify display options in the AddressElement + */ + display?: { + name?: 'full' | 'split' | 'organization'; + }; +} + +export interface StripeAddressElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'address'; + + /** + * The mode of the AddressElement that emitted this event. + */ + elementMode: AddressMode; + + /** + * Whether or not the AddressElement is currently empty. + */ + empty: boolean; + + /** + * Whether or not the AddressElement is complete. + */ + complete: boolean; + + /** + * Whether or not the address is new. + */ + isNewAddress: boolean; + + /** + * An object containing the current address. + */ + value: { + name: string; + firstName?: string; + lastName?: string; + address: { + line1: string; + line2: string | null; + city: string; + state: string; + postal_code: string; + country: string; + }; + phone?: string; + }; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/affirm-message.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/affirm-message.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e7a61e934eaad341503368456e4816d2977bc518 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/affirm-message.d.mts @@ -0,0 +1,65 @@ +export type StripeAffirmMessageElement = { + /** + * The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM. + * `element.mount` accepts either a CSS Selector (e.g., `'#affirm-message'`) or a DOM element. + */ + mount(domElement: string | HTMLElement): void; + + /** + * Removes the element from the DOM and destroys it. + * A destroyed element can not be re-activated or re-mounted to the DOM. + */ + destroy(): void; + + /** + * Unmounts the element from the DOM. + * Call `element.mount` to re-attach it to the DOM. + */ + unmount(): void; + + /** + * Updates the options the `AffirmMessageElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update(options: Partial<StripeAffirmMessageElementOptions>): void; + + /** + * Triggered when the element is fully loaded and ready to perform method calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'affirmMessage'}) => any + ): StripeAffirmMessageElement; +}; + +export interface StripeAffirmMessageElementOptions { + /** + * The total amount in the smallest currency unit. + */ + amount: number; + + /** + * The currency to display. + */ + currency: 'USD'; + + /** + * The affirm logo color. + */ + logoColor?: 'primary' | 'black' | 'white'; + + /** + * The font color of the promotional message. + */ + fontColor?: string; + + /** + * The font size of the promotional message. + */ + fontSize?: string; + + /** + * The text alignment of the promotional message. + */ + textAlign?: 'start' | 'end' | 'left' | 'right' | 'center' | 'justify'; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/affirm-message.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/affirm-message.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e7a61e934eaad341503368456e4816d2977bc518 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/affirm-message.d.ts @@ -0,0 +1,65 @@ +export type StripeAffirmMessageElement = { + /** + * The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM. + * `element.mount` accepts either a CSS Selector (e.g., `'#affirm-message'`) or a DOM element. + */ + mount(domElement: string | HTMLElement): void; + + /** + * Removes the element from the DOM and destroys it. + * A destroyed element can not be re-activated or re-mounted to the DOM. + */ + destroy(): void; + + /** + * Unmounts the element from the DOM. + * Call `element.mount` to re-attach it to the DOM. + */ + unmount(): void; + + /** + * Updates the options the `AffirmMessageElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update(options: Partial<StripeAffirmMessageElementOptions>): void; + + /** + * Triggered when the element is fully loaded and ready to perform method calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'affirmMessage'}) => any + ): StripeAffirmMessageElement; +}; + +export interface StripeAffirmMessageElementOptions { + /** + * The total amount in the smallest currency unit. + */ + amount: number; + + /** + * The currency to display. + */ + currency: 'USD'; + + /** + * The affirm logo color. + */ + logoColor?: 'primary' | 'black' | 'white'; + + /** + * The font color of the promotional message. + */ + fontColor?: string; + + /** + * The font size of the promotional message. + */ + fontSize?: string; + + /** + * The text alignment of the promotional message. + */ + textAlign?: 'start' | 'end' | 'left' | 'right' | 'center' | 'justify'; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/afterpay-clearpay-message.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/afterpay-clearpay-message.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..10329ba2d2de04ab9d847527a97f5d27afde246c --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/afterpay-clearpay-message.d.mts @@ -0,0 +1,119 @@ +export type StripeAfterpayClearpayMessageElement = { + /** + * The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM. + * `element.mount` accepts either a CSS Selector (e.g., `'#afterpay-clearpay-message'`) or a DOM element. + */ + mount(domElement: string | HTMLElement): void; + + /** + * Removes the element from the DOM and destroys it. + * A destroyed element can not be re-activated or re-mounted to the DOM. + */ + destroy(): void; + + /** + * Unmounts the element from the DOM. + * Call `element.mount` to re-attach it to the DOM. + */ + unmount(): void; + + /** + * Updates the options the `AfterpayClearpayMessageElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update(options: Partial<StripeAfterpayClearpayMessageElementOptions>): void; + + /** + * Triggered when the element is fully loaded and ready to perform method calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'afterpayClearpayMessage'}) => any + ): StripeAfterpayClearpayMessageElement; +}; + +export interface StripeAfterpayClearpayMessageElementOptions { + /** + * The total amount, divided into 4 installments, in the smallest currency unit. + */ + amount: number; + + /** + * The currency to display. + */ + currency: 'USD' | 'AUD' | 'CAD' | 'GBP' | 'NZD' | 'EUR'; + + /** + * The badge color theme, applied when `logoType` is set to badge. + */ + badgeTheme?: + | 'black-on-mint' + | 'black-on-white' + | 'mint-on-black' + | 'white-on-black'; + + /** + * The leading text for the mesage. + */ + introText?: 'In' | 'in' | 'Or' | 'or' | 'Pay' | 'pay' | 'Pay in' | 'pay in'; + + /** + * Indicates whether an item is eligible for purchase with Afterpay Clearpay. + */ + isEligible?: boolean; + + /** + * Indicates whether an entire cart is eligible for purchase with Afterpay Clearpay. + */ + isCartEligible?: boolean; + + /** + * The lockup color theme, applied when `logoType` is set to lockup. + */ + lockupTheme?: 'black' | 'white' | 'mint'; + + /** + * The logo style to display. + */ + logoType?: 'badge' | 'lockup'; + + /** + * The maximum `amount` allowed for a purchase. This should match the limit defined in your Stripe dashboard. + */ + max?: number; + + /** + * The minimum `amount` allowed for a purchase. This should match the limit defined in your Stripe dashboard. + */ + min?: number; + + /** + * The style of modal link to display. + */ + modalLinkStyle?: 'circled-info-icon' | 'learn-more-text' | 'more-info-text'; + + /** + * The background color for the info modal. + */ + modalTheme?: 'mint' | 'white'; + + /** + * Determines whether 'interest-free' is displayed in the message. + */ + showInterestFree?: boolean; + + /** + * Determines whether 'with' is displayed before the logo. + */ + showLowerLimit?: boolean; + + /** + * Determines whether the lower limit is displayed when `amount` exceeds price limits. + */ + showUpperLimit?: boolean; + + /** + * Determines whether the upper limit is displayed when `amount` exceeds price limits. + */ + showWith?: boolean; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/afterpay-clearpay-message.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/afterpay-clearpay-message.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..10329ba2d2de04ab9d847527a97f5d27afde246c --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/afterpay-clearpay-message.d.ts @@ -0,0 +1,119 @@ +export type StripeAfterpayClearpayMessageElement = { + /** + * The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM. + * `element.mount` accepts either a CSS Selector (e.g., `'#afterpay-clearpay-message'`) or a DOM element. + */ + mount(domElement: string | HTMLElement): void; + + /** + * Removes the element from the DOM and destroys it. + * A destroyed element can not be re-activated or re-mounted to the DOM. + */ + destroy(): void; + + /** + * Unmounts the element from the DOM. + * Call `element.mount` to re-attach it to the DOM. + */ + unmount(): void; + + /** + * Updates the options the `AfterpayClearpayMessageElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update(options: Partial<StripeAfterpayClearpayMessageElementOptions>): void; + + /** + * Triggered when the element is fully loaded and ready to perform method calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'afterpayClearpayMessage'}) => any + ): StripeAfterpayClearpayMessageElement; +}; + +export interface StripeAfterpayClearpayMessageElementOptions { + /** + * The total amount, divided into 4 installments, in the smallest currency unit. + */ + amount: number; + + /** + * The currency to display. + */ + currency: 'USD' | 'AUD' | 'CAD' | 'GBP' | 'NZD' | 'EUR'; + + /** + * The badge color theme, applied when `logoType` is set to badge. + */ + badgeTheme?: + | 'black-on-mint' + | 'black-on-white' + | 'mint-on-black' + | 'white-on-black'; + + /** + * The leading text for the mesage. + */ + introText?: 'In' | 'in' | 'Or' | 'or' | 'Pay' | 'pay' | 'Pay in' | 'pay in'; + + /** + * Indicates whether an item is eligible for purchase with Afterpay Clearpay. + */ + isEligible?: boolean; + + /** + * Indicates whether an entire cart is eligible for purchase with Afterpay Clearpay. + */ + isCartEligible?: boolean; + + /** + * The lockup color theme, applied when `logoType` is set to lockup. + */ + lockupTheme?: 'black' | 'white' | 'mint'; + + /** + * The logo style to display. + */ + logoType?: 'badge' | 'lockup'; + + /** + * The maximum `amount` allowed for a purchase. This should match the limit defined in your Stripe dashboard. + */ + max?: number; + + /** + * The minimum `amount` allowed for a purchase. This should match the limit defined in your Stripe dashboard. + */ + min?: number; + + /** + * The style of modal link to display. + */ + modalLinkStyle?: 'circled-info-icon' | 'learn-more-text' | 'more-info-text'; + + /** + * The background color for the info modal. + */ + modalTheme?: 'mint' | 'white'; + + /** + * Determines whether 'interest-free' is displayed in the message. + */ + showInterestFree?: boolean; + + /** + * Determines whether 'with' is displayed before the logo. + */ + showLowerLimit?: boolean; + + /** + * Determines whether the lower limit is displayed when `amount` exceeds price limits. + */ + showUpperLimit?: boolean; + + /** + * Determines whether the upper limit is displayed when `amount` exceeds price limits. + */ + showWith?: boolean; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/apple-pay.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/apple-pay.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..f99454714460ca576b6b5f64be0c97330f9a875c --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/apple-pay.d.mts @@ -0,0 +1,157 @@ +export type ApplePayRecurringPaymentRequestIntervalUnit = + | 'year' + | 'month' + | 'day' + | 'hour' + | 'minute'; + +export interface ApplePayLineItem { + /** + * A short, localized description of the line item. + */ + label: string; + + /** + * The amount in the currency's subunit (e.g. cents, yen, etc.) + */ + amount: number; +} + +export type ApplePayRegularBilling = ApplePayLineItem & { + /** + * The date of the first payment. + */ + recurringPaymentStartDate?: Date; + + /** + * The date of the final payment. + */ + recurringPaymentEndDate?: Date; + + /** + * The amount of time — in calendar units, such as day, month, or year — that represents a fraction of the total payment interval. + */ + recurringPaymentIntervalUnit?: ApplePayRecurringPaymentRequestIntervalUnit; + + /** + * The number of interval units that make up the total payment interval. + */ + recurringPaymentIntervalCount?: number; +}; + +export interface ApplePayRecurringPaymentRequest { + /** + * The description of the payment that the customer will see in their Apple Pay wallet. + */ + paymentDescription: string; + + /** + * The URL to manage items related to the recurring payment on your website. + */ + managementURL: string; + regularBilling: ApplePayRegularBilling; + trialBilling?: ApplePayRegularBilling; + + /** + * The billing agreement label that is displayed to the customer in the Apple Pay payment interface. + */ + billingAgreement?: string; +} + +export type ApplePayAutomaticReloadBilling = ApplePayLineItem & { + /** + * The balance an account reaches before the merchant applies the automatic reload amount. + */ + automaticReloadPaymentThresholdAmount: number; +}; + +export interface ApplePayAutomaticReloadPaymentRequest { + /** + * The description of the payment that the customer will see in their Apple Pay wallet. + */ + paymentDescription: string; + + /** + * The URL to manage items related to the automatic reload payment on your website. + */ + managementURL: string; + automaticReloadBilling: ApplePayAutomaticReloadBilling; + + /** + * The billing agreement label that is displayed to the customer in the Apple Pay payment interface. + */ + billingAgreement?: string; +} + +export type ApplePayDeferredBilling = ApplePayLineItem & { + /** + * The date, in the future, of the payment. + */ + deferredPaymentDate: Date; +}; + +export interface ApplePayDeferredPaymentRequest { + /** + * The description of the payment that the customer will see in their Apple Pay wallet. + */ + paymentDescription: string; + + /** + * The URL to manage items related to the deferred payment on your website. + */ + managementURL: string; + deferredBilling: ApplePayDeferredBilling; + + /** + * The billing agreement label that is displayed to the customer in the Apple Pay payment interface. + */ + billingAgreement?: string; + + /** + * The future date before which the customer can cancel the deferred payment for free. + */ + freeCancellationDate?: Date; + + /** + * The time zone of the free cancellation date. + * + * These are [tz](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) timezones such as `America/Los_Angeles`, `Europe/Dublin`, and `Asia/Singapore`. + */ + freeCancellationDateTimeZone?: string; +} + +export type ApplePayOption = + | { + recurringPaymentRequest: ApplePayRecurringPaymentRequest; + deferredPaymentRequest?: null; + automaticReloadPaymentRequest?: null; + } + | { + recurringPaymentRequest?: null; + deferredPaymentRequest: ApplePayDeferredPaymentRequest; + automaticReloadPaymentRequest?: null; + } + | { + recurringPaymentRequest?: null; + deferredPaymentRequest?: null; + automaticReloadPaymentRequest: ApplePayAutomaticReloadPaymentRequest; + } + | { + recurringPaymentRequest?: null; + deferredPaymentRequest?: null; + automaticReloadPaymentRequest?: null; + }; + +export type ApplePayUpdateOption = + | { + recurringPaymentRequest: ApplePayRecurringPaymentRequest; + automaticReloadPaymentRequest?: null; + } + | { + recurringPaymentRequest?: null; + automaticReloadPaymentRequest: ApplePayAutomaticReloadPaymentRequest; + } + | { + recurringPaymentRequest?: null; + automaticReloadPaymentRequest?: null; + }; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/apple-pay.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/apple-pay.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f99454714460ca576b6b5f64be0c97330f9a875c --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/apple-pay.d.ts @@ -0,0 +1,157 @@ +export type ApplePayRecurringPaymentRequestIntervalUnit = + | 'year' + | 'month' + | 'day' + | 'hour' + | 'minute'; + +export interface ApplePayLineItem { + /** + * A short, localized description of the line item. + */ + label: string; + + /** + * The amount in the currency's subunit (e.g. cents, yen, etc.) + */ + amount: number; +} + +export type ApplePayRegularBilling = ApplePayLineItem & { + /** + * The date of the first payment. + */ + recurringPaymentStartDate?: Date; + + /** + * The date of the final payment. + */ + recurringPaymentEndDate?: Date; + + /** + * The amount of time — in calendar units, such as day, month, or year — that represents a fraction of the total payment interval. + */ + recurringPaymentIntervalUnit?: ApplePayRecurringPaymentRequestIntervalUnit; + + /** + * The number of interval units that make up the total payment interval. + */ + recurringPaymentIntervalCount?: number; +}; + +export interface ApplePayRecurringPaymentRequest { + /** + * The description of the payment that the customer will see in their Apple Pay wallet. + */ + paymentDescription: string; + + /** + * The URL to manage items related to the recurring payment on your website. + */ + managementURL: string; + regularBilling: ApplePayRegularBilling; + trialBilling?: ApplePayRegularBilling; + + /** + * The billing agreement label that is displayed to the customer in the Apple Pay payment interface. + */ + billingAgreement?: string; +} + +export type ApplePayAutomaticReloadBilling = ApplePayLineItem & { + /** + * The balance an account reaches before the merchant applies the automatic reload amount. + */ + automaticReloadPaymentThresholdAmount: number; +}; + +export interface ApplePayAutomaticReloadPaymentRequest { + /** + * The description of the payment that the customer will see in their Apple Pay wallet. + */ + paymentDescription: string; + + /** + * The URL to manage items related to the automatic reload payment on your website. + */ + managementURL: string; + automaticReloadBilling: ApplePayAutomaticReloadBilling; + + /** + * The billing agreement label that is displayed to the customer in the Apple Pay payment interface. + */ + billingAgreement?: string; +} + +export type ApplePayDeferredBilling = ApplePayLineItem & { + /** + * The date, in the future, of the payment. + */ + deferredPaymentDate: Date; +}; + +export interface ApplePayDeferredPaymentRequest { + /** + * The description of the payment that the customer will see in their Apple Pay wallet. + */ + paymentDescription: string; + + /** + * The URL to manage items related to the deferred payment on your website. + */ + managementURL: string; + deferredBilling: ApplePayDeferredBilling; + + /** + * The billing agreement label that is displayed to the customer in the Apple Pay payment interface. + */ + billingAgreement?: string; + + /** + * The future date before which the customer can cancel the deferred payment for free. + */ + freeCancellationDate?: Date; + + /** + * The time zone of the free cancellation date. + * + * These are [tz](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) timezones such as `America/Los_Angeles`, `Europe/Dublin`, and `Asia/Singapore`. + */ + freeCancellationDateTimeZone?: string; +} + +export type ApplePayOption = + | { + recurringPaymentRequest: ApplePayRecurringPaymentRequest; + deferredPaymentRequest?: null; + automaticReloadPaymentRequest?: null; + } + | { + recurringPaymentRequest?: null; + deferredPaymentRequest: ApplePayDeferredPaymentRequest; + automaticReloadPaymentRequest?: null; + } + | { + recurringPaymentRequest?: null; + deferredPaymentRequest?: null; + automaticReloadPaymentRequest: ApplePayAutomaticReloadPaymentRequest; + } + | { + recurringPaymentRequest?: null; + deferredPaymentRequest?: null; + automaticReloadPaymentRequest?: null; + }; + +export type ApplePayUpdateOption = + | { + recurringPaymentRequest: ApplePayRecurringPaymentRequest; + automaticReloadPaymentRequest?: null; + } + | { + recurringPaymentRequest?: null; + automaticReloadPaymentRequest: ApplePayAutomaticReloadPaymentRequest; + } + | { + recurringPaymentRequest?: null; + automaticReloadPaymentRequest?: null; + }; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/au-bank-account.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/au-bank-account.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..2b68bde026902f0bdced365408e0ef202044c4f7 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/au-bank-account.d.mts @@ -0,0 +1,138 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeAuBankAccountElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeAuBankAccountElementChangeEvent) => any + ): StripeAuBankAccountElement; + once( + eventType: 'change', + handler: (event: StripeAuBankAccountElementChangeEvent) => any + ): StripeAuBankAccountElement; + off( + eventType: 'change', + handler?: (event: StripeAuBankAccountElementChangeEvent) => any + ): StripeAuBankAccountElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + + /** + * Updates the options the `AuBankAccountElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `AuBankAccountElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeAuBankAccountElementOptions>): void; +}; + +export interface StripeAuBankAccountElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeAuBankAccountElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'auBankAccount'; + + /** + * The bank name corresponding to the entered BSB. + */ + bankName?: string; + + /** + * The branch name corresponding to the entered BSB. + */ + branchName?: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/au-bank-account.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/au-bank-account.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2b68bde026902f0bdced365408e0ef202044c4f7 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/au-bank-account.d.ts @@ -0,0 +1,138 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeAuBankAccountElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeAuBankAccountElementChangeEvent) => any + ): StripeAuBankAccountElement; + once( + eventType: 'change', + handler: (event: StripeAuBankAccountElementChangeEvent) => any + ): StripeAuBankAccountElement; + off( + eventType: 'change', + handler?: (event: StripeAuBankAccountElementChangeEvent) => any + ): StripeAuBankAccountElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'auBankAccount'}) => any + ): StripeAuBankAccountElement; + + /** + * Updates the options the `AuBankAccountElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `AuBankAccountElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeAuBankAccountElementOptions>): void; +}; + +export interface StripeAuBankAccountElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeAuBankAccountElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'auBankAccount'; + + /** + * The bank name corresponding to the entered BSB. + */ + bankName?: string; + + /** + * The branch name corresponding to the entered BSB. + */ + branchName?: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/base.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/base.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c21a03a0475ca14379ac5ad1aa21245489d2b4b6 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/base.d.mts @@ -0,0 +1,264 @@ +import {StripeElementType} from '../elements-group'; + +export type StripeElementBase = { + /** + * The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM. + * `element.mount` accepts either a CSS Selector (e.g., `'#card-element'`) or a DOM element. + * + * You need to create a container DOM element to mount an `Element`. + * If the container DOM element has a label, the `Element` is automatically focused when its label is clicked. + * There are two ways to do this: + * + * 1. Mount the instance within a `<label>`. + * 2. Create a `<label>` with a `for` attribute, referencing the ID of your container. + */ + mount(domElement: string | HTMLElement): void; + + /** + * Blurs the element. + */ + blur(): void; + + /** + * Clears the value(s) of the element. + */ + clear(): void; + + /** + * Removes the element from the DOM and destroys it. + * A destroyed element can not be re-activated or re-mounted to the DOM. + */ + destroy(): void; + + /** + * Focuses the element. + */ + focus(): void; + + /** + * Unmounts the element from the DOM. + * Call `element.mount` to re-attach it to the DOM. + */ + unmount(): void; +}; + +/** + * Customize the appearance of an element using CSS properties passed in a `Style` object, which consists of CSS properties nested under objects for each variant. + */ +export interface StripeElementStyle { + /** + * Base variant—all other variants inherit from these styles. + */ + base?: StripeElementStyleVariant; + + /** + * Applied when the element has valid input. + */ + complete?: StripeElementStyleVariant; + + /** + * Applied when the element has no customer input. + */ + empty?: StripeElementStyleVariant; + + /** + * Applied when the element has invalid input. + */ + invalid?: StripeElementStyleVariant; +} + +/** + * An object with `CSSProperties` supported by Stripe.js. + * Pseudo-classes and pseudo-elements can also be styled using a nested object inside of a variant. + */ +export interface StripeElementStyleVariant extends StripeElementCSSProperties { + ':hover'?: StripeElementCSSProperties; + + ':focus'?: StripeElementCSSProperties; + + '::placeholder'?: StripeElementCSSProperties; + + '::selection'?: StripeElementCSSProperties; + + ':-webkit-autofill'?: StripeElementCSSProperties; + + /** + * Available for all elements except the `paymentRequestButton` element + */ + ':disabled'?: StripeElementCSSProperties; + + /** + * Available for the `cardNumber`, `cardExpiry`, and `cardCvc` elements. + */ + '::-ms-clear'?: StripeElementCSSProperties & {display: string}; +} + +/** + * CSS properties supported by Stripe.js. + */ +export interface StripeElementCSSProperties { + /** + * The [background-color](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color) CSS property. + * + * This property works best with the `::selection` pseudo-class. + * In other cases, consider setting the background color on the element's container instaed. + */ + backgroundColor?: string; + + /** + * The [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS property. + */ + color?: string; + + /** + * The [font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) CSS property. + */ + fontFamily?: string; + + /** + * The [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size) CSS property. + */ + fontSize?: string; + + /** + * The [font-smoothing](https://developer.mozilla.org/en-US/docs/Web/CSS/font-smoothing) CSS property. + */ + fontSmoothing?: string; + + /** + * The [font-style](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style) CSS property. + */ + fontStyle?: string; + + /** + * The [font-variant](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant) CSS property. + */ + fontVariant?: string; + + /** + * The [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight) CSS property. + */ + fontWeight?: string | number; + + /** + * A custom property, used to set the color of the icons that are rendered in an element. + */ + iconColor?: string; + + /** + * The [line-height](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height) CSS property. + * + * To avoid cursors being rendered inconsistently across browsers, consider using a padding on the element's container instead. + */ + lineHeight?: string; + + /** + * The [letter-spacing](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) CSS property. + */ + letterSpacing?: string; + + /** + * The [text-align](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) CSS property. + * + * Available for the `cardNumber`, `cardExpiry`, and `cardCvc` elements. + */ + textAlign?: string; + + /** + * The [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding) CSS property. + * + * Available for the `idealBank` element. + * Accepts integer length with `px` unit as values. + */ + padding?: string; + + /** + * The [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration) CSS property. + */ + textDecoration?: string; + + /** + * The [text-shadow](https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow) CSS property. + */ + textShadow?: string; + + /** + * The [text-transform](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform) CSS property. + */ + textTransform?: string; +} + +/** + * Use `Classes` to set custom class names on the container DOM element when the Stripe element is in a particular state. + */ +export interface StripeElementClasses { + /** + * The base class applied to the container. + * Defaults to `StripeElement`. + */ + base?: string; + + /** + * The class name to apply when the `Element` is complete. + * Defaults to `StripeElement--complete`. + */ + complete?: string; + + /** + * The class name to apply when the `Element` is empty. + * Defaults to `StripeElement--empty`. + */ + empty?: string; + + /** + * The class name to apply when the `Element` is focused. + * Defaults to `StripeElement--focus`. + */ + focus?: string; + + /** + * The class name to apply when the `Element` is invalid. + * Defaults to `StripeElement--invalid`. + */ + invalid?: string; + + /** + * The class name to apply when the `Element` has its value autofilled by the browser (only on Chrome and Safari). + * Defaults to `StripeElement--webkit-autofill`. + */ + webkitAutofill?: string; +} + +export interface StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: StripeElementType; + + /** + * `true` if the value is empty. + */ + empty: boolean; + + /** + * `true` if the value is well-formed and potentially complete. + * The `complete` value can be used to progressively disclose the next parts of your form or to enable form submission. + * + * It is not an indicator of whether a customer is done with their input—it only indicates that the Element contains a potentially complete, well-formed value. + * In many cases the customer could still add further input. + * + * The `complete` value should not be used to perform an action such as advancing the cursor to a subsequent field or performing a tokenization request. + */ + complete: boolean; + + /** + * The current validation error, if any. + */ + error: + | undefined + | { + type: 'validation_error'; + code: string; + message: string; + }; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/base.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/base.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c21a03a0475ca14379ac5ad1aa21245489d2b4b6 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/base.d.ts @@ -0,0 +1,264 @@ +import {StripeElementType} from '../elements-group'; + +export type StripeElementBase = { + /** + * The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM. + * `element.mount` accepts either a CSS Selector (e.g., `'#card-element'`) or a DOM element. + * + * You need to create a container DOM element to mount an `Element`. + * If the container DOM element has a label, the `Element` is automatically focused when its label is clicked. + * There are two ways to do this: + * + * 1. Mount the instance within a `<label>`. + * 2. Create a `<label>` with a `for` attribute, referencing the ID of your container. + */ + mount(domElement: string | HTMLElement): void; + + /** + * Blurs the element. + */ + blur(): void; + + /** + * Clears the value(s) of the element. + */ + clear(): void; + + /** + * Removes the element from the DOM and destroys it. + * A destroyed element can not be re-activated or re-mounted to the DOM. + */ + destroy(): void; + + /** + * Focuses the element. + */ + focus(): void; + + /** + * Unmounts the element from the DOM. + * Call `element.mount` to re-attach it to the DOM. + */ + unmount(): void; +}; + +/** + * Customize the appearance of an element using CSS properties passed in a `Style` object, which consists of CSS properties nested under objects for each variant. + */ +export interface StripeElementStyle { + /** + * Base variant—all other variants inherit from these styles. + */ + base?: StripeElementStyleVariant; + + /** + * Applied when the element has valid input. + */ + complete?: StripeElementStyleVariant; + + /** + * Applied when the element has no customer input. + */ + empty?: StripeElementStyleVariant; + + /** + * Applied when the element has invalid input. + */ + invalid?: StripeElementStyleVariant; +} + +/** + * An object with `CSSProperties` supported by Stripe.js. + * Pseudo-classes and pseudo-elements can also be styled using a nested object inside of a variant. + */ +export interface StripeElementStyleVariant extends StripeElementCSSProperties { + ':hover'?: StripeElementCSSProperties; + + ':focus'?: StripeElementCSSProperties; + + '::placeholder'?: StripeElementCSSProperties; + + '::selection'?: StripeElementCSSProperties; + + ':-webkit-autofill'?: StripeElementCSSProperties; + + /** + * Available for all elements except the `paymentRequestButton` element + */ + ':disabled'?: StripeElementCSSProperties; + + /** + * Available for the `cardNumber`, `cardExpiry`, and `cardCvc` elements. + */ + '::-ms-clear'?: StripeElementCSSProperties & {display: string}; +} + +/** + * CSS properties supported by Stripe.js. + */ +export interface StripeElementCSSProperties { + /** + * The [background-color](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color) CSS property. + * + * This property works best with the `::selection` pseudo-class. + * In other cases, consider setting the background color on the element's container instaed. + */ + backgroundColor?: string; + + /** + * The [color](https://developer.mozilla.org/en-US/docs/Web/CSS/color) CSS property. + */ + color?: string; + + /** + * The [font-family](https://developer.mozilla.org/en-US/docs/Web/CSS/font-family) CSS property. + */ + fontFamily?: string; + + /** + * The [font-size](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size) CSS property. + */ + fontSize?: string; + + /** + * The [font-smoothing](https://developer.mozilla.org/en-US/docs/Web/CSS/font-smoothing) CSS property. + */ + fontSmoothing?: string; + + /** + * The [font-style](https://developer.mozilla.org/en-US/docs/Web/CSS/font-style) CSS property. + */ + fontStyle?: string; + + /** + * The [font-variant](https://developer.mozilla.org/en-US/docs/Web/CSS/font-variant) CSS property. + */ + fontVariant?: string; + + /** + * The [font-weight](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight) CSS property. + */ + fontWeight?: string | number; + + /** + * A custom property, used to set the color of the icons that are rendered in an element. + */ + iconColor?: string; + + /** + * The [line-height](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height) CSS property. + * + * To avoid cursors being rendered inconsistently across browsers, consider using a padding on the element's container instead. + */ + lineHeight?: string; + + /** + * The [letter-spacing](https://developer.mozilla.org/en-US/docs/Web/CSS/letter-spacing) CSS property. + */ + letterSpacing?: string; + + /** + * The [text-align](https://developer.mozilla.org/en-US/docs/Web/CSS/text-align) CSS property. + * + * Available for the `cardNumber`, `cardExpiry`, and `cardCvc` elements. + */ + textAlign?: string; + + /** + * The [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding) CSS property. + * + * Available for the `idealBank` element. + * Accepts integer length with `px` unit as values. + */ + padding?: string; + + /** + * The [text-decoration](https://developer.mozilla.org/en-US/docs/Web/CSS/text-decoration) CSS property. + */ + textDecoration?: string; + + /** + * The [text-shadow](https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow) CSS property. + */ + textShadow?: string; + + /** + * The [text-transform](https://developer.mozilla.org/en-US/docs/Web/CSS/text-transform) CSS property. + */ + textTransform?: string; +} + +/** + * Use `Classes` to set custom class names on the container DOM element when the Stripe element is in a particular state. + */ +export interface StripeElementClasses { + /** + * The base class applied to the container. + * Defaults to `StripeElement`. + */ + base?: string; + + /** + * The class name to apply when the `Element` is complete. + * Defaults to `StripeElement--complete`. + */ + complete?: string; + + /** + * The class name to apply when the `Element` is empty. + * Defaults to `StripeElement--empty`. + */ + empty?: string; + + /** + * The class name to apply when the `Element` is focused. + * Defaults to `StripeElement--focus`. + */ + focus?: string; + + /** + * The class name to apply when the `Element` is invalid. + * Defaults to `StripeElement--invalid`. + */ + invalid?: string; + + /** + * The class name to apply when the `Element` has its value autofilled by the browser (only on Chrome and Safari). + * Defaults to `StripeElement--webkit-autofill`. + */ + webkitAutofill?: string; +} + +export interface StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: StripeElementType; + + /** + * `true` if the value is empty. + */ + empty: boolean; + + /** + * `true` if the value is well-formed and potentially complete. + * The `complete` value can be used to progressively disclose the next parts of your form or to enable form submission. + * + * It is not an indicator of whether a customer is done with their input—it only indicates that the Element contains a potentially complete, well-formed value. + * In many cases the customer could still add further input. + * + * The `complete` value should not be used to perform an action such as advancing the cursor to a subsequent field or performing a tokenization request. + */ + complete: boolean; + + /** + * The current validation error, if any. + */ + error: + | undefined + | { + type: 'validation_error'; + code: string; + message: string; + }; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-cvc.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-cvc.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c2f22dfd970857d0b754983c64aa6e55d005455e --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-cvc.d.mts @@ -0,0 +1,119 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeCardCvcElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeCardCvcElementChangeEvent) => any + ): StripeCardCvcElement; + once( + eventType: 'change', + handler: (event: StripeCardCvcElementChangeEvent) => any + ): StripeCardCvcElement; + off( + eventType: 'change', + handler?: (event: StripeCardCvcElementChangeEvent) => any + ): StripeCardCvcElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + + /** + * Updates the options the `CardCvcElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `CardCvcElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeCardCvcElementOptions>): void; +}; + +export interface StripeCardCvcElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + placeholder?: string; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeCardCvcElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'cardCvc'; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-cvc.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-cvc.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2f22dfd970857d0b754983c64aa6e55d005455e --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-cvc.d.ts @@ -0,0 +1,119 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeCardCvcElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeCardCvcElementChangeEvent) => any + ): StripeCardCvcElement; + once( + eventType: 'change', + handler: (event: StripeCardCvcElementChangeEvent) => any + ): StripeCardCvcElement; + off( + eventType: 'change', + handler?: (event: StripeCardCvcElementChangeEvent) => any + ): StripeCardCvcElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'cardCvc'}) => any + ): StripeCardCvcElement; + + /** + * Updates the options the `CardCvcElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `CardCvcElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeCardCvcElementOptions>): void; +}; + +export interface StripeCardCvcElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + placeholder?: string; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeCardCvcElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'cardCvc'; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-expiry.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-expiry.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..5d854e23351e35bde171607b6fc958c08cd4fb3a --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-expiry.d.mts @@ -0,0 +1,119 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeCardExpiryElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeCardExpiryElementChangeEvent) => any + ): StripeCardExpiryElement; + once( + eventType: 'change', + handler: (event: StripeCardExpiryElementChangeEvent) => any + ): StripeCardExpiryElement; + off( + eventType: 'change', + handler?: (event: StripeCardExpiryElementChangeEvent) => any + ): StripeCardExpiryElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + + /** + * Updates the options the `CardExpiryElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `CardExpiryElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeCardExpiryElementOptions>): void; +}; + +export interface StripeCardExpiryElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + placeholder?: string; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeCardExpiryElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'cardExpiry'; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-expiry.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-expiry.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d854e23351e35bde171607b6fc958c08cd4fb3a --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-expiry.d.ts @@ -0,0 +1,119 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeCardExpiryElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeCardExpiryElementChangeEvent) => any + ): StripeCardExpiryElement; + once( + eventType: 'change', + handler: (event: StripeCardExpiryElementChangeEvent) => any + ): StripeCardExpiryElement; + off( + eventType: 'change', + handler?: (event: StripeCardExpiryElementChangeEvent) => any + ): StripeCardExpiryElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'cardExpiry'}) => any + ): StripeCardExpiryElement; + + /** + * Updates the options the `CardExpiryElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `CardExpiryElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeCardExpiryElementOptions>): void; +}; + +export interface StripeCardExpiryElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + placeholder?: string; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeCardExpiryElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'cardExpiry'; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-number.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-number.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e5a8daa5030d7af5d0798c3aa65e8b8a21a15eb9 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-number.d.mts @@ -0,0 +1,217 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; +import {StripeError} from '../stripe'; +import {CardNetworkBrand} from '../elements-group'; + +export type StripeCardNumberElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeCardNumberElementChangeEvent) => any + ): StripeCardNumberElement; + once( + eventType: 'change', + handler: (event: StripeCardNumberElementChangeEvent) => any + ): StripeCardNumberElement; + off( + eventType: 'change', + handler?: (event: StripeCardNumberElementChangeEvent) => any + ): StripeCardNumberElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + + /** + * Triggered when there is a change to the available networks the provided card can run on. + */ + on( + eventType: 'networkschange', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + once( + eventType: 'networkschange', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + off( + eventType: 'networkschange', + handler?: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: {elementType: 'cardNumber'; error: StripeError}) => any + ): StripeCardNumberElement; + once( + eventType: 'loaderror', + handler: (event: {elementType: 'cardNumber'; error: StripeError}) => any + ): StripeCardNumberElement; + off( + eventType: 'loaderror', + handler?: (event: {elementType: 'cardNumber'; error: StripeError}) => any + ): StripeCardNumberElement; + + /** + * Updates the options the `CardNumberElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `Element` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeCardNumberElementUpdateOptions>): void; +}; + +export interface StripeCardNumberElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + placeholder?: string; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is `false`. + */ + disabled?: boolean; + + /** + * Show a card brand icon in the Element. + * Default is `false`. + */ + showIcon?: boolean; + + /** + * Appearance of the brand icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * Hides and disables the Link Button in the Card Element. + * Default is `false`. + */ + disableLink?: boolean; + + /** + * Specifies a network preference for Card Brand Choice. The first network in the array which is a valid + * network on the entered card will be selected as the default in the Card Brand Choice dropdown upon + * entry of a co-branded card. + * + * Default is an empty array, meaning no default selection will be made in the Card Brand choice dropdown. + */ + preferredNetwork?: Array<CardNetworkBrand>; +} + +export interface StripeCardNumberElementUpdateOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + placeholder?: string; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is `false`. + */ + disabled?: boolean; + + /** + * Show a card brand icon in the Element. + * Default is `false`. + */ + showIcon?: boolean; + + /** + * Appearance of the brand icon in the Element. + */ + iconStyle?: 'default' | 'solid'; +} + +export interface StripeCardNumberElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'cardNumber'; + + /* + * The card brand of the card number being entered. + */ + brand: + | 'visa' + | 'mastercard' + | 'amex' + | 'discover' + | 'diners' + | 'jcb' + | 'unionpay' + | 'unknown'; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-number.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-number.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e5a8daa5030d7af5d0798c3aa65e8b8a21a15eb9 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card-number.d.ts @@ -0,0 +1,217 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; +import {StripeError} from '../stripe'; +import {CardNetworkBrand} from '../elements-group'; + +export type StripeCardNumberElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeCardNumberElementChangeEvent) => any + ): StripeCardNumberElement; + once( + eventType: 'change', + handler: (event: StripeCardNumberElementChangeEvent) => any + ): StripeCardNumberElement; + off( + eventType: 'change', + handler?: (event: StripeCardNumberElementChangeEvent) => any + ): StripeCardNumberElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + + /** + * Triggered when there is a change to the available networks the provided card can run on. + */ + on( + eventType: 'networkschange', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + once( + eventType: 'networkschange', + handler: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + off( + eventType: 'networkschange', + handler?: (event: {elementType: 'cardNumber'}) => any + ): StripeCardNumberElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: {elementType: 'cardNumber'; error: StripeError}) => any + ): StripeCardNumberElement; + once( + eventType: 'loaderror', + handler: (event: {elementType: 'cardNumber'; error: StripeError}) => any + ): StripeCardNumberElement; + off( + eventType: 'loaderror', + handler?: (event: {elementType: 'cardNumber'; error: StripeError}) => any + ): StripeCardNumberElement; + + /** + * Updates the options the `CardNumberElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `Element` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeCardNumberElementUpdateOptions>): void; +}; + +export interface StripeCardNumberElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + placeholder?: string; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is `false`. + */ + disabled?: boolean; + + /** + * Show a card brand icon in the Element. + * Default is `false`. + */ + showIcon?: boolean; + + /** + * Appearance of the brand icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * Hides and disables the Link Button in the Card Element. + * Default is `false`. + */ + disableLink?: boolean; + + /** + * Specifies a network preference for Card Brand Choice. The first network in the array which is a valid + * network on the entered card will be selected as the default in the Card Brand Choice dropdown upon + * entry of a co-branded card. + * + * Default is an empty array, meaning no default selection will be made in the Card Brand choice dropdown. + */ + preferredNetwork?: Array<CardNetworkBrand>; +} + +export interface StripeCardNumberElementUpdateOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + placeholder?: string; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is `false`. + */ + disabled?: boolean; + + /** + * Show a card brand icon in the Element. + * Default is `false`. + */ + showIcon?: boolean; + + /** + * Appearance of the brand icon in the Element. + */ + iconStyle?: 'default' | 'solid'; +} + +export interface StripeCardNumberElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'cardNumber'; + + /* + * The card brand of the card number being entered. + */ + brand: + | 'visa' + | 'mastercard' + | 'amex' + | 'discover' + | 'diners' + | 'jcb' + | 'unionpay' + | 'unknown'; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e4d0344d947099fcb60b64d5bbfdb1dda17e22b6 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card.d.mts @@ -0,0 +1,243 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; +import {StripeError} from '../stripe'; +import {CardNetworkBrand} from '../elements-group'; + +export type StripeCardElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeCardElementChangeEvent) => any + ): StripeCardElement; + once( + eventType: 'change', + handler: (event: StripeCardElementChangeEvent) => any + ): StripeCardElement; + off( + eventType: 'change', + handler?: (event: StripeCardElementChangeEvent) => any + ): StripeCardElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'card'}) => any + ): StripeCardElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'card'}) => any + ): StripeCardElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'card'}) => any + ): StripeCardElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'card'}) => any + ): StripeCardElement; + + /** + * Triggered when there is a change to the available networks the provided card can run on. + */ + on( + eventType: 'networkschange', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + once( + eventType: 'networkschange', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + off( + eventType: 'networkschange', + handler?: (event: {elementType: 'card'}) => any + ): StripeCardElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: {elementType: 'card'; error: StripeError}) => any + ): StripeCardElement; + once( + eventType: 'loaderror', + handler: (event: {elementType: 'card'; error: StripeError}) => any + ): StripeCardElement; + off( + eventType: 'loaderror', + handler?: (event: {elementType: 'card'; error: StripeError}) => any + ): StripeCardElement; + + /** + * Updates the options the `CardElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `CardElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: StripeCardElementUpdateOptions): void; +}; + +export interface StripeCardElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * A pre-filled set of values to include in the input (e.g., `{postalCode: '94110'}`). + * Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled. + */ + value?: {postalCode?: string}; + + /** + * Hide the postal code field. + * Default is `false`. + * If you are already collecting a full billing address or postal code elsewhere, set this to `true`. + */ + hidePostalCode?: boolean; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is `false`. + */ + disabled?: boolean; + + /** + * Hides and disables the Link Button in the Card Element. + * Default is `false`. + */ + disableLink?: boolean; + + /** + * Specifies a network preference for Card Brand Choice. The first network in the array which is a valid + * network on the entered card will be selected as the default in the Card Brand Choice dropdown upon + * entry of a co-branded card. + * + * Default is an empty array, meaning no default selection will be made in the Card Brand choice dropdown. + */ + preferredNetwork?: Array<CardNetworkBrand>; +} + +export interface StripeCardElementUpdateOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * A pre-filled set of values to include in the input (e.g., `{postalCode: '94110'}`). + * Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled. + */ + value?: {postalCode?: string}; + + /** + * Hide the postal code field. + * Default is `false`. + * If you are already collecting a full billing address or postal code elsewhere, set this to `true`. + */ + hidePostalCode?: boolean; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is `false`. + */ + disabled?: boolean; +} + +export interface StripeCardElementChangeEvent extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'card'; + + /** + * An object containing the currently entered `postalCode`. + */ + value: {postalCode: string}; + + /* + * The card brand of the card number being entered. + */ + brand: + | 'visa' + | 'mastercard' + | 'amex' + | 'discover' + | 'diners' + | 'jcb' + | 'unionpay' + | 'unknown'; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e4d0344d947099fcb60b64d5bbfdb1dda17e22b6 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/card.d.ts @@ -0,0 +1,243 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; +import {StripeError} from '../stripe'; +import {CardNetworkBrand} from '../elements-group'; + +export type StripeCardElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeCardElementChangeEvent) => any + ): StripeCardElement; + once( + eventType: 'change', + handler: (event: StripeCardElementChangeEvent) => any + ): StripeCardElement; + off( + eventType: 'change', + handler?: (event: StripeCardElementChangeEvent) => any + ): StripeCardElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'card'}) => any + ): StripeCardElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'card'}) => any + ): StripeCardElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'card'}) => any + ): StripeCardElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'card'}) => any + ): StripeCardElement; + + /** + * Triggered when there is a change to the available networks the provided card can run on. + */ + on( + eventType: 'networkschange', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + once( + eventType: 'networkschange', + handler: (event: {elementType: 'card'}) => any + ): StripeCardElement; + off( + eventType: 'networkschange', + handler?: (event: {elementType: 'card'}) => any + ): StripeCardElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: {elementType: 'card'; error: StripeError}) => any + ): StripeCardElement; + once( + eventType: 'loaderror', + handler: (event: {elementType: 'card'; error: StripeError}) => any + ): StripeCardElement; + off( + eventType: 'loaderror', + handler?: (event: {elementType: 'card'; error: StripeError}) => any + ): StripeCardElement; + + /** + * Updates the options the `CardElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `CardElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: StripeCardElementUpdateOptions): void; +}; + +export interface StripeCardElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * A pre-filled set of values to include in the input (e.g., `{postalCode: '94110'}`). + * Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled. + */ + value?: {postalCode?: string}; + + /** + * Hide the postal code field. + * Default is `false`. + * If you are already collecting a full billing address or postal code elsewhere, set this to `true`. + */ + hidePostalCode?: boolean; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is `false`. + */ + disabled?: boolean; + + /** + * Hides and disables the Link Button in the Card Element. + * Default is `false`. + */ + disableLink?: boolean; + + /** + * Specifies a network preference for Card Brand Choice. The first network in the array which is a valid + * network on the entered card will be selected as the default in the Card Brand Choice dropdown upon + * entry of a co-branded card. + * + * Default is an empty array, meaning no default selection will be made in the Card Brand choice dropdown. + */ + preferredNetwork?: Array<CardNetworkBrand>; +} + +export interface StripeCardElementUpdateOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * A pre-filled set of values to include in the input (e.g., `{postalCode: '94110'}`). + * Note that sensitive card information (card number, CVC, and expiration date) cannot be pre-filled. + */ + value?: {postalCode?: string}; + + /** + * Hide the postal code field. + * Default is `false`. + * If you are already collecting a full billing address or postal code elsewhere, set this to `true`. + */ + hidePostalCode?: boolean; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is `false`. + */ + disabled?: boolean; +} + +export interface StripeCardElementChangeEvent extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'card'; + + /** + * An object containing the currently entered `postalCode`. + */ + value: {postalCode: string}; + + /* + * The card brand of the card number being entered. + */ + brand: + | 'visa' + | 'mastercard' + | 'amex' + | 'discover' + | 'diners' + | 'jcb' + | 'unionpay' + | 'unknown'; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/eps-bank.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/eps-bank.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..89358bddd1bc7411cd10ef1a6116143159e35977 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/eps-bank.d.mts @@ -0,0 +1,140 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeEpsBankElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeEpsBankElementChangeEvent) => any + ): StripeEpsBankElement; + once( + eventType: 'change', + handler: (event: StripeEpsBankElementChangeEvent) => any + ): StripeEpsBankElement; + off( + eventType: 'change', + handler: (event: StripeEpsBankElementChangeEvent) => any + ): StripeEpsBankElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + off( + eventType: 'ready', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + off( + eventType: 'focus', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + off( + eventType: 'blur', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + off( + eventType: 'escape', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + + /** + * Updates the options the `EpsBankElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `EpsBankElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeEpsBankElementOptions>): void; +}; + +export interface StripeEpsBankElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * A pre-filled value for the Element. + * Can be one of the banks listed in the [EPS guide](https://stripe.com/docs/payments/eps/accept-a-payment#bank-values) (e.g., `bank_austria`). + */ + value?: string; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeEpsBankElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'epsBank'; + + /** + * A pre-filled value for the Element. + * Can be one of the banks listed in the [EPS guide](https://stripe.com/docs/payments/eps/accept-a-payment#bank-values) (e.g., `bank_austria`). + */ + value?: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/eps-bank.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/eps-bank.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..89358bddd1bc7411cd10ef1a6116143159e35977 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/eps-bank.d.ts @@ -0,0 +1,140 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeEpsBankElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeEpsBankElementChangeEvent) => any + ): StripeEpsBankElement; + once( + eventType: 'change', + handler: (event: StripeEpsBankElementChangeEvent) => any + ): StripeEpsBankElement; + off( + eventType: 'change', + handler: (event: StripeEpsBankElementChangeEvent) => any + ): StripeEpsBankElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + off( + eventType: 'ready', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + off( + eventType: 'focus', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + off( + eventType: 'blur', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + off( + eventType: 'escape', + handler: (event: {elementType: 'epsBank'}) => any + ): StripeEpsBankElement; + + /** + * Updates the options the `EpsBankElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `EpsBankElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeEpsBankElementOptions>): void; +}; + +export interface StripeEpsBankElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * A pre-filled value for the Element. + * Can be one of the banks listed in the [EPS guide](https://stripe.com/docs/payments/eps/accept-a-payment#bank-values) (e.g., `bank_austria`). + */ + value?: string; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeEpsBankElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'epsBank'; + + /** + * A pre-filled value for the Element. + * Can be one of the banks listed in the [EPS guide](https://stripe.com/docs/payments/eps/accept-a-payment#bank-values) (e.g., `bank_austria`). + */ + value?: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/express-checkout.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/express-checkout.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..a348c7747057956a98abce68fc8cae29d6816908 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/express-checkout.d.mts @@ -0,0 +1,446 @@ +import {StripeElementBase} from './base'; +import {StripeError} from '../stripe'; +import {ApplePayOption, ApplePayUpdateOption} from './apple-pay'; + +export type StripeExpressCheckoutElement = StripeElementBase & { + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: StripeExpressCheckoutElementReadyEvent) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'ready', + handler: (event: StripeExpressCheckoutElementReadyEvent) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'ready', + handler?: (event: StripeExpressCheckoutElementReadyEvent) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when a button on the element is clicked. + */ + on( + eventType: 'click', + handler: (event: StripeExpressCheckoutElementClickEvent) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'click', + handler: (event: StripeExpressCheckoutElementClickEvent) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'click', + handler?: (event: StripeExpressCheckoutElementClickEvent) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: { + elementType: 'expressCheckout'; + error: StripeError; + }) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'loaderror', + handler: (event: { + elementType: 'expressCheckout'; + error: StripeError; + }) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'loaderror', + handler?: (event: { + elementType: 'expressCheckout'; + error: StripeError; + }) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when a buyer authorizes a payment within a supported payment method. + */ + on( + eventType: 'confirm', + handler: (event: StripeExpressCheckoutElementConfirmEvent) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'confirm', + handler: (event: StripeExpressCheckoutElementConfirmEvent) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'confirm', + handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when a payment interface is dismissed (e.g., a buyer closes the payment interface) + */ + on( + eventType: 'cancel', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'cancel', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'cancel', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when a buyer selects a different shipping address. + */ + on( + eventType: 'shippingaddresschange', + handler: ( + event: StripeExpressCheckoutElementShippingAddressChangeEvent + ) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'shippingaddresschange', + handler: ( + event: StripeExpressCheckoutElementShippingAddressChangeEvent + ) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'shippingaddresschange', + handler?: ( + event: StripeExpressCheckoutElementShippingAddressChangeEvent + ) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when a buyer selects a different shipping rate. + */ + on( + eventType: 'shippingratechange', + handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'shippingratechange', + handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'shippingratechange', + handler?: ( + event: StripeExpressCheckoutElementShippingRateChangeEvent + ) => any + ): StripeExpressCheckoutElement; + + /** + * Updates the options the `ExpressCheckoutElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update( + options: StripeExpressCheckoutElementUpdateOptions + ): StripeExpressCheckoutElement; +}; + +export type ExpressPaymentType = 'google_pay' | 'apple_pay' | 'link' | 'paypal'; + +export type ExpressCheckoutPartialAddress = { + city: string; + state: string; + postal_code: string; + country: string; +}; + +export type ExpressCheckoutAddress = ExpressCheckoutPartialAddress & { + line1: string; + line2: string | null; +}; + +export type BillingDetails = { + name: string; + email?: string; + phone?: string; + address: ExpressCheckoutAddress; +}; + +export type ShippingAddress = { + name: string; + address: ExpressCheckoutAddress; +}; + +export type LineItem = { + name: string; + amount: number; +}; + +export type DeliveryUnit = 'hour' | 'day' | 'business_day' | 'week' | 'month'; + +export type DeliveryEstimate = { + unit: DeliveryUnit; + value: number; +}; + +export type ShippingRate = { + id: string; + amount: number; + displayName: string; + deliveryEstimate?: + | string + | { + maximum?: DeliveryEstimate; + minimum?: DeliveryEstimate; + }; +}; + +export type LayoutOption = { + maxColumns?: number; + maxRows?: number; + overflow?: 'auto' | 'never'; +}; + +export type ExpressCheckoutWalletOption = 'always' | 'auto' | 'never'; + +export type ExpressCheckoutWalletsOption = { + applePay?: ExpressCheckoutWalletOption; + googlePay?: ExpressCheckoutWalletOption; +}; + +export type ApplePayButtonTheme = 'black' | 'white' | 'white-outline'; + +export type GooglePayButtonTheme = 'black' | 'white'; + +export type ButtonThemeOption = { + applePay?: ApplePayButtonTheme; + googlePay?: GooglePayButtonTheme; +}; + +export type ApplePayButtonType = + | 'add-money' + | 'book' + | 'buy' + | 'check-out' + | 'contribute' + | 'donate' + | 'order' + | 'plain' + | 'reload' + | 'rent' + | 'subscribe' + | 'support' + | 'tip' + | 'top-up'; + +export type GooglePayButtonType = + | 'book' + | 'buy' + | 'checkout' + | 'donate' + | 'order' + | 'pay' + | 'plain' + | 'subscribe'; + +export type ButtonTypeOption = { + applePay?: ApplePayButtonType; + googlePay?: GooglePayButtonType; +}; + +export interface StripeExpressCheckoutElementOptions { + /** + * Manually sets the height of the buttons shown. + */ + buttonHeight?: number; + + /** + * Controls the color of each button. + */ + buttonTheme?: ButtonThemeOption; + + /** + * Specifies the type of each button. + */ + buttonType?: ButtonTypeOption; + + /** + * Specifies how buttons should be laid out in relation to each other. + */ + layout?: LayoutOption; + + /** + * Override the order in which payment methods are displayed in the Express Checkout Element. + * By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user. + */ + paymentMethodOrder?: string[]; + + /** + * Control wallets display in the Express Checkout Element. + */ + wallets?: ExpressCheckoutWalletsOption; +} + +/* + * Updatable options for an `Elements` instance + */ +export interface StripeExpressCheckoutElementUpdateOptions { + /** + * Manually sets the height of the buttons shown. + */ + buttonHeight?: number; + + /** + * Specifies how buttons should be laid out in relation to each other. + */ + layout?: LayoutOption; + + /** + * Override the order in which payment methods are displayed in the Pay Button Element. + * By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user. + */ + paymentMethodOrder?: string[]; +} + +export type AvailablePaymentMethods = { + applePay: boolean; + googlePay: boolean; +}; + +export interface StripeExpressCheckoutElementReadyEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'expressCheckout'; + + /** + * The list of payment methods that could possibly show in the element, or undefined if no payment methods can show. + */ + availablePaymentMethods: undefined | AvailablePaymentMethods; +} + +export type ClickResolveDetails = { + /** + * An array of two-letter ISO country codes representing which countries + * are eligible shipping locations. + */ + allowedShippingCountries?: string[]; + + billingAddressRequired?: boolean; + + /** + * Provide information about your business that will be displayed in the payment interface. + * This information will be retrieved from your Stripe account if not provided. + */ + business?: {name: string}; + + emailRequired?: boolean; + + lineItems?: Array<LineItem>; + + phoneNumberRequired?: boolean; + + shippingAddressRequired?: boolean; + + shippingRates?: Array<ShippingRate>; + + applePay?: ApplePayOption; +}; + +export interface StripeExpressCheckoutElementClickEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'expressCheckout'; + + /** + * The payment method associated with the button that was clicked. + */ + expressPaymentType: ExpressPaymentType; + + /** + * Callback to configure the details shown on a payment interface, including which fields to collect. + * This must be called within 1 second of the 'click' event being emitted. + */ + resolve: (resolveDetails?: ClickResolveDetails) => void; +} + +export interface StripeExpressCheckoutElementConfirmEvent { + /** + * Callback when a payment is unsuccessful. Optionally, specifying a reason will show a more detailed error in the payment interface. + */ + paymentFailed: (payload?: { + reason?: 'fail' | 'invalid_shipping_address'; + }) => void; + + billingDetails?: BillingDetails; + + shippingAddress?: ShippingAddress; + + shippingRate?: ShippingRate; + + expressPaymentType: ExpressPaymentType; +} + +export type ChangeResolveDetails = { + lineItems?: Array<LineItem>; + shippingRates?: Array<ShippingRate>; + applePay?: ApplePayUpdateOption; +}; + +export interface StripeExpressCheckoutElementShippingAddressChangeEvent { + name: string; + address: ExpressCheckoutPartialAddress; + resolve: (resolveDetails?: ChangeResolveDetails) => void; + reject: () => void; +} + +export interface StripeExpressCheckoutElementShippingRateChangeEvent { + shippingRate: ShippingRate; + resolve: (resolveDetails?: ChangeResolveDetails) => void; + reject: () => void; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/express-checkout.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/express-checkout.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a348c7747057956a98abce68fc8cae29d6816908 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/express-checkout.d.ts @@ -0,0 +1,446 @@ +import {StripeElementBase} from './base'; +import {StripeError} from '../stripe'; +import {ApplePayOption, ApplePayUpdateOption} from './apple-pay'; + +export type StripeExpressCheckoutElement = StripeElementBase & { + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: StripeExpressCheckoutElementReadyEvent) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'ready', + handler: (event: StripeExpressCheckoutElementReadyEvent) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'ready', + handler?: (event: StripeExpressCheckoutElementReadyEvent) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when a button on the element is clicked. + */ + on( + eventType: 'click', + handler: (event: StripeExpressCheckoutElementClickEvent) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'click', + handler: (event: StripeExpressCheckoutElementClickEvent) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'click', + handler?: (event: StripeExpressCheckoutElementClickEvent) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: { + elementType: 'expressCheckout'; + error: StripeError; + }) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'loaderror', + handler: (event: { + elementType: 'expressCheckout'; + error: StripeError; + }) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'loaderror', + handler?: (event: { + elementType: 'expressCheckout'; + error: StripeError; + }) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when a buyer authorizes a payment within a supported payment method. + */ + on( + eventType: 'confirm', + handler: (event: StripeExpressCheckoutElementConfirmEvent) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'confirm', + handler: (event: StripeExpressCheckoutElementConfirmEvent) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'confirm', + handler?: (event: StripeExpressCheckoutElementConfirmEvent) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when a payment interface is dismissed (e.g., a buyer closes the payment interface) + */ + on( + eventType: 'cancel', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'cancel', + handler: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'cancel', + handler?: (event: {elementType: 'expressCheckout'}) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when a buyer selects a different shipping address. + */ + on( + eventType: 'shippingaddresschange', + handler: ( + event: StripeExpressCheckoutElementShippingAddressChangeEvent + ) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'shippingaddresschange', + handler: ( + event: StripeExpressCheckoutElementShippingAddressChangeEvent + ) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'shippingaddresschange', + handler?: ( + event: StripeExpressCheckoutElementShippingAddressChangeEvent + ) => any + ): StripeExpressCheckoutElement; + + /** + * Triggered when a buyer selects a different shipping rate. + */ + on( + eventType: 'shippingratechange', + handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any + ): StripeExpressCheckoutElement; + once( + eventType: 'shippingratechange', + handler: (event: StripeExpressCheckoutElementShippingRateChangeEvent) => any + ): StripeExpressCheckoutElement; + off( + eventType: 'shippingratechange', + handler?: ( + event: StripeExpressCheckoutElementShippingRateChangeEvent + ) => any + ): StripeExpressCheckoutElement; + + /** + * Updates the options the `ExpressCheckoutElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update( + options: StripeExpressCheckoutElementUpdateOptions + ): StripeExpressCheckoutElement; +}; + +export type ExpressPaymentType = 'google_pay' | 'apple_pay' | 'link' | 'paypal'; + +export type ExpressCheckoutPartialAddress = { + city: string; + state: string; + postal_code: string; + country: string; +}; + +export type ExpressCheckoutAddress = ExpressCheckoutPartialAddress & { + line1: string; + line2: string | null; +}; + +export type BillingDetails = { + name: string; + email?: string; + phone?: string; + address: ExpressCheckoutAddress; +}; + +export type ShippingAddress = { + name: string; + address: ExpressCheckoutAddress; +}; + +export type LineItem = { + name: string; + amount: number; +}; + +export type DeliveryUnit = 'hour' | 'day' | 'business_day' | 'week' | 'month'; + +export type DeliveryEstimate = { + unit: DeliveryUnit; + value: number; +}; + +export type ShippingRate = { + id: string; + amount: number; + displayName: string; + deliveryEstimate?: + | string + | { + maximum?: DeliveryEstimate; + minimum?: DeliveryEstimate; + }; +}; + +export type LayoutOption = { + maxColumns?: number; + maxRows?: number; + overflow?: 'auto' | 'never'; +}; + +export type ExpressCheckoutWalletOption = 'always' | 'auto' | 'never'; + +export type ExpressCheckoutWalletsOption = { + applePay?: ExpressCheckoutWalletOption; + googlePay?: ExpressCheckoutWalletOption; +}; + +export type ApplePayButtonTheme = 'black' | 'white' | 'white-outline'; + +export type GooglePayButtonTheme = 'black' | 'white'; + +export type ButtonThemeOption = { + applePay?: ApplePayButtonTheme; + googlePay?: GooglePayButtonTheme; +}; + +export type ApplePayButtonType = + | 'add-money' + | 'book' + | 'buy' + | 'check-out' + | 'contribute' + | 'donate' + | 'order' + | 'plain' + | 'reload' + | 'rent' + | 'subscribe' + | 'support' + | 'tip' + | 'top-up'; + +export type GooglePayButtonType = + | 'book' + | 'buy' + | 'checkout' + | 'donate' + | 'order' + | 'pay' + | 'plain' + | 'subscribe'; + +export type ButtonTypeOption = { + applePay?: ApplePayButtonType; + googlePay?: GooglePayButtonType; +}; + +export interface StripeExpressCheckoutElementOptions { + /** + * Manually sets the height of the buttons shown. + */ + buttonHeight?: number; + + /** + * Controls the color of each button. + */ + buttonTheme?: ButtonThemeOption; + + /** + * Specifies the type of each button. + */ + buttonType?: ButtonTypeOption; + + /** + * Specifies how buttons should be laid out in relation to each other. + */ + layout?: LayoutOption; + + /** + * Override the order in which payment methods are displayed in the Express Checkout Element. + * By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user. + */ + paymentMethodOrder?: string[]; + + /** + * Control wallets display in the Express Checkout Element. + */ + wallets?: ExpressCheckoutWalletsOption; +} + +/* + * Updatable options for an `Elements` instance + */ +export interface StripeExpressCheckoutElementUpdateOptions { + /** + * Manually sets the height of the buttons shown. + */ + buttonHeight?: number; + + /** + * Specifies how buttons should be laid out in relation to each other. + */ + layout?: LayoutOption; + + /** + * Override the order in which payment methods are displayed in the Pay Button Element. + * By default, the Express Checkout Element will use a dynamic ordering that optimizes payment method display for each user. + */ + paymentMethodOrder?: string[]; +} + +export type AvailablePaymentMethods = { + applePay: boolean; + googlePay: boolean; +}; + +export interface StripeExpressCheckoutElementReadyEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'expressCheckout'; + + /** + * The list of payment methods that could possibly show in the element, or undefined if no payment methods can show. + */ + availablePaymentMethods: undefined | AvailablePaymentMethods; +} + +export type ClickResolveDetails = { + /** + * An array of two-letter ISO country codes representing which countries + * are eligible shipping locations. + */ + allowedShippingCountries?: string[]; + + billingAddressRequired?: boolean; + + /** + * Provide information about your business that will be displayed in the payment interface. + * This information will be retrieved from your Stripe account if not provided. + */ + business?: {name: string}; + + emailRequired?: boolean; + + lineItems?: Array<LineItem>; + + phoneNumberRequired?: boolean; + + shippingAddressRequired?: boolean; + + shippingRates?: Array<ShippingRate>; + + applePay?: ApplePayOption; +}; + +export interface StripeExpressCheckoutElementClickEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'expressCheckout'; + + /** + * The payment method associated with the button that was clicked. + */ + expressPaymentType: ExpressPaymentType; + + /** + * Callback to configure the details shown on a payment interface, including which fields to collect. + * This must be called within 1 second of the 'click' event being emitted. + */ + resolve: (resolveDetails?: ClickResolveDetails) => void; +} + +export interface StripeExpressCheckoutElementConfirmEvent { + /** + * Callback when a payment is unsuccessful. Optionally, specifying a reason will show a more detailed error in the payment interface. + */ + paymentFailed: (payload?: { + reason?: 'fail' | 'invalid_shipping_address'; + }) => void; + + billingDetails?: BillingDetails; + + shippingAddress?: ShippingAddress; + + shippingRate?: ShippingRate; + + expressPaymentType: ExpressPaymentType; +} + +export type ChangeResolveDetails = { + lineItems?: Array<LineItem>; + shippingRates?: Array<ShippingRate>; + applePay?: ApplePayUpdateOption; +}; + +export interface StripeExpressCheckoutElementShippingAddressChangeEvent { + name: string; + address: ExpressCheckoutPartialAddress; + resolve: (resolveDetails?: ChangeResolveDetails) => void; + reject: () => void; +} + +export interface StripeExpressCheckoutElementShippingRateChangeEvent { + shippingRate: ShippingRate; + resolve: (resolveDetails?: ChangeResolveDetails) => void; + reject: () => void; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/fpx-bank.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/fpx-bank.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..9714ec8745e2d3534428da5124480e0d4fc05901 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/fpx-bank.d.mts @@ -0,0 +1,134 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeFpxBankElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeFpxBankElementChangeEvent) => any + ): StripeFpxBankElement; + once( + eventType: 'change', + handler: (event: StripeFpxBankElementChangeEvent) => any + ): StripeFpxBankElement; + off( + eventType: 'change', + handler?: (event: StripeFpxBankElementChangeEvent) => any + ): StripeFpxBankElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + + /** + * Updates the options the `FpxBankElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `FpxBankElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeFpxBankElementOptions>): void; +}; + +export interface StripeFpxBankElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * A pre-filled value for the Element. + * Can be one of the banks listed in the [FPX guide](https://stripe.com/docs/payments/fpx#bank-reference) (e.g., `affin_bank`). + */ + value?: string; + + /** + * The type of the FPX accountholder. + */ + accountHolderType: 'individual' | 'company'; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeFpxBankElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'fpxBank'; + + /** + * The selected bank. + * Can be one of the banks listed in the [FPX guide](https://stripe.com/docs/payments/fpx#bank-reference). + */ + value: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/fpx-bank.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/fpx-bank.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9714ec8745e2d3534428da5124480e0d4fc05901 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/fpx-bank.d.ts @@ -0,0 +1,134 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeFpxBankElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeFpxBankElementChangeEvent) => any + ): StripeFpxBankElement; + once( + eventType: 'change', + handler: (event: StripeFpxBankElementChangeEvent) => any + ): StripeFpxBankElement; + off( + eventType: 'change', + handler?: (event: StripeFpxBankElementChangeEvent) => any + ): StripeFpxBankElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'fpxBank'}) => any + ): StripeFpxBankElement; + + /** + * Updates the options the `FpxBankElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `FpxBankElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeFpxBankElementOptions>): void; +}; + +export interface StripeFpxBankElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * A pre-filled value for the Element. + * Can be one of the banks listed in the [FPX guide](https://stripe.com/docs/payments/fpx#bank-reference) (e.g., `affin_bank`). + */ + value?: string; + + /** + * The type of the FPX accountholder. + */ + accountHolderType: 'individual' | 'company'; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeFpxBankElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'fpxBank'; + + /** + * The selected bank. + * Can be one of the banks listed in the [FPX guide](https://stripe.com/docs/payments/fpx#bank-reference). + */ + value: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/iban.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/iban.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..ae95dea5692224ab3008a77c70da94e2194bfa59 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/iban.d.mts @@ -0,0 +1,135 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeIbanElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeIbanElementChangeEvent) => any + ): StripeIbanElement; + once( + eventType: 'change', + handler: (event: StripeIbanElementChangeEvent) => any + ): StripeIbanElement; + off( + eventType: 'change', + handler?: (event: StripeIbanElementChangeEvent) => any + ): StripeIbanElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + + /** + * Updates the options the `IbanElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IbanElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIbanElementOptions>): void; +}; + +export interface StripeIbanElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + supportedCountries?: string[]; + + placeholderCountry?: string; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeIbanElementChangeEvent extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'iban'; + + country: string; + + bankName: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/iban.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/iban.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ae95dea5692224ab3008a77c70da94e2194bfa59 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/iban.d.ts @@ -0,0 +1,135 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeIbanElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeIbanElementChangeEvent) => any + ): StripeIbanElement; + once( + eventType: 'change', + handler: (event: StripeIbanElementChangeEvent) => any + ): StripeIbanElement; + off( + eventType: 'change', + handler?: (event: StripeIbanElementChangeEvent) => any + ): StripeIbanElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'iban'}) => any + ): StripeIbanElement; + + /** + * Updates the options the `IbanElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IbanElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIbanElementOptions>): void; +}; + +export interface StripeIbanElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + supportedCountries?: string[]; + + placeholderCountry?: string; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeIbanElementChangeEvent extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'iban'; + + country: string; + + bankName: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/ideal-bank.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/ideal-bank.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e352a37910c8d8e0c9f6836ca403b88fd0d0b75f --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/ideal-bank.d.mts @@ -0,0 +1,140 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeIdealBankElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeIdealBankElementChangeEvent) => any + ): StripeIdealBankElement; + once( + eventType: 'change', + handler: (event: StripeIdealBankElementChangeEvent) => any + ): StripeIdealBankElement; + off( + eventType: 'change', + handler?: (event: StripeIdealBankElementChangeEvent) => any + ): StripeIdealBankElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + + /** + * Updates the options the `IdealBankElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IdealBankElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIdealBankElementOptions>): void; +}; + +export interface StripeIdealBankElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * A pre-filled value for the Element. + * Can be one of the banks listed in the [iDEAL guide](https://stripe.com/docs/sources/ideal#specifying-customer-bank) (e.g., `abn_amro`). + */ + value?: string; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeIdealBankElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'idealBank'; + + /** + * The selected bank. + * Can be one of the banks listed in the [iDEAL guide](https://stripe.com/docs/sources/ideal#specifying-customer-bank). + */ + value: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/ideal-bank.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/ideal-bank.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e352a37910c8d8e0c9f6836ca403b88fd0d0b75f --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/ideal-bank.d.ts @@ -0,0 +1,140 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeIdealBankElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeIdealBankElementChangeEvent) => any + ): StripeIdealBankElement; + once( + eventType: 'change', + handler: (event: StripeIdealBankElementChangeEvent) => any + ): StripeIdealBankElement; + off( + eventType: 'change', + handler?: (event: StripeIdealBankElementChangeEvent) => any + ): StripeIdealBankElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'idealBank'}) => any + ): StripeIdealBankElement; + + /** + * Updates the options the `IdealBankElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IdealBankElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIdealBankElementOptions>): void; +}; + +export interface StripeIdealBankElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * A pre-filled value for the Element. + * Can be one of the banks listed in the [iDEAL guide](https://stripe.com/docs/sources/ideal#specifying-customer-bank) (e.g., `abn_amro`). + */ + value?: string; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeIdealBankElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'idealBank'; + + /** + * The selected bank. + * Can be one of the banks listed in the [iDEAL guide](https://stripe.com/docs/sources/ideal#specifying-customer-bank). + */ + value: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/index.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..785775dd959a00217d7d4700e6b084d859c38593 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/index.d.mts @@ -0,0 +1,21 @@ +export * from './address'; +export * from './payment-method-messaging'; +export * from './affirm-message'; +export * from './afterpay-clearpay-message'; +export * from './au-bank-account'; +export * from './base'; +export * from './card-cvc'; +export * from './card-expiry'; +export * from './card-number'; +export * from './card'; +export * from './eps-bank'; +export * from './express-checkout'; +export * from './fpx-bank'; +export * from './iban'; +export * from './ideal-bank'; +export * from './link-authentication'; +export * from './p24-bank'; +export * from './payment-request-button'; +export * from './payment'; +export * from './shipping-address'; +export * from './issuing'; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/index.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..785775dd959a00217d7d4700e6b084d859c38593 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/index.d.ts @@ -0,0 +1,21 @@ +export * from './address'; +export * from './payment-method-messaging'; +export * from './affirm-message'; +export * from './afterpay-clearpay-message'; +export * from './au-bank-account'; +export * from './base'; +export * from './card-cvc'; +export * from './card-expiry'; +export * from './card-number'; +export * from './card'; +export * from './eps-bank'; +export * from './express-checkout'; +export * from './fpx-bank'; +export * from './iban'; +export * from './ideal-bank'; +export * from './link-authentication'; +export * from './p24-bank'; +export * from './payment-request-button'; +export * from './payment'; +export * from './shipping-address'; +export * from './issuing'; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/index.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..3b9f8ecb80b06096627f740d07a81747791d5df1 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/index.d.mts @@ -0,0 +1,5 @@ +export * from './issuing-card-number-display'; +export * from './issuing-card-cvc-display'; +export * from './issuing-card-expiry-display'; +export * from './issuing-card-pin-display'; +export * from './issuing-card-copy-button'; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/index.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b9f8ecb80b06096627f740d07a81747791d5df1 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/index.d.ts @@ -0,0 +1,5 @@ +export * from './issuing-card-number-display'; +export * from './issuing-card-cvc-display'; +export * from './issuing-card-expiry-display'; +export * from './issuing-card-pin-display'; +export * from './issuing-card-copy-button'; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-copy-button.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-copy-button.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..0ec60d5c6aaf057dd52b300c21b9a5a3ce967c06 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-copy-button.d.mts @@ -0,0 +1,37 @@ +import {StripeElementBase, StripeElementStyle} from '../base'; + +export type StripeIssuingCardCopyButtonElement = StripeElementBase & { + /** + * Triggered when the element is clicked. + */ + on( + eventType: 'click', + handler: (event: {elementType: 'issuingCardCopyButton'}) => any + ): StripeIssuingCardCopyButtonElement; + once( + eventType: 'click', + handler: (event: {elementType: 'issuingCardCopyButton'}) => any + ): StripeIssuingCardCopyButtonElement; + off( + eventType: 'click', + handler?: (event: {elementType: 'issuingCardCopyButton'}) => any + ): StripeIssuingCardCopyButtonElement; + + /** + * Updates the options the `IssuingCardCopyButtonElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IssuingCardCopyButtonElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIssuingCardCopyButtonElementOptions>): void; +}; + +export interface StripeIssuingCardCopyButtonElementOptions { + /** + * The issued card data element to copy to the user's clipboard + */ + toCopy: 'expiry' | 'cvc' | 'number' | 'pin'; + + style?: StripeElementStyle; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-copy-button.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-copy-button.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0ec60d5c6aaf057dd52b300c21b9a5a3ce967c06 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-copy-button.d.ts @@ -0,0 +1,37 @@ +import {StripeElementBase, StripeElementStyle} from '../base'; + +export type StripeIssuingCardCopyButtonElement = StripeElementBase & { + /** + * Triggered when the element is clicked. + */ + on( + eventType: 'click', + handler: (event: {elementType: 'issuingCardCopyButton'}) => any + ): StripeIssuingCardCopyButtonElement; + once( + eventType: 'click', + handler: (event: {elementType: 'issuingCardCopyButton'}) => any + ): StripeIssuingCardCopyButtonElement; + off( + eventType: 'click', + handler?: (event: {elementType: 'issuingCardCopyButton'}) => any + ): StripeIssuingCardCopyButtonElement; + + /** + * Updates the options the `IssuingCardCopyButtonElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IssuingCardCopyButtonElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIssuingCardCopyButtonElementOptions>): void; +}; + +export interface StripeIssuingCardCopyButtonElementOptions { + /** + * The issued card data element to copy to the user's clipboard + */ + toCopy: 'expiry' | 'cvc' | 'number' | 'pin'; + + style?: StripeElementStyle; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-cvc-display.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-cvc-display.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..72db2c39af27da03764d5a61d045f13ecc757feb --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-cvc-display.d.mts @@ -0,0 +1,32 @@ +import {StripeElementBase, StripeElementStyle} from '../base'; + +export type StripeIssuingCardCvcDisplayElement = StripeElementBase & { + /** + * Updates the options the `IssuingCardCvcDisplayElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IssuingCardCvcDisplayElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIssuingCardCvcDisplayElementOptions>): void; +}; + +export interface StripeIssuingCardCvcDisplayElementOptions { + /** + * The token (e.g. `ic_abc123`) of the issued card to display in this Element + */ + issuingCard: string; + + /** + * The secret component of the ephemeral key with which to authenticate this sensitive + * card details request + */ + ephemeralKeySecret?: string; + + /** + * The nonce used to mint the ephemeral key provided in `ephemeralKeySecret` + */ + nonce?: string; + + style?: StripeElementStyle; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-cvc-display.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-cvc-display.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..72db2c39af27da03764d5a61d045f13ecc757feb --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-cvc-display.d.ts @@ -0,0 +1,32 @@ +import {StripeElementBase, StripeElementStyle} from '../base'; + +export type StripeIssuingCardCvcDisplayElement = StripeElementBase & { + /** + * Updates the options the `IssuingCardCvcDisplayElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IssuingCardCvcDisplayElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIssuingCardCvcDisplayElementOptions>): void; +}; + +export interface StripeIssuingCardCvcDisplayElementOptions { + /** + * The token (e.g. `ic_abc123`) of the issued card to display in this Element + */ + issuingCard: string; + + /** + * The secret component of the ephemeral key with which to authenticate this sensitive + * card details request + */ + ephemeralKeySecret?: string; + + /** + * The nonce used to mint the ephemeral key provided in `ephemeralKeySecret` + */ + nonce?: string; + + style?: StripeElementStyle; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-expiry-display.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-expiry-display.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..7c80bf09216e29a621df50c415a79e37f5dfc5d4 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-expiry-display.d.mts @@ -0,0 +1,32 @@ +import {StripeElementBase, StripeElementStyle} from '../base'; + +export type StripeIssuingCardExpiryDisplayElement = StripeElementBase & { + /** + * Updates the options the `IssuingCardExpiryDisplayElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IssuingCardExpiryDisplayElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIssuingCardExpiryDisplayElementOptions>): void; +}; + +export interface StripeIssuingCardExpiryDisplayElementOptions { + /** + * The token (e.g. `ic_abc123`) of the issued card to display in this Element + */ + issuingCard: string; + + /** + * The secret component of the ephemeral key with which to authenticate this sensitive + * card details request + */ + ephemeralKeySecret?: string; + + /** + * The nonce used to mint the ephemeral key provided in `ephemeralKeySecret` + */ + nonce?: string; + + style?: StripeElementStyle; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-expiry-display.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-expiry-display.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7c80bf09216e29a621df50c415a79e37f5dfc5d4 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-expiry-display.d.ts @@ -0,0 +1,32 @@ +import {StripeElementBase, StripeElementStyle} from '../base'; + +export type StripeIssuingCardExpiryDisplayElement = StripeElementBase & { + /** + * Updates the options the `IssuingCardExpiryDisplayElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IssuingCardExpiryDisplayElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIssuingCardExpiryDisplayElementOptions>): void; +}; + +export interface StripeIssuingCardExpiryDisplayElementOptions { + /** + * The token (e.g. `ic_abc123`) of the issued card to display in this Element + */ + issuingCard: string; + + /** + * The secret component of the ephemeral key with which to authenticate this sensitive + * card details request + */ + ephemeralKeySecret?: string; + + /** + * The nonce used to mint the ephemeral key provided in `ephemeralKeySecret` + */ + nonce?: string; + + style?: StripeElementStyle; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-number-display.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-number-display.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..733b4b54b0579416db7b5b5f0a2ca82b195d8f45 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-number-display.d.mts @@ -0,0 +1,40 @@ +import {StripeElementBase, StripeElementStyle} from '../base'; + +export type StripeIssuingCardNumberDisplayElement = StripeElementBase & { + /** + * Updates the options the `IssuingCardNumberDisplayElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IssuingCardNumberDisplayElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIssuingCardNumberDisplayElementOptions>): void; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'issuingCardNumberDisplay'}) => any + ): StripeIssuingCardNumberDisplayElement; +}; + +export interface StripeIssuingCardNumberDisplayElementOptions { + /** + * The token (e.g. `ic_abc123`) of the issued card to display in this Element + */ + issuingCard: string; + + /** + * The secret component of the ephemeral key with which to authenticate this sensitive + * card details request + */ + ephemeralKeySecret?: string; + + /** + * The nonce used to mint the ephemeral key provided in `ephemeralKeySecret` + */ + nonce?: string; + + style?: StripeElementStyle; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-number-display.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-number-display.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..733b4b54b0579416db7b5b5f0a2ca82b195d8f45 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-number-display.d.ts @@ -0,0 +1,40 @@ +import {StripeElementBase, StripeElementStyle} from '../base'; + +export type StripeIssuingCardNumberDisplayElement = StripeElementBase & { + /** + * Updates the options the `IssuingCardNumberDisplayElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IssuingCardNumberDisplayElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIssuingCardNumberDisplayElementOptions>): void; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'issuingCardNumberDisplay'}) => any + ): StripeIssuingCardNumberDisplayElement; +}; + +export interface StripeIssuingCardNumberDisplayElementOptions { + /** + * The token (e.g. `ic_abc123`) of the issued card to display in this Element + */ + issuingCard: string; + + /** + * The secret component of the ephemeral key with which to authenticate this sensitive + * card details request + */ + ephemeralKeySecret?: string; + + /** + * The nonce used to mint the ephemeral key provided in `ephemeralKeySecret` + */ + nonce?: string; + + style?: StripeElementStyle; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-pin-display.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-pin-display.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..dd2b4761e660f2c4b457e2adb1f6d2cb1b73b718 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-pin-display.d.mts @@ -0,0 +1,32 @@ +import {StripeElementBase, StripeElementStyle} from '../base'; + +export type StripeIssuingCardPinDisplayElement = StripeElementBase & { + /** + * Updates the options the `IssuingCardPinDisplayElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IssuingCardPinDisplayElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIssuingCardPinDisplayElementOptions>): void; +}; + +export interface StripeIssuingCardPinDisplayElementOptions { + /** + * The token (e.g. `ic_abc123`) of the issued card to display in this Element + */ + issuingCard: string; + + /** + * The secret component of the ephemeral key with which to authenticate this sensitive + * card details request + */ + ephemeralKeySecret?: string; + + /** + * The nonce used to mint the ephemeral key provided in `ephemeralKeySecret` + */ + nonce?: string; + + style?: StripeElementStyle; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-pin-display.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-pin-display.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dd2b4761e660f2c4b457e2adb1f6d2cb1b73b718 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/issuing/issuing-card-pin-display.d.ts @@ -0,0 +1,32 @@ +import {StripeElementBase, StripeElementStyle} from '../base'; + +export type StripeIssuingCardPinDisplayElement = StripeElementBase & { + /** + * Updates the options the `IssuingCardPinDisplayElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `IssuingCardPinDisplayElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeIssuingCardPinDisplayElementOptions>): void; +}; + +export interface StripeIssuingCardPinDisplayElementOptions { + /** + * The token (e.g. `ic_abc123`) of the issued card to display in this Element + */ + issuingCard: string; + + /** + * The secret component of the ephemeral key with which to authenticate this sensitive + * card details request + */ + ephemeralKeySecret?: string; + + /** + * The nonce used to mint the ephemeral key provided in `ephemeralKeySecret` + */ + nonce?: string; + + style?: StripeElementStyle; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/link-authentication.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/link-authentication.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..605a0c20a71468e924d413e53e540a998531071c --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/link-authentication.d.mts @@ -0,0 +1,158 @@ +import {StripeElementBase} from './base'; +import {StripeError} from '../stripe'; + +export type StripeLinkAuthenticationElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeLinkAuthenticationElementChangeEvent) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'change', + handler: (event: StripeLinkAuthenticationElementChangeEvent) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'change', + handler?: (event: StripeLinkAuthenticationElementChangeEvent) => any + ): StripeLinkAuthenticationElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: { + elementType: 'linkAuthentication'; + error: StripeError; + }) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'loaderror', + handler: (event: { + elementType: 'linkAuthentication'; + error: StripeError; + }) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'loaderror', + handler?: (event: { + elementType: 'linkAuthentication'; + error: StripeError; + }) => any + ): StripeLinkAuthenticationElement; + + /** + * Triggered when the loader UI is mounted to the DOM and ready to be displayed. + */ + on( + eventType: 'loaderstart', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'loaderstart', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'loaderstart', + handler?: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; +}; + +export interface StripeLinkAuthenticationElementOptions { + /** + * Default value for LinkAuthenticationElement fields + */ + defaultValues?: { + email: string; + }; +} + +export interface StripeLinkAuthenticationElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'linkAuthentication'; + + /** + * Whether or not the LinkAuthentication Element is currently empty. + */ + empty: boolean; + + /** + * Whether or not the LinkAuthentication Element is complete. + */ + complete: boolean; + + /** + * An object containing the current email. + */ + value: { + email: string; + }; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/link-authentication.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/link-authentication.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..605a0c20a71468e924d413e53e540a998531071c --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/link-authentication.d.ts @@ -0,0 +1,158 @@ +import {StripeElementBase} from './base'; +import {StripeError} from '../stripe'; + +export type StripeLinkAuthenticationElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeLinkAuthenticationElementChangeEvent) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'change', + handler: (event: StripeLinkAuthenticationElementChangeEvent) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'change', + handler?: (event: StripeLinkAuthenticationElementChangeEvent) => any + ): StripeLinkAuthenticationElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: { + elementType: 'linkAuthentication'; + error: StripeError; + }) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'loaderror', + handler: (event: { + elementType: 'linkAuthentication'; + error: StripeError; + }) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'loaderror', + handler?: (event: { + elementType: 'linkAuthentication'; + error: StripeError; + }) => any + ): StripeLinkAuthenticationElement; + + /** + * Triggered when the loader UI is mounted to the DOM and ready to be displayed. + */ + on( + eventType: 'loaderstart', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + once( + eventType: 'loaderstart', + handler: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; + off( + eventType: 'loaderstart', + handler?: (event: {elementType: 'linkAuthentication'}) => any + ): StripeLinkAuthenticationElement; +}; + +export interface StripeLinkAuthenticationElementOptions { + /** + * Default value for LinkAuthenticationElement fields + */ + defaultValues?: { + email: string; + }; +} + +export interface StripeLinkAuthenticationElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'linkAuthentication'; + + /** + * Whether or not the LinkAuthentication Element is currently empty. + */ + empty: boolean; + + /** + * Whether or not the LinkAuthentication Element is complete. + */ + complete: boolean; + + /** + * An object containing the current email. + */ + value: { + email: string; + }; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/p24-bank.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/p24-bank.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..4e5b520a512e38c6b0a009b0d93a875edc6feb94 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/p24-bank.d.mts @@ -0,0 +1,140 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeP24BankElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeP24BankElementChangeEvent) => any + ): StripeP24BankElement; + once( + eventType: 'change', + handler: (event: StripeP24BankElementChangeEvent) => any + ): StripeP24BankElement; + off( + eventType: 'change', + handler: (event: StripeP24BankElementChangeEvent) => any + ): StripeP24BankElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + off( + eventType: 'ready', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + off( + eventType: 'focus', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + off( + eventType: 'blur', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + off( + eventType: 'escape', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + + /** + * Updates the options the `P24BankElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `P24BankElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeP24BankElementOptions>): void; +}; + +export interface StripeP24BankElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * A pre-filled value for the Element. + * Can be one of the banks listed in the [Przelewy24 guide](https://stripe.com/docs/payments/p24/accept-a-payment#bank-values) (e.g., `bank_austria`). + */ + value?: string; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeP24BankElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'p24Bank'; + + /** + * A pre-filled value for the Element. + * Can be one of the banks listed in the [Przelewy24 guide](https://stripe.com/docs/payments/p24/accept-a-payment#bank-values) (e.g., `ing`). + */ + value?: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/p24-bank.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/p24-bank.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e5b520a512e38c6b0a009b0d93a875edc6feb94 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/p24-bank.d.ts @@ -0,0 +1,140 @@ +import { + StripeElementBase, + StripeElementStyle, + StripeElementClasses, + StripeElementChangeEvent, +} from './base'; + +export type StripeP24BankElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeP24BankElementChangeEvent) => any + ): StripeP24BankElement; + once( + eventType: 'change', + handler: (event: StripeP24BankElementChangeEvent) => any + ): StripeP24BankElement; + off( + eventType: 'change', + handler: (event: StripeP24BankElementChangeEvent) => any + ): StripeP24BankElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + off( + eventType: 'ready', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + off( + eventType: 'focus', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + off( + eventType: 'blur', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + off( + eventType: 'escape', + handler: (event: {elementType: 'p24Bank'}) => any + ): StripeP24BankElement; + + /** + * Updates the options the `P24BankElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `P24BankElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update(options: Partial<StripeP24BankElementOptions>): void; +}; + +export interface StripeP24BankElementOptions { + classes?: StripeElementClasses; + + style?: StripeElementStyle; + + /** + * Appearance of the icon in the Element. + */ + iconStyle?: 'default' | 'solid'; + + /** + * A pre-filled value for the Element. + * Can be one of the banks listed in the [Przelewy24 guide](https://stripe.com/docs/payments/p24/accept-a-payment#bank-values) (e.g., `bank_austria`). + */ + value?: string; + + /** + * Hides the icon in the Element. + * Default is `false`. + */ + hideIcon?: boolean; + + /** + * Applies a disabled state to the Element such that user input is not accepted. + * Default is false. + */ + disabled?: boolean; +} + +export interface StripeP24BankElementChangeEvent + extends StripeElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'p24Bank'; + + /** + * A pre-filled value for the Element. + * Can be one of the banks listed in the [Przelewy24 guide](https://stripe.com/docs/payments/p24/accept-a-payment#bank-values) (e.g., `ing`). + */ + value?: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment-method-messaging.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment-method-messaging.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e68b25735417a6bf6523ea9fc8428b23d0708325 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment-method-messaging.d.mts @@ -0,0 +1,98 @@ +export type StripePaymentMethodMessagingElement = { + /** + * The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM. + * `element.mount` accepts either a CSS Selector (e.g., `'#payment-method-messaging'`) or a DOM element. + */ + mount(domElement: string | HTMLElement): void; + + /** + * Removes the element from the DOM and destroys it. + * A destroyed element can not be re-activated or re-mounted to the DOM. + */ + destroy(): void; + + /** + * Unmounts the element from the DOM. + * Call `element.mount` to re-attach it to the DOM. + */ + unmount(): void; + + /** + * Updates the options the `PaymentMethodMessagingElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update(options: Partial<StripePaymentMethodMessagingElementOptions>): void; + + /** + * Triggered when the element is fully loaded and ready to perform method calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'paymentMethodMessaging'}) => any + ): StripePaymentMethodMessagingElement; +}; + +export interface StripePaymentMethodMessagingElementOptions { + /** + * The total amount in the smallest currency unit. + */ + amount: number; + + /** + * The currency to display. + */ + currency: + | 'USD' + | 'GBP' + | 'EUR' + | 'DKK' + | 'NOK' + | 'SEK' + | 'AUD' + | 'CAD' + | 'NZD'; + + /** + * Payment methods to show messaging for. + */ + paymentMethodTypes: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>; + + /** + * @deprecated Use `paymentMethodTypes` instead. + */ + paymentMethods?: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>; + + /** + * The country the end-buyer is in. + */ + countryCode: + | 'US' + | 'CA' + | 'AU' + | 'NZ' + | 'GB' + | 'IE' + | 'FR' + | 'ES' + | 'DE' + | 'AT' + | 'BE' + | 'DK' + | 'FI' + | 'IT' + | 'NL' + | 'NO' + | 'SE'; + + /** + * The logo color to display in the message. Defaults to black + */ + logoColor?: 'black' | 'white' | 'color'; + + /** + * The font size of the promotional message. + */ + metaData?: { + messagingClientReferenceId: string | null; + }; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment-method-messaging.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment-method-messaging.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e68b25735417a6bf6523ea9fc8428b23d0708325 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment-method-messaging.d.ts @@ -0,0 +1,98 @@ +export type StripePaymentMethodMessagingElement = { + /** + * The `element.mount` method attaches your [Element](https://stripe.com/docs/js/element) to the DOM. + * `element.mount` accepts either a CSS Selector (e.g., `'#payment-method-messaging'`) or a DOM element. + */ + mount(domElement: string | HTMLElement): void; + + /** + * Removes the element from the DOM and destroys it. + * A destroyed element can not be re-activated or re-mounted to the DOM. + */ + destroy(): void; + + /** + * Unmounts the element from the DOM. + * Call `element.mount` to re-attach it to the DOM. + */ + unmount(): void; + + /** + * Updates the options the `PaymentMethodMessagingElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update(options: Partial<StripePaymentMethodMessagingElementOptions>): void; + + /** + * Triggered when the element is fully loaded and ready to perform method calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'paymentMethodMessaging'}) => any + ): StripePaymentMethodMessagingElement; +}; + +export interface StripePaymentMethodMessagingElementOptions { + /** + * The total amount in the smallest currency unit. + */ + amount: number; + + /** + * The currency to display. + */ + currency: + | 'USD' + | 'GBP' + | 'EUR' + | 'DKK' + | 'NOK' + | 'SEK' + | 'AUD' + | 'CAD' + | 'NZD'; + + /** + * Payment methods to show messaging for. + */ + paymentMethodTypes: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>; + + /** + * @deprecated Use `paymentMethodTypes` instead. + */ + paymentMethods?: Array<'afterpay_clearpay' | 'klarna' | 'affirm'>; + + /** + * The country the end-buyer is in. + */ + countryCode: + | 'US' + | 'CA' + | 'AU' + | 'NZ' + | 'GB' + | 'IE' + | 'FR' + | 'ES' + | 'DE' + | 'AT' + | 'BE' + | 'DK' + | 'FI' + | 'IT' + | 'NL' + | 'NO' + | 'SE'; + + /** + * The logo color to display in the message. Defaults to black + */ + logoColor?: 'black' | 'white' | 'color'; + + /** + * The font size of the promotional message. + */ + metaData?: { + messagingClientReferenceId: string | null; + }; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment-request-button.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment-request-button.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b430bf6d18bde3ecb8c4c3fc2191658bf110973c --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment-request-button.d.mts @@ -0,0 +1,151 @@ +import {StripeElementBase, StripeElementClasses} from './base'; +import {PaymentRequest} from '../payment-request'; +import {Omit} from '../../utils'; + +export type StripePaymentRequestButtonElement = StripeElementBase & { + /** + * Triggered when the payment request button is clicked. + */ + on( + eventType: 'click', + handler: (event: StripePaymentRequestButtonElementClickEvent) => any + ): StripePaymentRequestButtonElement; + once( + eventType: 'click', + handler: (event: StripePaymentRequestButtonElementClickEvent) => any + ): StripePaymentRequestButtonElement; + off( + eventType: 'click', + handler?: (event: StripePaymentRequestButtonElementClickEvent) => any + ): StripePaymentRequestButtonElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + + /** + * Updates the options the `PaymentRequestButtonElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `PaymentRequestButtonElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update( + options: Partial< + Omit<StripePaymentRequestButtonElementOptions, 'paymentRequest'> + > + ): void; +}; + +export interface StripePaymentRequestButtonElementOptions { + classes?: StripeElementClasses; + + /** + * An object used to customize the appearance of the Payment Request Button. + * The object must have a single `paymentRequestButton` field, containing any of the following sub-fields + */ + style?: { + paymentRequestButton: { + /** + * Preferred button type to display. Available types, by wallet: + * + * Browser card: default, book, buy, or donate. + * + * Google Pay: default, buy, or donate. + * + * Apple Pay: default, book, buy, donate, check-out, subscribe, reload, add-money, top-up, order, rent, support, contribute, tip + * + * When a wallet does not support the provided value, default is used as a fallback. + */ + type?: + | 'default' + | 'book' + | 'buy' + | 'donate' + | 'check-out' + | 'subscribe' + | 'reload' + | 'add-money' + | 'top-up' + | 'order' + | 'rent' + | 'support' + | 'contribute' + | 'tip'; + + /** + * One of dark, light, or light-outline. The default is dark. + */ + theme?: 'dark' | 'light' | 'light-outline'; + + /** + * The height of the Payment Request Button. Accepts px unit values. + */ + height?: string; + + /** + * The gap between buttons when multile buttons are shown. Accepts px unit values. + */ + buttonSpacing?: string; + }; + }; + + /** + * A `PaymentRequest` object used to configure the element. + */ + paymentRequest: PaymentRequest; + + /** + * Disable showing multiple buttons. + * Default is `false`. + */ + disableMultipleButtons?: boolean; +} + +export interface StripePaymentRequestButtonElementClickEvent { + preventDefault: () => void; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment-request-button.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment-request-button.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b430bf6d18bde3ecb8c4c3fc2191658bf110973c --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment-request-button.d.ts @@ -0,0 +1,151 @@ +import {StripeElementBase, StripeElementClasses} from './base'; +import {PaymentRequest} from '../payment-request'; +import {Omit} from '../../utils'; + +export type StripePaymentRequestButtonElement = StripeElementBase & { + /** + * Triggered when the payment request button is clicked. + */ + on( + eventType: 'click', + handler: (event: StripePaymentRequestButtonElementClickEvent) => any + ): StripePaymentRequestButtonElement; + once( + eventType: 'click', + handler: (event: StripePaymentRequestButtonElementClickEvent) => any + ): StripePaymentRequestButtonElement; + off( + eventType: 'click', + handler?: (event: StripePaymentRequestButtonElementClickEvent) => any + ): StripePaymentRequestButtonElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'paymentRequestButton'}) => any + ): StripePaymentRequestButtonElement; + + /** + * Updates the options the `PaymentRequestButtonElement` was initialized with. + * Updates are merged into the existing configuration. + * + * The styles of an `PaymentRequestButtonElement` can be dynamically changed using `element.update`. + * This method can be used to simulate CSS media queries that automatically adjust the size of elements when viewed on different devices. + */ + update( + options: Partial< + Omit<StripePaymentRequestButtonElementOptions, 'paymentRequest'> + > + ): void; +}; + +export interface StripePaymentRequestButtonElementOptions { + classes?: StripeElementClasses; + + /** + * An object used to customize the appearance of the Payment Request Button. + * The object must have a single `paymentRequestButton` field, containing any of the following sub-fields + */ + style?: { + paymentRequestButton: { + /** + * Preferred button type to display. Available types, by wallet: + * + * Browser card: default, book, buy, or donate. + * + * Google Pay: default, buy, or donate. + * + * Apple Pay: default, book, buy, donate, check-out, subscribe, reload, add-money, top-up, order, rent, support, contribute, tip + * + * When a wallet does not support the provided value, default is used as a fallback. + */ + type?: + | 'default' + | 'book' + | 'buy' + | 'donate' + | 'check-out' + | 'subscribe' + | 'reload' + | 'add-money' + | 'top-up' + | 'order' + | 'rent' + | 'support' + | 'contribute' + | 'tip'; + + /** + * One of dark, light, or light-outline. The default is dark. + */ + theme?: 'dark' | 'light' | 'light-outline'; + + /** + * The height of the Payment Request Button. Accepts px unit values. + */ + height?: string; + + /** + * The gap between buttons when multile buttons are shown. Accepts px unit values. + */ + buttonSpacing?: string; + }; + }; + + /** + * A `PaymentRequest` object used to configure the element. + */ + paymentRequest: PaymentRequest; + + /** + * Disable showing multiple buttons. + * Default is `false`. + */ + disableMultipleButtons?: boolean; +} + +export interface StripePaymentRequestButtonElementClickEvent { + preventDefault: () => void; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..612a4feef4be3b095837e3190dc9eafad9b41e3b --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment.d.mts @@ -0,0 +1,275 @@ +import {StripeElementBase} from './base'; +import {StripeError} from '../stripe'; +import {ApplePayOption} from './apple-pay'; + +export type StripePaymentElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripePaymentElementChangeEvent) => any + ): StripePaymentElement; + once( + eventType: 'change', + handler: (event: StripePaymentElementChangeEvent) => any + ): StripePaymentElement; + off( + eventType: 'change', + handler?: (event: StripePaymentElementChangeEvent) => any + ): StripePaymentElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: {elementType: 'payment'; error: StripeError}) => any + ): StripePaymentElement; + once( + eventType: 'loaderror', + handler: (event: {elementType: 'payment'; error: StripeError}) => any + ): StripePaymentElement; + off( + eventType: 'loaderror', + handler?: (event: {elementType: 'payment'; error: StripeError}) => any + ): StripePaymentElement; + + /** + * Triggered when the loader UI is mounted to the DOM and ready to be displayed. + */ + on( + eventType: 'loaderstart', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + once( + eventType: 'loaderstart', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + off( + eventType: 'loaderstart', + handler?: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + + /** + * Updates the options the `PaymentElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update(options: Partial<StripePaymentElementOptions>): StripePaymentElement; + + /** + * Collapses the Payment Element into a row of payment method tabs. + */ + collapse(): StripePaymentElement; +}; + +export interface DefaultValuesOption { + billingDetails?: { + name?: string; + email?: string; + phone?: string; + address?: { + country?: string; + postal_code?: string; + state?: string; + city?: string; + line1?: string; + line2?: string; + }; + }; +} + +export type FieldOption = 'auto' | 'never'; + +export interface FieldsOption { + billingDetails?: + | FieldOption + | { + name?: FieldOption; + email?: FieldOption; + phone?: FieldOption; + address?: + | FieldOption + | { + country?: FieldOption; + postalCode?: FieldOption; + state?: FieldOption; + city?: FieldOption; + line1?: FieldOption; + line2?: FieldOption; + }; + }; +} + +export type TermOption = 'auto' | 'always' | 'never'; + +export interface TermsOption { + applePay?: TermOption; + auBecsDebit?: TermOption; + bancontact?: TermOption; + card?: TermOption; + cashapp?: TermOption; + googlePay?: TermOption; + ideal?: TermOption; + paypal?: TermOption; + sepaDebit?: TermOption; + sofort?: TermOption; + usBankAccount?: TermOption; +} + +export type PaymentWalletOption = 'auto' | 'never'; + +export interface PaymentWalletsOption { + applePay?: PaymentWalletOption; + googlePay?: PaymentWalletOption; +} + +export type Layout = 'tabs' | 'accordion' | 'auto'; + +export interface LayoutObject { + type: Layout; + defaultCollapsed?: boolean; + radios?: boolean; + spacedAccordionItems?: boolean; +} + +export interface StripePaymentElementOptions { + /** + * Provide initial customer information that will be displayed in the Payment Element. + */ + defaultValues?: DefaultValuesOption; + + /** + * Override the business name displayed in the Payment Element. + * By default the PaymentElement will use your Stripe account or business name. + */ + business?: {name: string}; + + /** + * Override the order in which payment methods are displayed in the Payment Element. + * By default, the Payment Element will use a dynamic ordering that optimizes payment method display for each user. + */ + paymentMethodOrder?: string[]; + + /** + * Control which fields are displayed in the Payment Element. + */ + fields?: FieldsOption; + + /** + * Apply a read-only state to the Payment Element so that payment details can’t be changed. + * Default is false. + */ + readOnly?: boolean; + + /** + * Control terms display in the Payment Element. + */ + terms?: TermsOption; + + /** + * Control wallets display in the Payment Element. + */ + wallets?: PaymentWalletsOption; + + /** + * Specify a layout to use when rendering a Payment Element. + */ + layout?: Layout | LayoutObject; + + /** + * Specify the options to be used when the Apple Pay payment interface opens. + */ + applePay?: ApplePayOption; +} + +export interface StripePaymentElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'payment'; + + /** + * `true` if the all inputs in the Payment Element are empty. + */ + empty: boolean; + + /** + * `true` if the every input in the Payment Element is well-formed and potentially complete. + */ + complete: boolean; + + /** + * Whether or not the Payment Element is currently collapsed. + */ + collapsed: boolean; + + /** + * An object containing the currently selected PaymentMethod type (in snake_case, for example "afterpay_clearpay"). + */ + value: {type: string}; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..612a4feef4be3b095837e3190dc9eafad9b41e3b --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/payment.d.ts @@ -0,0 +1,275 @@ +import {StripeElementBase} from './base'; +import {StripeError} from '../stripe'; +import {ApplePayOption} from './apple-pay'; + +export type StripePaymentElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripePaymentElementChangeEvent) => any + ): StripePaymentElement; + once( + eventType: 'change', + handler: (event: StripePaymentElementChangeEvent) => any + ): StripePaymentElement; + off( + eventType: 'change', + handler?: (event: StripePaymentElementChangeEvent) => any + ): StripePaymentElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: {elementType: 'payment'; error: StripeError}) => any + ): StripePaymentElement; + once( + eventType: 'loaderror', + handler: (event: {elementType: 'payment'; error: StripeError}) => any + ): StripePaymentElement; + off( + eventType: 'loaderror', + handler?: (event: {elementType: 'payment'; error: StripeError}) => any + ): StripePaymentElement; + + /** + * Triggered when the loader UI is mounted to the DOM and ready to be displayed. + */ + on( + eventType: 'loaderstart', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + once( + eventType: 'loaderstart', + handler: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + off( + eventType: 'loaderstart', + handler?: (event: {elementType: 'payment'}) => any + ): StripePaymentElement; + + /** + * Updates the options the `PaymentElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update(options: Partial<StripePaymentElementOptions>): StripePaymentElement; + + /** + * Collapses the Payment Element into a row of payment method tabs. + */ + collapse(): StripePaymentElement; +}; + +export interface DefaultValuesOption { + billingDetails?: { + name?: string; + email?: string; + phone?: string; + address?: { + country?: string; + postal_code?: string; + state?: string; + city?: string; + line1?: string; + line2?: string; + }; + }; +} + +export type FieldOption = 'auto' | 'never'; + +export interface FieldsOption { + billingDetails?: + | FieldOption + | { + name?: FieldOption; + email?: FieldOption; + phone?: FieldOption; + address?: + | FieldOption + | { + country?: FieldOption; + postalCode?: FieldOption; + state?: FieldOption; + city?: FieldOption; + line1?: FieldOption; + line2?: FieldOption; + }; + }; +} + +export type TermOption = 'auto' | 'always' | 'never'; + +export interface TermsOption { + applePay?: TermOption; + auBecsDebit?: TermOption; + bancontact?: TermOption; + card?: TermOption; + cashapp?: TermOption; + googlePay?: TermOption; + ideal?: TermOption; + paypal?: TermOption; + sepaDebit?: TermOption; + sofort?: TermOption; + usBankAccount?: TermOption; +} + +export type PaymentWalletOption = 'auto' | 'never'; + +export interface PaymentWalletsOption { + applePay?: PaymentWalletOption; + googlePay?: PaymentWalletOption; +} + +export type Layout = 'tabs' | 'accordion' | 'auto'; + +export interface LayoutObject { + type: Layout; + defaultCollapsed?: boolean; + radios?: boolean; + spacedAccordionItems?: boolean; +} + +export interface StripePaymentElementOptions { + /** + * Provide initial customer information that will be displayed in the Payment Element. + */ + defaultValues?: DefaultValuesOption; + + /** + * Override the business name displayed in the Payment Element. + * By default the PaymentElement will use your Stripe account or business name. + */ + business?: {name: string}; + + /** + * Override the order in which payment methods are displayed in the Payment Element. + * By default, the Payment Element will use a dynamic ordering that optimizes payment method display for each user. + */ + paymentMethodOrder?: string[]; + + /** + * Control which fields are displayed in the Payment Element. + */ + fields?: FieldsOption; + + /** + * Apply a read-only state to the Payment Element so that payment details can’t be changed. + * Default is false. + */ + readOnly?: boolean; + + /** + * Control terms display in the Payment Element. + */ + terms?: TermsOption; + + /** + * Control wallets display in the Payment Element. + */ + wallets?: PaymentWalletsOption; + + /** + * Specify a layout to use when rendering a Payment Element. + */ + layout?: Layout | LayoutObject; + + /** + * Specify the options to be used when the Apple Pay payment interface opens. + */ + applePay?: ApplePayOption; +} + +export interface StripePaymentElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'payment'; + + /** + * `true` if the all inputs in the Payment Element are empty. + */ + empty: boolean; + + /** + * `true` if the every input in the Payment Element is well-formed and potentially complete. + */ + complete: boolean; + + /** + * Whether or not the Payment Element is currently collapsed. + */ + collapsed: boolean; + + /** + * An object containing the currently selected PaymentMethod type (in snake_case, for example "afterpay_clearpay"). + */ + value: {type: string}; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/shipping-address.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/shipping-address.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e8a2f74c04bfd503926098da03a91df5b7bac0fd --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/shipping-address.d.mts @@ -0,0 +1,215 @@ +import {StripeElementBase} from './base'; +import {StripeError} from '../stripe'; + +export type StripeShippingAddressElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeShippingAddressElementChangeEvent) => any + ): StripeShippingAddressElement; + once( + eventType: 'change', + handler: (event: StripeShippingAddressElementChangeEvent) => any + ): StripeShippingAddressElement; + off( + eventType: 'change', + handler?: (event: StripeShippingAddressElementChangeEvent) => any + ): StripeShippingAddressElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: { + elementType: 'shippingAddress'; + error: StripeError; + }) => any + ): StripeShippingAddressElement; + once( + eventType: 'loaderror', + handler: (event: { + elementType: 'shippingAddress'; + error: StripeError; + }) => any + ): StripeShippingAddressElement; + off( + eventType: 'loaderror', + handler?: (event: { + elementType: 'shippingAddress'; + error: StripeError; + }) => any + ): StripeShippingAddressElement; + + /** + * Triggered when the loader UI is mounted to the DOM and ready to be displayed. + */ + on( + eventType: 'loaderstart', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + once( + eventType: 'loaderstart', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + off( + eventType: 'loaderstart', + handler?: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + + /** + * Updates the options the `ShippingAddressElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update( + options: Partial<StripeShippingAddressElementOptions> + ): StripeShippingAddressElement; +}; + +export interface StripeShippingAddressElementOptions { + /** + * Control which countries are displayed in the shippingAddress Element. + */ + allowedCountries?: string[] | null; + + /** + * Whether or not ShippingAddressElement accepts PO boxes + */ + blockPoBox?: boolean; + + /** + * Default value for ShippingAddressElement fields + */ + defaultValues?: { + name?: string | null; + address?: { + line1?: string | null; + line2?: string | null; + city?: string | null; + state?: string | null; + postal_code?: string | null; + country: string; + }; + phone?: string | null; + }; + + /** + * Control which additional fields to display in the shippingAddress Element. + */ + fields?: { + phone?: 'always' | 'never' | 'auto'; + }; + + /** + * Specify validation rules for the above additional fields. + */ + validation?: { + phone?: { + required: 'always' | 'never' | 'auto'; + }; + }; +} + +export interface StripeShippingAddressElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'shippingAddress'; + + /** + * Whether or not the shippingAddress Element is currently empty. + */ + empty: boolean; + + /** + * Whether or not the shippingAddress Element is complete. + */ + complete: boolean; + + /** + * Whether or not the shipping address is new. + */ + isNewAddress: boolean; + + /** + * An object containing the current address. + */ + value: { + name: string; + address: { + line1: string; + line2: string | null; + city: string; + state: string; + postal_code: string; + country: string; + }; + phone?: string; + }; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/elements/shipping-address.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/shipping-address.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e8a2f74c04bfd503926098da03a91df5b7bac0fd --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/elements/shipping-address.d.ts @@ -0,0 +1,215 @@ +import {StripeElementBase} from './base'; +import {StripeError} from '../stripe'; + +export type StripeShippingAddressElement = StripeElementBase & { + /** + * The change event is triggered when the `Element`'s value changes. + */ + on( + eventType: 'change', + handler: (event: StripeShippingAddressElementChangeEvent) => any + ): StripeShippingAddressElement; + once( + eventType: 'change', + handler: (event: StripeShippingAddressElementChangeEvent) => any + ): StripeShippingAddressElement; + off( + eventType: 'change', + handler?: (event: StripeShippingAddressElementChangeEvent) => any + ): StripeShippingAddressElement; + + /** + * Triggered when the element is fully rendered and can accept `element.focus` calls. + */ + on( + eventType: 'ready', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + once( + eventType: 'ready', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + off( + eventType: 'ready', + handler?: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + + /** + * Triggered when the element gains focus. + */ + on( + eventType: 'focus', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + once( + eventType: 'focus', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + off( + eventType: 'focus', + handler?: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + + /** + * Triggered when the element loses focus. + */ + on( + eventType: 'blur', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + once( + eventType: 'blur', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + off( + eventType: 'blur', + handler?: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + + /** + * Triggered when the escape key is pressed within the element. + */ + on( + eventType: 'escape', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + once( + eventType: 'escape', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + off( + eventType: 'escape', + handler?: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + + /** + * Triggered when the element fails to load. + */ + on( + eventType: 'loaderror', + handler: (event: { + elementType: 'shippingAddress'; + error: StripeError; + }) => any + ): StripeShippingAddressElement; + once( + eventType: 'loaderror', + handler: (event: { + elementType: 'shippingAddress'; + error: StripeError; + }) => any + ): StripeShippingAddressElement; + off( + eventType: 'loaderror', + handler?: (event: { + elementType: 'shippingAddress'; + error: StripeError; + }) => any + ): StripeShippingAddressElement; + + /** + * Triggered when the loader UI is mounted to the DOM and ready to be displayed. + */ + on( + eventType: 'loaderstart', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + once( + eventType: 'loaderstart', + handler: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + off( + eventType: 'loaderstart', + handler?: (event: {elementType: 'shippingAddress'}) => any + ): StripeShippingAddressElement; + + /** + * Updates the options the `ShippingAddressElement` was initialized with. + * Updates are merged into the existing configuration. + */ + update( + options: Partial<StripeShippingAddressElementOptions> + ): StripeShippingAddressElement; +}; + +export interface StripeShippingAddressElementOptions { + /** + * Control which countries are displayed in the shippingAddress Element. + */ + allowedCountries?: string[] | null; + + /** + * Whether or not ShippingAddressElement accepts PO boxes + */ + blockPoBox?: boolean; + + /** + * Default value for ShippingAddressElement fields + */ + defaultValues?: { + name?: string | null; + address?: { + line1?: string | null; + line2?: string | null; + city?: string | null; + state?: string | null; + postal_code?: string | null; + country: string; + }; + phone?: string | null; + }; + + /** + * Control which additional fields to display in the shippingAddress Element. + */ + fields?: { + phone?: 'always' | 'never' | 'auto'; + }; + + /** + * Specify validation rules for the above additional fields. + */ + validation?: { + phone?: { + required: 'always' | 'never' | 'auto'; + }; + }; +} + +export interface StripeShippingAddressElementChangeEvent { + /** + * The type of element that emitted this event. + */ + elementType: 'shippingAddress'; + + /** + * Whether or not the shippingAddress Element is currently empty. + */ + empty: boolean; + + /** + * Whether or not the shippingAddress Element is complete. + */ + complete: boolean; + + /** + * Whether or not the shipping address is new. + */ + isNewAddress: boolean; + + /** + * An object containing the current address. + */ + value: { + name: string; + address: { + line1: string; + line2: string | null; + city: string; + state: string; + postal_code: string; + country: string; + }; + phone?: string; + }; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/embedded-checkout.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/embedded-checkout.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c1217d3e97218766030affe9c9801a2991fc2f0a --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/embedded-checkout.d.mts @@ -0,0 +1,35 @@ +export interface StripeEmbeddedCheckoutOptions { + /** + * The client secret of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions). + */ + clientSecret?: string; + /** + * A function that returns a Promise which resolves with the client secret of + * the [Checkout Session](https://stripe.com/docs/api/checkout/sessions). + */ + fetchClientSecret?: () => Promise<string>; + /** + * onComplete is called when the Checkout Session completes successfully. + * You can use it to unmount Embedded Checkout and render a custom success UI. + */ + onComplete?: () => void; +} + +export interface StripeEmbeddedCheckout { + /** + * The `embeddedCheckout.mount` method attaches your Embedded Checkout to the DOM. + * `mount` accepts either a CSS Selector (e.g., `'#checkout'`) or a DOM element. + */ + mount(location: string | HTMLElement): void; + /** + * Unmounts Embedded Checkout from the DOM. + * Call `embeddedCheckout.mount` to re-attach it to the DOM. + */ + unmount(): void; + /** + * Removes Embedded Checkout from the DOM and destroys it. + * Once destroyed it not be re-mounted to the DOM. + * Use this if you want to create a new Embedded Checkout instance. + */ + destroy(): void; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/embedded-checkout.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/embedded-checkout.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c1217d3e97218766030affe9c9801a2991fc2f0a --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/embedded-checkout.d.ts @@ -0,0 +1,35 @@ +export interface StripeEmbeddedCheckoutOptions { + /** + * The client secret of the [Checkout Session](https://stripe.com/docs/api/checkout/sessions). + */ + clientSecret?: string; + /** + * A function that returns a Promise which resolves with the client secret of + * the [Checkout Session](https://stripe.com/docs/api/checkout/sessions). + */ + fetchClientSecret?: () => Promise<string>; + /** + * onComplete is called when the Checkout Session completes successfully. + * You can use it to unmount Embedded Checkout and render a custom success UI. + */ + onComplete?: () => void; +} + +export interface StripeEmbeddedCheckout { + /** + * The `embeddedCheckout.mount` method attaches your Embedded Checkout to the DOM. + * `mount` accepts either a CSS Selector (e.g., `'#checkout'`) or a DOM element. + */ + mount(location: string | HTMLElement): void; + /** + * Unmounts Embedded Checkout from the DOM. + * Call `embeddedCheckout.mount` to re-attach it to the DOM. + */ + unmount(): void; + /** + * Removes Embedded Checkout from the DOM and destroys it. + * Once destroyed it not be re-mounted to the DOM. + * Use this if you want to create a new Embedded Checkout instance. + */ + destroy(): void; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/ephemeral-keys.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/ephemeral-keys.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b7ac9f645d70f48ee77d44182268ac9a634222ef --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/ephemeral-keys.d.mts @@ -0,0 +1,3 @@ +export interface EphemeralKeyNonceOptions { + issuingCard: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/ephemeral-keys.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/ephemeral-keys.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b7ac9f645d70f48ee77d44182268ac9a634222ef --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/ephemeral-keys.d.ts @@ -0,0 +1,3 @@ +export interface EphemeralKeyNonceOptions { + issuingCard: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/financial-connections.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/financial-connections.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e0c91ad3b86e6b5dff130880fcb3ded197b71413 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/financial-connections.d.mts @@ -0,0 +1,19 @@ +/** + * Data to be sent with a `stripe.collectFinancialConnectionsAccounts` request. + */ +export interface CollectFinancialConnectionsAccountsOptions { + /** + * The client secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session). + */ + clientSecret: string; +} + +/** + * Data to be sent with a `stripe.collectBankAccountToken` request. + */ +export interface CollectBankAccountTokenOptions { + /** + * The client secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session). + */ + clientSecret: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/financial-connections.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/financial-connections.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e0c91ad3b86e6b5dff130880fcb3ded197b71413 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/financial-connections.d.ts @@ -0,0 +1,19 @@ +/** + * Data to be sent with a `stripe.collectFinancialConnectionsAccounts` request. + */ +export interface CollectFinancialConnectionsAccountsOptions { + /** + * The client secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session). + */ + clientSecret: string; +} + +/** + * Data to be sent with a `stripe.collectBankAccountToken` request. + */ +export interface CollectBankAccountTokenOptions { + /** + * The client secret of the [Financial Connections Session](https://stripe.com/docs/api/financial_connections/session). + */ + clientSecret: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/index.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..a331322b36a4956bd9c2807867c11707c36ed4c4 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/index.d.mts @@ -0,0 +1,13 @@ +export * from './checkout'; +export * from './custom-checkout'; +export * from './embedded-checkout'; +export * from './elements'; +export * from './elements-group'; +export * from './ephemeral-keys'; +export * from './financial-connections'; +export * from './orders'; +export * from './payment-intents'; +export * from './payment-request'; +export * from './setup-intents'; +export * from './token-and-sources'; +export * from './stripe'; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/index.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a331322b36a4956bd9c2807867c11707c36ed4c4 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/index.d.ts @@ -0,0 +1,13 @@ +export * from './checkout'; +export * from './custom-checkout'; +export * from './embedded-checkout'; +export * from './elements'; +export * from './elements-group'; +export * from './ephemeral-keys'; +export * from './financial-connections'; +export * from './orders'; +export * from './payment-intents'; +export * from './payment-request'; +export * from './setup-intents'; +export * from './token-and-sources'; +export * from './stripe'; diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/orders.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/orders.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..40c520effc3c1b6ff85d7bc8d46b76fa191d85e1 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/orders.d.mts @@ -0,0 +1,9 @@ +/** + * Parameters that will be passed on to the Stripe API to confirm payment for an Order's PaymentIntent. + */ +export interface ProcessOrderParams { + /** + * The url your customer will be directed to after they complete payment. + */ + return_url: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/orders.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/orders.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..40c520effc3c1b6ff85d7bc8d46b76fa191d85e1 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/orders.d.ts @@ -0,0 +1,9 @@ +/** + * Parameters that will be passed on to the Stripe API to confirm payment for an Order's PaymentIntent. + */ +export interface ProcessOrderParams { + /** + * The url your customer will be directed to after they complete payment. + */ + return_url: string; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/payment-intents.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/payment-intents.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..b1737a9fb652d26fe9ff7ca9b3cb99be99118d10 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/payment-intents.d.mts @@ -0,0 +1,1473 @@ +import { + StripeIdealBankElement, + StripeIbanElement, + StripeP24BankElement, + StripeEpsBankElement, + StripeFpxBankElement, + StripeCardCvcElement, + StripeCardNumberElement, + StripeCardElement, + StripeAuBankAccountElement, +} from './elements'; +import {PaymentMethodCreateParams, PaymentIntentConfirmParams} from '../api'; +import {Omit} from '../utils'; + +export type CreatePaymentMethodData = + | CreatePaymentMethodAcssDebitData + | CreatePaymentMethodAffirmData + | CreatePaymentMethodAfterpayClearpayData + | CreatePaymentMethodAlipayData + | CreatePaymentMethodAuBecsDebitData + | CreatePaymentMethodBacsDebitData + | CreatePaymentMethodBancontactData + | CreatePaymentMethodBlikData + | CreatePaymentMethodBoletoData + | CreatePaymentMethodCardData + | CreatePaymentMethodCashappData + | CreatePaymentMethodCustomerBalanceData + | CreatePaymentMethodEpsData + | CreatePaymentMethodGiropayData + | CreatePaymentMethodGrabPayData + | CreatePaymentMethodIdealData + | CreatePaymentMethodKlarnaData + | CreatePaymentMethodKonbiniData + | CreatePaymentMethodP24Data + | CreatePaymentMethodPayPalData + | CreatePaymentMethodPayNowData + | CreatePaymentMethodPixData + | CreatePaymentMethodPromptPayData + | CreatePaymentMethodFpxData + | CreatePaymentMethodUsBankAccountData + | CreatePaymentMethodSepaDebitData + | CreatePaymentMethodSofortData + | CreatePaymentMethodWechatPayData; + +export { + CreatePaymentMethodFromElement, + CreatePaymentMethodFromElements, +} from '../api'; + +export interface CreatePaymentMethodAlipayData + extends PaymentMethodCreateParams { + type: 'alipay'; +} + +export interface CreatePaymentMethodWechatPayData + extends PaymentMethodCreateParams { + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + type: 'wechat_pay'; +} + +export interface CreatePaymentMethodAffirmData + extends PaymentMethodCreateParams { + type: 'affirm'; + + /** + * Can be omitted as there are no Affirm-specific fields. + */ + affirm?: {}; // eslint-disable-line @typescript-eslint/ban-types +} + +export interface CreatePaymentMethodAfterpayClearpayData + extends PaymentMethodCreateParams { + type: 'afterpay_clearpay'; + + /** + * Can be omitted as there are no AfterpayClearpay-specific fields. + */ + afterpay_clearpay?: {}; // eslint-disable-line @typescript-eslint/ban-types +} + +export interface CreatePaymentMethodBancontactData + extends PaymentMethodCreateParams { + type: 'bancontact'; + + /** + * The customer's billing details. + * `name` is required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + name: string; + }; +} + +export interface CreatePaymentMethodBlikData extends PaymentMethodCreateParams { + type: 'blik'; + + /** + * Details about the BLIK pament method. Currently there are no supported child attributes for this field. + */ + blik?: {}; // eslint-disable-line @typescript-eslint/ban-types +} + +export interface CreatePaymentMethodBoletoData + extends PaymentMethodCreateParams { + type: 'boleto'; + + /** + * The customer's billing details. + * `name`, `email`, and full `address` is required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + email: string; + name: string; + address: PaymentMethodCreateParams.BillingDetails.Address & { + line1: string; + city: string; + postal_code: string; + state: string; + country: string; + }; + }; + + boleto: { + tax_id: string; + }; +} + +export interface CreatePaymentMethodCardData extends PaymentMethodCreateParams { + type: 'card'; + + card: StripeCardElement | StripeCardNumberElement | {token: string}; +} + +export interface CreatePaymentMethodCashappData + extends PaymentMethodCreateParams { + type: 'cashapp'; +} + +export interface CreatePaymentMethodCustomerBalanceData + extends PaymentMethodCreateParams { + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + customer_balance: Record<string, never>; +} + +export interface CreatePaymentMethodEpsData extends PaymentMethodCreateParams { + type: 'eps'; + + /** + * The customer's billing details. + * `name` is required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + name: string; + }; + + eps: + | StripeEpsBankElement + | { + /** + * The customer's bank + */ + bank?: string; + }; +} + +export interface CreatePaymentMethodFpxData extends PaymentMethodCreateParams { + type: 'fpx'; + + fpx: + | StripeFpxBankElement + | { + /** + * The customer's bank. + */ + bank: string; + }; +} + +export interface CreatePaymentMethodGiropayData + extends PaymentMethodCreateParams { + type: 'giropay'; + + /** + * The customer's billing details. + * `name` is required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + name: string; + }; +} + +export interface CreatePaymentMethodGrabPayData + extends PaymentMethodCreateParams { + type: 'grabpay'; + + /** + * Can be omitted as there are no GrabPay-specific fields. + */ + grabpay?: {}; // eslint-disable-line @typescript-eslint/ban-types +} + +export interface CreatePaymentMethodIdealData + extends PaymentMethodCreateParams { + type: 'ideal'; + + ideal: + | StripeIdealBankElement + | { + /** + * The customer's bank. + */ + bank?: string; + }; +} + +export interface CreatePaymentMethodKlarnaData + extends PaymentMethodCreateParams { + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + type: 'klarna'; + + /** + * The customer's billing details. + * `address.country` is required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + address: PaymentMethodCreateParams.BillingDetails.Address & { + country: string; + }; + }; +} + +export interface CreatePaymentMethodKonbiniData + extends PaymentMethodCreateParams { + type: 'konbini'; + + /** + * The customer's billing details. + * `email` and `name` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + email: string; + name: string; + }; +} + +export interface CreatePaymentMethodOxxoData extends PaymentMethodCreateParams { + type: 'oxxo'; + + /** + * The customer's billing details. + * `email` and `name` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + email: string; + name: string; + }; +} + +export interface CreatePaymentMethodP24Data extends PaymentMethodCreateParams { + type: 'p24'; + + /** + * The customer's billing details. + * `email` is required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + email: string; + }; + p24?: + | StripeP24BankElement + | { + /** + * The customer's bank. + */ + bank?: string; + }; +} + +export interface CreatePaymentMethodPayNowData + extends PaymentMethodCreateParams { + type: 'paynow'; +} + +export interface CreatePaymentMethodPayPalData + extends PaymentMethodCreateParams { + type: 'paypal'; +} + +export interface CreatePaymentMethodPixData extends PaymentMethodCreateParams { + type: 'pix'; +} + +export interface CreatePaymentMethodPromptPayData + extends PaymentMethodCreateParams { + type: 'promptpay'; +} + +export interface CreatePaymentMethodSepaDebitData + extends PaymentMethodCreateParams { + type: 'sepa_debit'; + + sepa_debit: + | StripeIbanElement + | { + /** + * An IBAN account number. + */ + iban: string; + }; + + /** + * The customer's billing details. + * `name` and `email` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + name: string; + email: string; + }; +} + +export interface CreatePaymentMethodSofortData + extends PaymentMethodCreateParams { + type: 'sofort'; + + sofort: { + /** + * The country code where customer's bank is located. + */ + country: string; + }; + + /** + * The customer's billing details. + * Required when `setup_future_usage` is set to `off_session`. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details?: PaymentMethodCreateParams.BillingDetails; +} + +export interface CreatePaymentMethodAuBecsDebitData + extends PaymentMethodCreateParams { + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + type: 'au_becs_debit'; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + au_becs_debit: + | StripeAuBankAccountElement + | { + /** + * A BSB number. + */ + bsb_number: string; + + /** + * An account number. + */ + account_number: string; + }; + + /** + * The customer's billing details. + * `name` and `email` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + name: string; + email: string; + }; +} + +export interface CreatePaymentMethodBacsDebitData + extends PaymentMethodCreateParams { + type: 'bacs_debit'; + + bacs_debit: { + /** + * A sort code. + */ + sort_code: string; + + /** + * An account number. + */ + account_number: string; + }; + + /** + * The customer's billing details. + * `name`, `email`, and `address` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + name: string; + email: string; + address: PaymentMethodCreateParams.BillingDetails.Address & { + line1: string; + city: string; + country: string; + postal_code: string; + }; + }; +} +export interface CreatePaymentMethodAcssDebitData + extends PaymentMethodCreateParams { + type: 'acss_debit'; + + /** + * Can be omitted as Stripe will help to collect bank account details and verification. + * Refer to our [integration guide](https://stripe.com/docs/payments/acss-debit/accept-a-payment) for more details. + */ + acss_debit?: { + /** + * Customer’s bank account number. + */ + account_number: string; + + /** + * Institution number of the customer’s bank. + */ + institution_number: string; + + /** + * Transit number of the customer’s bank. + */ + transit_number: string; + }; + + /** + * The customer's billing details. + * `name`, `email`, and `address` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails; +} + +export interface CreatePaymentMethodUsBankAccountData + extends PaymentMethodCreateParams { + type: 'us_bank_account'; + + /** + * Can be omitted as Stripe will help to collect bank account details and verification. + * Refer to our [integration guide](https://stripe.com/docs/payments/acss-debit/accept-a-payment) for more details. + */ + us_bank_account: { + /** + * Customer’s bank account number. + */ + account_number: string; + + /** + * The routing transit number for the bank account. + */ + routing_number: string; + + /** + * The type of entity that holds the account. This can be either `individual` or `company`. + */ + account_holder_type: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type?: string; + }; + + /** + * The customer's billing details. + * `name`, `email`, and `address` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails; +} + +export interface CollectBankAccountParams { + /** + * The payment method type for the bank account details (e.g. `us_bank_account`) + */ + payment_method_type: string; + /** + * Payment method specific data to be sent with the request (billing details) + */ + payment_method_data: CollectBankAccountPaymentMethodData; +} + +export interface CollectBankAccountPaymentMethodData { + /** + * The customer's billing details. + * `name`, `email`, and `address` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails; +} + +/** + * Data to be sent with a `stripe.confirmBancontactPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmBancontactPaymentData + extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodBancontactData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * Data to be sent with a `stripe.ConfirmBlikPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmBlikPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodBlikData, 'type'>; + + /** + * An object containing payment-method-specific configuration to confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with. + */ + payment_method_options: { + /** + * A configuration for this BLIK payment. + */ + blik: { + /** + * Your customer's 6-digit BLIK code. + */ + code: string; + }; + }; +} + +/** + * Data to be sent with a `stripe.confirmBoletoPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmBoletoPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodBoletoData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmBoletoPayment`. + */ +export interface ConfirmBoletoPaymentOptions { + /** + * Set this to `false` if you want to handle next actions yourself. Please refer to our [Stripe Boleto integration guide](https://stripe.com/docs/payments/boleto) for more info. Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmAlipayPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAlipayPaymentData extends PaymentIntentConfirmParams { + /** + * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodAlipayData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmAlipayPayment`. + */ +export interface ConfirmAlipayPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/alipay/accept-a-payment#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * An options object to control the behavior of `stripe.confirmBancontactPayment`. + */ +export interface ConfirmBancontactPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/bancontact#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * An options object to control the behavior of `stripe.confirmBlikPayment`. + */ +export interface ConfirmBlikPaymentOptions { + /** + * Set this to false if you want to manually determine if the confirmation has succeeded or failed. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmCardPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmCardPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodCardData, 'type'>; + + /** + * An object containing payment-method-specific configuration to confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with. + */ + payment_method_options?: { + /** + * Configuration for this card payment. + */ + card: { + /** + * Use the provided `CardCvcElement` when confirming the PaymentIntent with an existing PaymentMethod. + */ + cvc?: StripeCardCvcElement; + + /** + * Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. + */ + network?: string; + }; + }; +} + +/** + * An options object to control the behavior of `stripe.confirmCardPayment`. + */ +export interface ConfirmCardPaymentOptions { + /** + * Set this to `false` if you want to [handle next actions yourself](https://stripe.com/docs/payments/payment-intents/verifying-status#next-actions), or if you want to defer next action handling until later (e.g. for use in the [PaymentRequest API](https://stripe.com/docs/stripe-js/elements/payment-request-button#complete-payment-intents)). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmCashappPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmCashappPaymentData extends PaymentIntentConfirmParams { + /** + * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodCashappData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmCashappPayment`. + */ +export interface ConfirmCashappPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization QR code or redirect](https://stripe.com/docs/payments/cash-app-pay/accept-a-payment?platform=web&ui=API#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmCustomerBalancePayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmCustomerBalancePaymentData + extends PaymentIntentConfirmParams { + /** + * An object specifying the `customer_balance` type. + */ + payment_method: CreatePaymentMethodCustomerBalanceData; + payment_method_options?: { + customer_balance?: { + funding_type?: 'bank_transfer'; + bank_transfer?: { + type: + | 'eu_bank_transfer' + | 'gb_bank_transfer' + | 'id_bank_transfer' + | 'jp_bank_transfer' + | 'mx_bank_transfer' + | 'us_bank_transfer'; + eu_bank_transfer?: { + country: 'DE' | 'ES' | 'FR' | 'IE' | 'NL'; + }; + id_bank_transfer?: { + bank: 'bni' | 'bca'; + }; + requested_address_types?: Array< + | 'aba' + | 'swift' + | 'sort_code' + | 'zengin' + | 'iban' + | 'spei' + | 'id_bban' + | 'sepa' + >; + }; + }; + }; +} + +/** + * An options object to control the behavior of `stripe.confirmCustomerBalancePayment`. + */ +export interface ConfirmCustomerBalancePaymentOptions { + /** + * This must be set to `false`. + * The Customer Balance does not handle the next actions for you automatically (e.g. displaying bank transfer details). + * To make future upgrades easier, this option is required to always be sent. + * Please refer to our [Stripe Customer Balance integration guide](https://stripe.com/docs/payments/bank-transfers) for more info. + */ + handleActions: false; +} + +/** + * Data to be sent with a `stripe.confirmEpsPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmEpsPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodEpsData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmEpsPayment`. + */ +export interface ConfirmEpsPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/eps#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmSepaDebitPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmSepaDebitPaymentData + extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodSepaDebitData, 'type'>; + + /** + * To save the SEPA Direct Debit account for reuse, set this parameter to `off_session`. + * SEPA Direct Debit only accepts an `off_session` value for this parameter. + */ + setup_future_usage?: 'off_session'; +} + +/** + * Data to be sent with a `stripe.confirmFpxPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmFpxPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodFpxData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmFpxPayment`. + */ +export interface ConfirmFpxPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/fpx#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmGiropayPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmGiropayPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodGiropayData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmGiropayPayment`. + */ +export interface ConfirmGiropayPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/giropay#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmGrabPayPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmGrabPayPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodGrabPayData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmGrabPayPayment`. + */ +export interface ConfirmGrabPayPaymentOptions { + /** + * Set this to `false` if you want to handle next actions yourself. Please refer to our [Stripe GrabPay integration guide](https://stripe.com/docs/payments/grabpay/accept-a-payment) + * for more info. Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmIdealPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmIdealPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodIdealData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmIdealPayment`. + */ +export interface ConfirmIdealPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/ideal#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmKlarnaPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmKlarnaPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodKlarnaData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmKlarnaPayment`. + */ +export interface ConfirmKlarnaPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/klarna#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmKonbiniPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmKonbiniPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodKonbiniData, 'type'>; + + /** + * An object containing payment-method-specific configuration to confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with. + */ + payment_method_options?: { + /** + * Configuration for this Konbini payment. + */ + konbini: { + /** + * An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. May not be all 0 and could be rejected in case of insufficient uniqueness. We recommend to use the customer’s phone number. + */ + confirmation_number?: string; + }; + }; +} + +/** + * An options object to control the behavior of `stripe.confirmKonbiniPayment`. + */ +export interface ConfirmKonbiniPaymentOptions { + /** + * Set this to `false` if you want to handle next actions yourself. Please refer to our [integration guide](https://stripe.com/docs/payments/konbini/accept-a-payment) for more info. Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmOxxoPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmOxxoPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodOxxoData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmOxxoPayment`. + */ +export interface ConfirmOxxoPaymentOptions { + /** + * Set this to `false` if you want to handle next actions yourself. Please refer to our [Stripe OXXO integration guide](https://stripe.com/docs/payments/oxxo) for more info. Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmP24Payment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmP24PaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodP24Data, 'type'>; + + payment_method_options?: { + /** + * Configuration for this Przelewy24 payment. + */ + p24: { + /** + * Specify that payer has agreed to the Przelewy24 Terms of Service + */ + tos_shown_and_accepted?: boolean; + }; + }; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * Data to be sent with a `stripe.confirmPayNowPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmPayNowPaymentData extends PaymentIntentConfirmParams { + /** + * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodPayNowData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmPayNowPayment`. + */ +export interface ConfirmPayNowPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/p24#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmPayPalPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmPayPalPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodPayPalData, 'type'>; + + /** + * The required url your customer will be directed to after they complete authentication. + */ + return_url: string; +} + +/** + * An options object to control the behavior of `stripe.confirmP24Payment`. + */ +export interface ConfirmP24PaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/p24#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmPixPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmPixPaymentData extends PaymentIntentConfirmParams { + /** + * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodPixData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmPayNowPayment`. + */ +export interface ConfirmPixPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/p24#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmPayNowPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmPromptPayPaymentData + extends PaymentIntentConfirmParams { + /** + * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodPromptPayData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmPayNowPayment`. + */ +export interface ConfirmPromptPayPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/p24#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmSofortPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmSofortPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodSofortData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; + + /** + * To set up a SEPA Direct Debit payment method using the bank details from this SOFORT payment, set this parameter to `off_session`. + * When using this parameter, a `customer` will need to be set on the [PaymentIntent](https://stripe.com/docs/api/payment_intents). + * The newly created SEPA Direct Debit [PaymentMethod](https://stripe.com/docs/api/payment_methods) will be attached to this customer. + */ + setup_future_usage?: 'off_session'; +} + +/** + * An options object to control the behavior of `stripe.confirmSofortPayment`. + */ +export interface ConfirmSofortPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/sofort/accept-a-payment?platform=web#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmWechatPayPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmWechatPayPaymentData + extends PaymentIntentConfirmParams { + /** + * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodWechatPayData, 'type'>; + + /** + * An object containing payment-method-specific configuration to confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with. + */ + payment_method_options?: { + /** + * Configuration for this wechat payment. + */ + wechat_pay: { + client?: 'web'; + }; + }; +} + +/** + * An options object to control the behavior of `stripe.confirmWechatPayPayment`. + */ +export interface ConfirmWechatPayPaymentOptions { + /** + * This must be set to false, and you are responsible for handling the next_action after confirming the PaymentIntent. + */ + handleActions: boolean; +} + +/** + * Data to be sent with a `stripe.confirmAuBecsDebitPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAuBecsDebitPaymentData + extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodAuBecsDebitData, 'type'>; + + /** + * To save the BECS Direct Debit account for reuse, set this parameter to `off_session`. + * BECS Direct Debit only accepts an `off_session` value for this parameter. + */ + setup_future_usage?: 'off_session'; +} + +/** + * Data to be sent with a `stripe.confirmAffirmPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAffirmPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodAffirmData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmAffirmPayment`. + */ +export interface ConfirmAffirmPaymentOptions { + /** + * Set this to `false` if you want to handle next actions yourself. Please refer to our [Stripe Affirm integration guide](https://stripe.com/docs/payments/affirm/accept-a-payment) + * for more info. Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmAfterpayClearpayPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAfterpayClearpayPaymentData + extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: + | string + | Omit<CreatePaymentMethodAfterpayClearpayData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmAfterpayClearpayPayment`. + */ +export interface ConfirmAfterpayClearpayPaymentOptions { + /** + * Set this to `false` if you want to handle next actions yourself. Please refer to our [Stripe Afterpay / Clearpay integration guide](https://stripe.com/docs/payments/afterpay-clearpay/accept-a-payment#handle-redirect) + * for more info. Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmAcssDebitPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAcssDebitPaymentData + extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodAcssDebitData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmAcssDebitPayment`. + */ +export interface ConfirmAcssDebitPaymentOptions { + /** + * Set `skipMandate` to `true` if you want to skip displaying the mandate confirmation screen. + */ + skipMandate?: boolean; +} + +export interface ConfirmUsBankAccountPaymentData + extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodUsBankAccountData, 'type'>; +} + +/** + * Data to be sent with a `stripe.confirmPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmPaymentData extends PaymentIntentConfirmParams { + /** + * The url your customer will be directed to after they complete payment. + */ + return_url: string; + + /** + * An object to attach additional billing_details to the PaymentMethod created via Elements. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_data + */ + payment_method_data?: { + /** + * The customer's billing details. Details collected by Elements will override values passed here. + * Billing fields that are omitted in the Payment Element via the `fields` option required. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_data-billing_details + */ + billing_details?: PaymentMethodCreateParams.BillingDetails; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Specifies if the PaymentMethod should be redisplayed when using the Saved Payment Method feature + */ + allow_redisplay?: 'always' | 'limited' | 'unspecified'; + }; + + /** + * Optional `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method + */ + payment_method?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array<string>; +} + +/** + * Data to be sent with a `stripe.verifyMicrodepositsForPayment` request. + */ +export interface VerifyMicrodepositsForPaymentData { + /** + * An array of two positive integers, in cents, equal to the values of the microdeposits sent to the bank account. + */ + amounts?: Array<number>; +} + +/** + * Data to be sent with a `stripe.collectBankAccountForPayment` request. + */ +export interface CollectBankAccountForPaymentOptions { + /** + * The client secret of the PaymentIntent. + */ + clientSecret: string; + + params: CollectBankAccountParams; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array<string>; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/payment-intents.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/payment-intents.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b1737a9fb652d26fe9ff7ca9b3cb99be99118d10 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/payment-intents.d.ts @@ -0,0 +1,1473 @@ +import { + StripeIdealBankElement, + StripeIbanElement, + StripeP24BankElement, + StripeEpsBankElement, + StripeFpxBankElement, + StripeCardCvcElement, + StripeCardNumberElement, + StripeCardElement, + StripeAuBankAccountElement, +} from './elements'; +import {PaymentMethodCreateParams, PaymentIntentConfirmParams} from '../api'; +import {Omit} from '../utils'; + +export type CreatePaymentMethodData = + | CreatePaymentMethodAcssDebitData + | CreatePaymentMethodAffirmData + | CreatePaymentMethodAfterpayClearpayData + | CreatePaymentMethodAlipayData + | CreatePaymentMethodAuBecsDebitData + | CreatePaymentMethodBacsDebitData + | CreatePaymentMethodBancontactData + | CreatePaymentMethodBlikData + | CreatePaymentMethodBoletoData + | CreatePaymentMethodCardData + | CreatePaymentMethodCashappData + | CreatePaymentMethodCustomerBalanceData + | CreatePaymentMethodEpsData + | CreatePaymentMethodGiropayData + | CreatePaymentMethodGrabPayData + | CreatePaymentMethodIdealData + | CreatePaymentMethodKlarnaData + | CreatePaymentMethodKonbiniData + | CreatePaymentMethodP24Data + | CreatePaymentMethodPayPalData + | CreatePaymentMethodPayNowData + | CreatePaymentMethodPixData + | CreatePaymentMethodPromptPayData + | CreatePaymentMethodFpxData + | CreatePaymentMethodUsBankAccountData + | CreatePaymentMethodSepaDebitData + | CreatePaymentMethodSofortData + | CreatePaymentMethodWechatPayData; + +export { + CreatePaymentMethodFromElement, + CreatePaymentMethodFromElements, +} from '../api'; + +export interface CreatePaymentMethodAlipayData + extends PaymentMethodCreateParams { + type: 'alipay'; +} + +export interface CreatePaymentMethodWechatPayData + extends PaymentMethodCreateParams { + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + type: 'wechat_pay'; +} + +export interface CreatePaymentMethodAffirmData + extends PaymentMethodCreateParams { + type: 'affirm'; + + /** + * Can be omitted as there are no Affirm-specific fields. + */ + affirm?: {}; // eslint-disable-line @typescript-eslint/ban-types +} + +export interface CreatePaymentMethodAfterpayClearpayData + extends PaymentMethodCreateParams { + type: 'afterpay_clearpay'; + + /** + * Can be omitted as there are no AfterpayClearpay-specific fields. + */ + afterpay_clearpay?: {}; // eslint-disable-line @typescript-eslint/ban-types +} + +export interface CreatePaymentMethodBancontactData + extends PaymentMethodCreateParams { + type: 'bancontact'; + + /** + * The customer's billing details. + * `name` is required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + name: string; + }; +} + +export interface CreatePaymentMethodBlikData extends PaymentMethodCreateParams { + type: 'blik'; + + /** + * Details about the BLIK pament method. Currently there are no supported child attributes for this field. + */ + blik?: {}; // eslint-disable-line @typescript-eslint/ban-types +} + +export interface CreatePaymentMethodBoletoData + extends PaymentMethodCreateParams { + type: 'boleto'; + + /** + * The customer's billing details. + * `name`, `email`, and full `address` is required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + email: string; + name: string; + address: PaymentMethodCreateParams.BillingDetails.Address & { + line1: string; + city: string; + postal_code: string; + state: string; + country: string; + }; + }; + + boleto: { + tax_id: string; + }; +} + +export interface CreatePaymentMethodCardData extends PaymentMethodCreateParams { + type: 'card'; + + card: StripeCardElement | StripeCardNumberElement | {token: string}; +} + +export interface CreatePaymentMethodCashappData + extends PaymentMethodCreateParams { + type: 'cashapp'; +} + +export interface CreatePaymentMethodCustomerBalanceData + extends PaymentMethodCreateParams { + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + customer_balance: Record<string, never>; +} + +export interface CreatePaymentMethodEpsData extends PaymentMethodCreateParams { + type: 'eps'; + + /** + * The customer's billing details. + * `name` is required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + name: string; + }; + + eps: + | StripeEpsBankElement + | { + /** + * The customer's bank + */ + bank?: string; + }; +} + +export interface CreatePaymentMethodFpxData extends PaymentMethodCreateParams { + type: 'fpx'; + + fpx: + | StripeFpxBankElement + | { + /** + * The customer's bank. + */ + bank: string; + }; +} + +export interface CreatePaymentMethodGiropayData + extends PaymentMethodCreateParams { + type: 'giropay'; + + /** + * The customer's billing details. + * `name` is required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + name: string; + }; +} + +export interface CreatePaymentMethodGrabPayData + extends PaymentMethodCreateParams { + type: 'grabpay'; + + /** + * Can be omitted as there are no GrabPay-specific fields. + */ + grabpay?: {}; // eslint-disable-line @typescript-eslint/ban-types +} + +export interface CreatePaymentMethodIdealData + extends PaymentMethodCreateParams { + type: 'ideal'; + + ideal: + | StripeIdealBankElement + | { + /** + * The customer's bank. + */ + bank?: string; + }; +} + +export interface CreatePaymentMethodKlarnaData + extends PaymentMethodCreateParams { + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + type: 'klarna'; + + /** + * The customer's billing details. + * `address.country` is required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + address: PaymentMethodCreateParams.BillingDetails.Address & { + country: string; + }; + }; +} + +export interface CreatePaymentMethodKonbiniData + extends PaymentMethodCreateParams { + type: 'konbini'; + + /** + * The customer's billing details. + * `email` and `name` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + email: string; + name: string; + }; +} + +export interface CreatePaymentMethodOxxoData extends PaymentMethodCreateParams { + type: 'oxxo'; + + /** + * The customer's billing details. + * `email` and `name` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + email: string; + name: string; + }; +} + +export interface CreatePaymentMethodP24Data extends PaymentMethodCreateParams { + type: 'p24'; + + /** + * The customer's billing details. + * `email` is required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + email: string; + }; + p24?: + | StripeP24BankElement + | { + /** + * The customer's bank. + */ + bank?: string; + }; +} + +export interface CreatePaymentMethodPayNowData + extends PaymentMethodCreateParams { + type: 'paynow'; +} + +export interface CreatePaymentMethodPayPalData + extends PaymentMethodCreateParams { + type: 'paypal'; +} + +export interface CreatePaymentMethodPixData extends PaymentMethodCreateParams { + type: 'pix'; +} + +export interface CreatePaymentMethodPromptPayData + extends PaymentMethodCreateParams { + type: 'promptpay'; +} + +export interface CreatePaymentMethodSepaDebitData + extends PaymentMethodCreateParams { + type: 'sepa_debit'; + + sepa_debit: + | StripeIbanElement + | { + /** + * An IBAN account number. + */ + iban: string; + }; + + /** + * The customer's billing details. + * `name` and `email` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + name: string; + email: string; + }; +} + +export interface CreatePaymentMethodSofortData + extends PaymentMethodCreateParams { + type: 'sofort'; + + sofort: { + /** + * The country code where customer's bank is located. + */ + country: string; + }; + + /** + * The customer's billing details. + * Required when `setup_future_usage` is set to `off_session`. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details?: PaymentMethodCreateParams.BillingDetails; +} + +export interface CreatePaymentMethodAuBecsDebitData + extends PaymentMethodCreateParams { + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + type: 'au_becs_debit'; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + au_becs_debit: + | StripeAuBankAccountElement + | { + /** + * A BSB number. + */ + bsb_number: string; + + /** + * An account number. + */ + account_number: string; + }; + + /** + * The customer's billing details. + * `name` and `email` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + name: string; + email: string; + }; +} + +export interface CreatePaymentMethodBacsDebitData + extends PaymentMethodCreateParams { + type: 'bacs_debit'; + + bacs_debit: { + /** + * A sort code. + */ + sort_code: string; + + /** + * An account number. + */ + account_number: string; + }; + + /** + * The customer's billing details. + * `name`, `email`, and `address` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails & { + name: string; + email: string; + address: PaymentMethodCreateParams.BillingDetails.Address & { + line1: string; + city: string; + country: string; + postal_code: string; + }; + }; +} +export interface CreatePaymentMethodAcssDebitData + extends PaymentMethodCreateParams { + type: 'acss_debit'; + + /** + * Can be omitted as Stripe will help to collect bank account details and verification. + * Refer to our [integration guide](https://stripe.com/docs/payments/acss-debit/accept-a-payment) for more details. + */ + acss_debit?: { + /** + * Customer’s bank account number. + */ + account_number: string; + + /** + * Institution number of the customer’s bank. + */ + institution_number: string; + + /** + * Transit number of the customer’s bank. + */ + transit_number: string; + }; + + /** + * The customer's billing details. + * `name`, `email`, and `address` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails; +} + +export interface CreatePaymentMethodUsBankAccountData + extends PaymentMethodCreateParams { + type: 'us_bank_account'; + + /** + * Can be omitted as Stripe will help to collect bank account details and verification. + * Refer to our [integration guide](https://stripe.com/docs/payments/acss-debit/accept-a-payment) for more details. + */ + us_bank_account: { + /** + * Customer’s bank account number. + */ + account_number: string; + + /** + * The routing transit number for the bank account. + */ + routing_number: string; + + /** + * The type of entity that holds the account. This can be either `individual` or `company`. + */ + account_holder_type: string; + + /** + * Account type: checkings or savings. Defaults to checking if omitted. + */ + account_type?: string; + }; + + /** + * The customer's billing details. + * `name`, `email`, and `address` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails; +} + +export interface CollectBankAccountParams { + /** + * The payment method type for the bank account details (e.g. `us_bank_account`) + */ + payment_method_type: string; + /** + * Payment method specific data to be sent with the request (billing details) + */ + payment_method_data: CollectBankAccountPaymentMethodData; +} + +export interface CollectBankAccountPaymentMethodData { + /** + * The customer's billing details. + * `name`, `email`, and `address` are required. + * + * @docs https://stripe.com/docs/api/payment_methods/create#create_payment_method-billing_details + */ + billing_details: PaymentMethodCreateParams.BillingDetails; +} + +/** + * Data to be sent with a `stripe.confirmBancontactPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmBancontactPaymentData + extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodBancontactData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * Data to be sent with a `stripe.ConfirmBlikPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmBlikPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodBlikData, 'type'>; + + /** + * An object containing payment-method-specific configuration to confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with. + */ + payment_method_options: { + /** + * A configuration for this BLIK payment. + */ + blik: { + /** + * Your customer's 6-digit BLIK code. + */ + code: string; + }; + }; +} + +/** + * Data to be sent with a `stripe.confirmBoletoPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmBoletoPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodBoletoData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmBoletoPayment`. + */ +export interface ConfirmBoletoPaymentOptions { + /** + * Set this to `false` if you want to handle next actions yourself. Please refer to our [Stripe Boleto integration guide](https://stripe.com/docs/payments/boleto) for more info. Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmAlipayPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAlipayPaymentData extends PaymentIntentConfirmParams { + /** + * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodAlipayData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmAlipayPayment`. + */ +export interface ConfirmAlipayPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/alipay/accept-a-payment#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * An options object to control the behavior of `stripe.confirmBancontactPayment`. + */ +export interface ConfirmBancontactPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/bancontact#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * An options object to control the behavior of `stripe.confirmBlikPayment`. + */ +export interface ConfirmBlikPaymentOptions { + /** + * Set this to false if you want to manually determine if the confirmation has succeeded or failed. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmCardPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmCardPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodCardData, 'type'>; + + /** + * An object containing payment-method-specific configuration to confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with. + */ + payment_method_options?: { + /** + * Configuration for this card payment. + */ + card: { + /** + * Use the provided `CardCvcElement` when confirming the PaymentIntent with an existing PaymentMethod. + */ + cvc?: StripeCardCvcElement; + + /** + * Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. + */ + network?: string; + }; + }; +} + +/** + * An options object to control the behavior of `stripe.confirmCardPayment`. + */ +export interface ConfirmCardPaymentOptions { + /** + * Set this to `false` if you want to [handle next actions yourself](https://stripe.com/docs/payments/payment-intents/verifying-status#next-actions), or if you want to defer next action handling until later (e.g. for use in the [PaymentRequest API](https://stripe.com/docs/stripe-js/elements/payment-request-button#complete-payment-intents)). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmCashappPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmCashappPaymentData extends PaymentIntentConfirmParams { + /** + * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodCashappData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmCashappPayment`. + */ +export interface ConfirmCashappPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization QR code or redirect](https://stripe.com/docs/payments/cash-app-pay/accept-a-payment?platform=web&ui=API#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmCustomerBalancePayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmCustomerBalancePaymentData + extends PaymentIntentConfirmParams { + /** + * An object specifying the `customer_balance` type. + */ + payment_method: CreatePaymentMethodCustomerBalanceData; + payment_method_options?: { + customer_balance?: { + funding_type?: 'bank_transfer'; + bank_transfer?: { + type: + | 'eu_bank_transfer' + | 'gb_bank_transfer' + | 'id_bank_transfer' + | 'jp_bank_transfer' + | 'mx_bank_transfer' + | 'us_bank_transfer'; + eu_bank_transfer?: { + country: 'DE' | 'ES' | 'FR' | 'IE' | 'NL'; + }; + id_bank_transfer?: { + bank: 'bni' | 'bca'; + }; + requested_address_types?: Array< + | 'aba' + | 'swift' + | 'sort_code' + | 'zengin' + | 'iban' + | 'spei' + | 'id_bban' + | 'sepa' + >; + }; + }; + }; +} + +/** + * An options object to control the behavior of `stripe.confirmCustomerBalancePayment`. + */ +export interface ConfirmCustomerBalancePaymentOptions { + /** + * This must be set to `false`. + * The Customer Balance does not handle the next actions for you automatically (e.g. displaying bank transfer details). + * To make future upgrades easier, this option is required to always be sent. + * Please refer to our [Stripe Customer Balance integration guide](https://stripe.com/docs/payments/bank-transfers) for more info. + */ + handleActions: false; +} + +/** + * Data to be sent with a `stripe.confirmEpsPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmEpsPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodEpsData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmEpsPayment`. + */ +export interface ConfirmEpsPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/eps#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmSepaDebitPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmSepaDebitPaymentData + extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodSepaDebitData, 'type'>; + + /** + * To save the SEPA Direct Debit account for reuse, set this parameter to `off_session`. + * SEPA Direct Debit only accepts an `off_session` value for this parameter. + */ + setup_future_usage?: 'off_session'; +} + +/** + * Data to be sent with a `stripe.confirmFpxPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmFpxPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodFpxData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmFpxPayment`. + */ +export interface ConfirmFpxPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/fpx#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmGiropayPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmGiropayPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodGiropayData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmGiropayPayment`. + */ +export interface ConfirmGiropayPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/giropay#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmGrabPayPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmGrabPayPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodGrabPayData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmGrabPayPayment`. + */ +export interface ConfirmGrabPayPaymentOptions { + /** + * Set this to `false` if you want to handle next actions yourself. Please refer to our [Stripe GrabPay integration guide](https://stripe.com/docs/payments/grabpay/accept-a-payment) + * for more info. Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmIdealPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmIdealPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodIdealData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmIdealPayment`. + */ +export interface ConfirmIdealPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/ideal#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmKlarnaPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmKlarnaPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodKlarnaData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmKlarnaPayment`. + */ +export interface ConfirmKlarnaPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/klarna#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmKonbiniPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmKonbiniPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodKonbiniData, 'type'>; + + /** + * An object containing payment-method-specific configuration to confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with. + */ + payment_method_options?: { + /** + * Configuration for this Konbini payment. + */ + konbini: { + /** + * An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. May not be all 0 and could be rejected in case of insufficient uniqueness. We recommend to use the customer’s phone number. + */ + confirmation_number?: string; + }; + }; +} + +/** + * An options object to control the behavior of `stripe.confirmKonbiniPayment`. + */ +export interface ConfirmKonbiniPaymentOptions { + /** + * Set this to `false` if you want to handle next actions yourself. Please refer to our [integration guide](https://stripe.com/docs/payments/konbini/accept-a-payment) for more info. Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmOxxoPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmOxxoPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodOxxoData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmOxxoPayment`. + */ +export interface ConfirmOxxoPaymentOptions { + /** + * Set this to `false` if you want to handle next actions yourself. Please refer to our [Stripe OXXO integration guide](https://stripe.com/docs/payments/oxxo) for more info. Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmP24Payment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmP24PaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodP24Data, 'type'>; + + payment_method_options?: { + /** + * Configuration for this Przelewy24 payment. + */ + p24: { + /** + * Specify that payer has agreed to the Przelewy24 Terms of Service + */ + tos_shown_and_accepted?: boolean; + }; + }; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; +} + +/** + * Data to be sent with a `stripe.confirmPayNowPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmPayNowPaymentData extends PaymentIntentConfirmParams { + /** + * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodPayNowData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmPayNowPayment`. + */ +export interface ConfirmPayNowPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/p24#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmPayPalPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmPayPalPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodPayPalData, 'type'>; + + /** + * The required url your customer will be directed to after they complete authentication. + */ + return_url: string; +} + +/** + * An options object to control the behavior of `stripe.confirmP24Payment`. + */ +export interface ConfirmP24PaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/p24#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmPixPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmPixPaymentData extends PaymentIntentConfirmParams { + /** + * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodPixData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmPayNowPayment`. + */ +export interface ConfirmPixPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/p24#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmPayNowPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmPromptPayPaymentData + extends PaymentIntentConfirmParams { + /** + * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodPromptPayData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmPayNowPayment`. + */ +export interface ConfirmPromptPayPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/p24#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmSofortPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmSofortPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodSofortData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + * + * @recommended + */ + return_url?: string; + + /** + * To set up a SEPA Direct Debit payment method using the bank details from this SOFORT payment, set this parameter to `off_session`. + * When using this parameter, a `customer` will need to be set on the [PaymentIntent](https://stripe.com/docs/api/payment_intents). + * The newly created SEPA Direct Debit [PaymentMethod](https://stripe.com/docs/api/payment_methods) will be attached to this customer. + */ + setup_future_usage?: 'off_session'; +} + +/** + * An options object to control the behavior of `stripe.confirmSofortPayment`. + */ +export interface ConfirmSofortPaymentOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/sofort/accept-a-payment?platform=web#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmWechatPayPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmWechatPayPaymentData + extends PaymentIntentConfirmParams { + /** + * The `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent` or a new `PaymentMethod` will be created. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodWechatPayData, 'type'>; + + /** + * An object containing payment-method-specific configuration to confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with. + */ + payment_method_options?: { + /** + * Configuration for this wechat payment. + */ + wechat_pay: { + client?: 'web'; + }; + }; +} + +/** + * An options object to control the behavior of `stripe.confirmWechatPayPayment`. + */ +export interface ConfirmWechatPayPaymentOptions { + /** + * This must be set to false, and you are responsible for handling the next_action after confirming the PaymentIntent. + */ + handleActions: boolean; +} + +/** + * Data to be sent with a `stripe.confirmAuBecsDebitPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAuBecsDebitPaymentData + extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodAuBecsDebitData, 'type'>; + + /** + * To save the BECS Direct Debit account for reuse, set this parameter to `off_session`. + * BECS Direct Debit only accepts an `off_session` value for this parameter. + */ + setup_future_usage?: 'off_session'; +} + +/** + * Data to be sent with a `stripe.confirmAffirmPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAffirmPaymentData extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodAffirmData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmAffirmPayment`. + */ +export interface ConfirmAffirmPaymentOptions { + /** + * Set this to `false` if you want to handle next actions yourself. Please refer to our [Stripe Affirm integration guide](https://stripe.com/docs/payments/affirm/accept-a-payment) + * for more info. Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmAfterpayClearpayPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAfterpayClearpayPaymentData + extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: + | string + | Omit<CreatePaymentMethodAfterpayClearpayData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmAfterpayClearpayPayment`. + */ +export interface ConfirmAfterpayClearpayPaymentOptions { + /** + * Set this to `false` if you want to handle next actions yourself. Please refer to our [Stripe Afterpay / Clearpay integration guide](https://stripe.com/docs/payments/afterpay-clearpay/accept-a-payment#handle-redirect) + * for more info. Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmAcssDebitPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAcssDebitPaymentData + extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodAcssDebitData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmAcssDebitPayment`. + */ +export interface ConfirmAcssDebitPaymentOptions { + /** + * Set `skipMandate` to `true` if you want to skip displaying the mandate confirmation screen. + */ + skipMandate?: boolean; +} + +export interface ConfirmUsBankAccountPaymentData + extends PaymentIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `PaymentIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodUsBankAccountData, 'type'>; +} + +/** + * Data to be sent with a `stripe.confirmPayment` request. + * Refer to the [Payment Intents API](https://stripe.com/docs/api/payment_intents/confirm) for a full list of parameters. + */ +export interface ConfirmPaymentData extends PaymentIntentConfirmParams { + /** + * The url your customer will be directed to after they complete payment. + */ + return_url: string; + + /** + * An object to attach additional billing_details to the PaymentMethod created via Elements. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_data + */ + payment_method_data?: { + /** + * The customer's billing details. Details collected by Elements will override values passed here. + * Billing fields that are omitted in the Payment Element via the `fields` option required. + * + * @docs https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_data-billing_details + */ + billing_details?: PaymentMethodCreateParams.BillingDetails; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Specifies if the PaymentMethod should be redisplayed when using the Saved Payment Method feature + */ + allow_redisplay?: 'always' | 'limited' | 'unspecified'; + }; + + /** + * Optional `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams-payment_method + */ + payment_method?: string; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array<string>; +} + +/** + * Data to be sent with a `stripe.verifyMicrodepositsForPayment` request. + */ +export interface VerifyMicrodepositsForPaymentData { + /** + * An array of two positive integers, in cents, equal to the values of the microdeposits sent to the bank account. + */ + amounts?: Array<number>; +} + +/** + * Data to be sent with a `stripe.collectBankAccountForPayment` request. + */ +export interface CollectBankAccountForPaymentOptions { + /** + * The client secret of the PaymentIntent. + */ + clientSecret: string; + + params: CollectBankAccountParams; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array<string>; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/payment-request.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/payment-request.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..f8b01c01c1dd4d5445777e3c84d205e629f7cb3d --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/payment-request.d.mts @@ -0,0 +1,534 @@ +import {Token, PaymentMethod, Source} from '../api'; +import {ApplePayOption, ApplePayUpdateOption} from './elements/apple-pay'; + +export interface PaymentRequest { + /** + * Returns a `Promise` that resolves with a truthy value if an enabled wallet is ready to pay. + * If no wallet is available, it resolves with `null`. + */ + canMakePayment(): Promise<CanMakePaymentResult | null>; + + /** + * Shows the browser’s payment interface. + * When using the `PaymentRequestButtonElement`, this is called for you automatically. + * This method must be called as the result of a user interaction (for example, in a click handler). + */ + show(): void; + + /** + * Closes the browser’s payment interface. + */ + abort: () => void; + + /** + * `true` if the browser’s payment interface is showing. + * When using the `PaymentRequestButtonElement`, this is called for you automatically. + */ + isShowing: () => boolean; + + /** + * `PaymentRequest` instances can be updated with an options object. + * + * `paymentRequest.update` can only be called when the browser payment interface is not showing. + * Listen to the [click](https://stripe.com/docs/js/element/events) and [cancel](https://stripe.com/docs/js/element/events) events to detect if the payment interface has been initiated. + * To update the `PaymentRequest` right before the payment interface is initiated, call `paymentRequest.update` in your click event handler. + */ + update(options: PaymentRequestUpdateOptions): void; + + /** + * Stripe.js automatically creates a `Token` after the customer is done interacting with the browser’s payment interface. + * To access the created `Token`, listen for this event. + */ + on( + eventType: 'token', + handler: (event: PaymentRequestTokenEvent) => any + ): this; + once( + eventType: 'token', + handler: (event: PaymentRequestTokenEvent) => any + ): this; + off( + eventType: 'token', + handler?: (event: PaymentRequestTokenEvent) => any + ): this; + + /** + * Stripe.js automatically creates a `PaymentMethod` after the customer is done interacting with the browser’s payment interface. + * To access the created `PaymentMethod`, listen for this event. + */ + on( + eventType: 'paymentmethod', + handler: (event: PaymentRequestPaymentMethodEvent) => any + ): this; + once( + eventType: 'paymentmethod', + handler: (event: PaymentRequestPaymentMethodEvent) => any + ): this; + off( + eventType: 'paymentmethod', + handler?: (event: PaymentRequestPaymentMethodEvent) => any + ): this; + + /** + * Stripe.js automatically creates a `Source` after the customer is done interacting with the browser’s payment interface. + * To access the created `Source`, listen for this event. + */ + on( + eventType: 'source', + handler: (event: PaymentRequestSourceEvent) => any + ): this; + once( + eventType: 'source', + handler: (event: PaymentRequestSourceEvent) => any + ): this; + off( + eventType: 'source', + handler?: (event: PaymentRequestSourceEvent) => any + ): this; + + /** + * The cancel event is emitted from a `PaymentRequest` when the browser's payment interface is dismissed. + * + * Note that in some browsers, the payment interface may be dismissed by the customer even after they authorize the payment. + * This means that you may receive a cancel event on your `PaymentRequest` object after receiving a `token`, `paymentmethod`, or `source` event. + * If you’re using the cancel event as a hook for canceling the customer’s order, make sure you also refund the payment that you just created. + */ + on(eventType: 'cancel', handler: () => any): this; + once(eventType: 'cancel', handler: () => any): this; + off(eventType: 'cancel', handler?: () => any): this; + + /** + * The `shippingaddresschange` event is emitted from a `PaymentRequest` whenever the customer selects a new address in the browser's payment interface. + */ + on( + eventType: 'shippingaddresschange', + handler: (event: PaymentRequestShippingAddressEvent) => any + ): this; + once( + eventType: 'shippingaddresschange', + handler: (event: PaymentRequestShippingAddressEvent) => any + ): this; + off( + eventType: 'shippingaddresschange', + handler?: (event: PaymentRequestShippingAddressEvent) => any + ): this; + + /** + * The `shippingoptionchange` event is emitted from a `PaymentRequest` whenever the customer selects a new shipping option in the browser's payment interface. + */ + on( + eventType: 'shippingoptionchange', + handler: (event: PaymentRequestShippingOptionEvent) => any + ): this; + once( + eventType: 'shippingoptionchange', + handler: (event: PaymentRequestShippingOptionEvent) => any + ): this; + off( + eventType: 'shippingoptionchange', + handler?: (event: PaymentRequestShippingOptionEvent) => any + ): this; +} + +export type CanMakePaymentResult = Record<string, boolean>; + +export interface PaymentRequestUpdateOptions { + /** + * Three character currency code (e.g., `usd`). + */ + currency?: string; + + /** + * This `PaymentRequestItem` is shown to the customer in the browser’s payment interface. + */ + total?: PaymentRequestItem; + + /** + * An array of PaymentRequestItem objects. + * These objects are shown as line items in the browser’s payment interface. + * Note that the sum of the line item amounts does not need to add up to the `total` amount above. + */ + displayItems?: PaymentRequestItem[]; + /** + * An array of `ShippingOption` objects. + * The first shipping option listed appears in the browser payment interface as the default option. + */ + + shippingOptions?: PaymentRequestShippingOption[]; + + /** + * Specify the options to be used when the Apple Pay payment interface opens. + */ + applePay?: ApplePayOption; +} + +/** + * An set of options to create this `PaymentRequest` instance with. + * These options can be updated using `paymentRequest.update`. + */ +export interface PaymentRequestOptions { + /** + * The two-letter country code of your Stripe account (e.g., `US`). + */ + country: string; + + /** + * Three character currency code (e.g., `usd`). + */ + currency: string; + + /** + * This `PaymentRequestItem` is shown to the customer in the browser’s payment interface. + */ + total: PaymentRequestItem; + + /** + * An array of PaymentRequestItem objects. + * These objects are shown as line items in the browser’s payment interface. + * Note that the sum of the line item amounts does not need to add up to the `total` amount above. + */ + displayItems?: PaymentRequestItem[]; + + /** + * By default, the browser's payment interface only asks the customer for actual payment information. + * A customer name can be collected by setting this option to `true`. + * This collected name will appears in the `PaymentRequestEvent` object. + * + * We highly recommend you collect at least one of name, email, or phone as this also results in collection of billing address for Apple Pay. + * The billing address can be used to perform address verification and block fraudulent payments. + * For all other payment methods, the billing address is automatically collected when available. + */ + requestPayerName?: boolean; + + /** + * See the `requestPayerName` option. + */ + requestPayerPhone?: boolean; + + /** + * See the `requestPayerName` option. + */ + requestPayerEmail?: boolean; + + /** + * Collect shipping address by setting this option to `true`. + * The address appears in the `PaymentRequestEvent`. + * + * You must also supply a valid `PaymentRequestShippingOption` to the `shippingOptions` property. + * This can be up front at the time `stripe.paymentRequest` is called, or in response to a `shippingaddresschange` event using the `updateWith` callback. + */ + requestShipping?: boolean; + + /** + * An array of `ShippingOption` objects. + * The first shipping option listed appears in the browser payment interface as the default option. + */ + shippingOptions?: PaymentRequestShippingOption[]; + + /** + * An array of wallet strings. + * Can be one or more of `applePay`, `googlePay`, `link` and `browserCard`. + * Use this option to disable Apple Pay, Google Pay, Link and/or browser-saved cards. + */ + disableWallets?: PaymentRequestWallet[]; + + /** + * Specify the options to be used when the Apple Pay payment interface opens. + */ + applePay?: ApplePayOption; + + /** + * The Stripe account ID which is the business of record. + */ + onBehalfOf?: string; + + /** + * @deprecated + * Use disableWallets instead. + */ + wallets?: PaymentRequestWallet[]; +} + +/** + * A `PaymentRequestItem` object is used to configure a `PaymentRequest`. + */ +export interface PaymentRequestItem { + /** + * The amount in the currency's subunit (e.g. cents, yen, etc.) + */ + amount: number; + + /** + * A name that the browser shows the customer in the payment interface. + */ + label: string; + + /** + * If you might change this amount later (for example, after you have calcluated shipping costs), set this to `true`. + * Note that browsers treat this as a hint for how to display things, and not necessarily as something that will prevent submission. + */ + pending?: boolean; +} + +/** + * The `ShippingOption` object describes a shipping method used with a `PaymentRequest`. + */ +export interface PaymentRequestShippingOption { + /** + * A unique ID you create to keep track of this shipping option. + * You’ll be told the ID of the selected option on changes and on completion. + */ + id: string; + + /** + * A short label for this shipping option. + */ + label: string; + + /** + * A longer description of this shipping option. + */ + detail: string; + + /** + * The amount to show for this shipping option. + * If the cost of this shipping option depends on the shipping address the customer enters, listen for the `shippingaddresschange` event. + */ + amount: number; +} + +export type PaymentRequestWallet = + | 'applePay' + | 'googlePay' + | 'link' + | 'browserCard'; + +export type PaymentRequestCompleteStatus = + /** + * Report to the browser that the payment was successful, and that it can close any active payment interface. + */ + | 'success' + + /** + * Report to the browser that you were unable to process the customer‘s payment. + * Browsers may re-show the payment interface, or simply show a message and close. + */ + | 'fail' + + /** + * Equivalent to `fail`, except that the browser can choose to show a more-specific error message. + */ + | 'invalid_payer_name' + + /** + * Equivalent to `fail`, except that the browser can choose to show a more-specific error message. + */ + | 'invalid_payer_phone' + + /** + * Equivalent to `fail`, except that the browser can choose to show a more-specific error message. + */ + | 'invalid_payer_email' + + /** + * Equivalent to `fail`, except that the browser can choose to show a more-specific error message. + */ + | 'invalid_shipping_address'; + +export interface PaymentRequestEvent { + /** + * Call this function with a `CompleteStatus` when you have processed the token data provided by the API. + * Note that you must must call complete within 30 seconds. + */ + complete: (status: PaymentRequestCompleteStatus) => void; + + /** + * The customer's name. + * Only present if it was explicitly asked for [creating the PaymentRequest object](https://stripe.com/docs/js/payment_request/create). + */ + payerName?: string; + + /** + * The customer's email. + * Only present if it was explicitly asked for [creating the PaymentRequest object](https://stripe.com/docs/js/payment_request/create). + */ + payerEmail?: string; + + /** + * The customer's phone. + * Only present if it was explicitly asked for [creating the PaymentRequest object](https://stripe.com/docs/js/payment_request/create). + */ + payerPhone?: string; + + /** + * The final `ShippingAddress` the customer selected. + * Only present when `requestShipping` is `true` when [creating the PaymentRequest object](https://stripe.com/docs/js/payment_request/create), and you've supplied at least one `ShippingOption`. + */ + shippingAddress?: PaymentRequestShippingAddress; + + /** + * The final `ShippingOption` the customer selected. + * Only present when `requestShipping` is `true` when [creating the PaymentRequest object](https://stripe.com/docs/js/payment_request/create), and you've supplied at least one `ShippingOption`. + */ + shippingOption?: PaymentRequestShippingOption; + + /** + * The unique name of the wallet the customer chose to authorize payment. + * For example, `browserCard`. + */ + walletName: PaymentRequestWallet | string; + + /** + * @deprecated + * Use walletName instead. + */ + methodName: string; +} + +/** + * Describes a shipping address collected with a `PaymentRequest`. + */ +export interface PaymentRequestShippingAddress { + /** + * Two-letter country code, capitalized. + * Valid two-letter country codes are specified by ISO3166 alpha-2. + */ + country?: string; + + /** + * An array of address line items. + * For example, `185 Berry St.`, `Suite 500`, `P.O. Box 12345`, etc. + */ + addressLine?: string[]; + + /** + * The most coarse subdivision of a country. + * Depending on the country, this might correspond to a state, a province, an oblast, a prefecture, or something else along these lines. + */ + region?: string; + + /** + * The name of a city, town, village, etc. + */ + city?: string; + + /** + * The postal code or ZIP code, also known as PIN code in India. + */ + postalCode?: string; + + /** + * The name of the recipient. + * This might be a person, a business name, or contain “care of†(c/o) instructions. + */ + recipient?: string; + + /** + * The phone number of the recipient. + * Note that this might be different from any phone number you collect with `requestPayerPhone`. + */ + phone?: string; + + /** + * The sorting code as used in, for example, France. + * Not present on Apple platforms. + */ + sortingCode?: string; + + /** + * A logical subdivision of a city. + * Can be used for things like neighborhoods, boroughs, districts, or UK dependent localities. + * Not present on Apple platforms. + */ + dependentLocality?: string; +} + +export interface PaymentRequestTokenEvent extends PaymentRequestEvent { + token: Token; +} + +export interface PaymentRequestPaymentMethodEvent extends PaymentRequestEvent { + paymentMethod: PaymentMethod; +} + +export interface PaymentRequestSourceEvent extends PaymentRequestEvent { + source: Source; +} + +export interface PaymentRequestShippingAddressEvent { + /** + * Call this with an `UpdateDetails` object to merge updates into the current `PaymentRequest` object. + * Note that if you subscribe to `shippingaddresschange` events, then you must call `updateWith` within 30 seconds. + */ + updateWith: (details: PaymentRequestUpdateDetails) => void; + + /** + * The customer's selected `ShippingAddress`. + * To maintain privacy, browsers may anonymize the shipping address by removing sensitive information that is not necessary to calculate shipping costs. + * Depending on the country, some fields can be missing or partially redacted. + * For example, the shipping address in the U.S. may only contain a city, state, and ZIP code. + * The full shipping address appears in the `PaymentRequestEvent` object after the purchase is confirmed in the browser’s payment interface + */ + shippingAddress: PaymentRequestShippingAddress; +} + +export type PaymentRequestUpdateDetailsStatus = + /** + * Let the customer proceed. + */ + | 'success' + + /** + * Prevent the customer from making the change they just made. + */ + | 'fail' + + /** + * Equivalent to `fail`, except we show a more specific error message. + * Can only be used in a `shippingaddresschange` handler. + */ + | 'invalid_shipping_address'; + +/** + * An object to pass to the `updateWith` callback on `shippingaddresschange` and `shippingoptionchange` events. + */ +export interface PaymentRequestUpdateDetails { + /** + * The browser uses this value to show an error message to the customer if they've taken an action that invalidates the payment request. + */ + status?: PaymentRequestUpdateDetailsStatus; + + /** + * The new total amount, if applicable. + */ + total?: PaymentRequestItem; + + /** + * These `PaymentRequestItem`s are shown as line items in the browser's payment interface. + * Note that the sum of the line item amounts does not need to add up to the `total` amount. + */ + displayItems?: PaymentRequestItem[]; + + /** + * The first shipping option listed appears in the browser payment interface as the default option. + */ + shippingOptions?: PaymentRequestShippingOption[]; + + /** + * Specify new options to refresh the Apple Pay payment interface. + */ + applePay?: ApplePayUpdateOption; +} + +export interface PaymentRequestShippingOptionEvent { + /** + * Call this with an `UpdateDetails` object to merge updates into the current `PaymentRequest` object. + * Note that if you subscribe to `shippingaddresschange` events, then you must call `updateWith` within 30 seconds. + */ + updateWith: (details: PaymentRequestUpdateDetails) => void; + + /** + * The customer's selected `ShippingOption`. + */ + shippingOption: PaymentRequestShippingOption; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/payment-request.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/payment-request.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f8b01c01c1dd4d5445777e3c84d205e629f7cb3d --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/payment-request.d.ts @@ -0,0 +1,534 @@ +import {Token, PaymentMethod, Source} from '../api'; +import {ApplePayOption, ApplePayUpdateOption} from './elements/apple-pay'; + +export interface PaymentRequest { + /** + * Returns a `Promise` that resolves with a truthy value if an enabled wallet is ready to pay. + * If no wallet is available, it resolves with `null`. + */ + canMakePayment(): Promise<CanMakePaymentResult | null>; + + /** + * Shows the browser’s payment interface. + * When using the `PaymentRequestButtonElement`, this is called for you automatically. + * This method must be called as the result of a user interaction (for example, in a click handler). + */ + show(): void; + + /** + * Closes the browser’s payment interface. + */ + abort: () => void; + + /** + * `true` if the browser’s payment interface is showing. + * When using the `PaymentRequestButtonElement`, this is called for you automatically. + */ + isShowing: () => boolean; + + /** + * `PaymentRequest` instances can be updated with an options object. + * + * `paymentRequest.update` can only be called when the browser payment interface is not showing. + * Listen to the [click](https://stripe.com/docs/js/element/events) and [cancel](https://stripe.com/docs/js/element/events) events to detect if the payment interface has been initiated. + * To update the `PaymentRequest` right before the payment interface is initiated, call `paymentRequest.update` in your click event handler. + */ + update(options: PaymentRequestUpdateOptions): void; + + /** + * Stripe.js automatically creates a `Token` after the customer is done interacting with the browser’s payment interface. + * To access the created `Token`, listen for this event. + */ + on( + eventType: 'token', + handler: (event: PaymentRequestTokenEvent) => any + ): this; + once( + eventType: 'token', + handler: (event: PaymentRequestTokenEvent) => any + ): this; + off( + eventType: 'token', + handler?: (event: PaymentRequestTokenEvent) => any + ): this; + + /** + * Stripe.js automatically creates a `PaymentMethod` after the customer is done interacting with the browser’s payment interface. + * To access the created `PaymentMethod`, listen for this event. + */ + on( + eventType: 'paymentmethod', + handler: (event: PaymentRequestPaymentMethodEvent) => any + ): this; + once( + eventType: 'paymentmethod', + handler: (event: PaymentRequestPaymentMethodEvent) => any + ): this; + off( + eventType: 'paymentmethod', + handler?: (event: PaymentRequestPaymentMethodEvent) => any + ): this; + + /** + * Stripe.js automatically creates a `Source` after the customer is done interacting with the browser’s payment interface. + * To access the created `Source`, listen for this event. + */ + on( + eventType: 'source', + handler: (event: PaymentRequestSourceEvent) => any + ): this; + once( + eventType: 'source', + handler: (event: PaymentRequestSourceEvent) => any + ): this; + off( + eventType: 'source', + handler?: (event: PaymentRequestSourceEvent) => any + ): this; + + /** + * The cancel event is emitted from a `PaymentRequest` when the browser's payment interface is dismissed. + * + * Note that in some browsers, the payment interface may be dismissed by the customer even after they authorize the payment. + * This means that you may receive a cancel event on your `PaymentRequest` object after receiving a `token`, `paymentmethod`, or `source` event. + * If you’re using the cancel event as a hook for canceling the customer’s order, make sure you also refund the payment that you just created. + */ + on(eventType: 'cancel', handler: () => any): this; + once(eventType: 'cancel', handler: () => any): this; + off(eventType: 'cancel', handler?: () => any): this; + + /** + * The `shippingaddresschange` event is emitted from a `PaymentRequest` whenever the customer selects a new address in the browser's payment interface. + */ + on( + eventType: 'shippingaddresschange', + handler: (event: PaymentRequestShippingAddressEvent) => any + ): this; + once( + eventType: 'shippingaddresschange', + handler: (event: PaymentRequestShippingAddressEvent) => any + ): this; + off( + eventType: 'shippingaddresschange', + handler?: (event: PaymentRequestShippingAddressEvent) => any + ): this; + + /** + * The `shippingoptionchange` event is emitted from a `PaymentRequest` whenever the customer selects a new shipping option in the browser's payment interface. + */ + on( + eventType: 'shippingoptionchange', + handler: (event: PaymentRequestShippingOptionEvent) => any + ): this; + once( + eventType: 'shippingoptionchange', + handler: (event: PaymentRequestShippingOptionEvent) => any + ): this; + off( + eventType: 'shippingoptionchange', + handler?: (event: PaymentRequestShippingOptionEvent) => any + ): this; +} + +export type CanMakePaymentResult = Record<string, boolean>; + +export interface PaymentRequestUpdateOptions { + /** + * Three character currency code (e.g., `usd`). + */ + currency?: string; + + /** + * This `PaymentRequestItem` is shown to the customer in the browser’s payment interface. + */ + total?: PaymentRequestItem; + + /** + * An array of PaymentRequestItem objects. + * These objects are shown as line items in the browser’s payment interface. + * Note that the sum of the line item amounts does not need to add up to the `total` amount above. + */ + displayItems?: PaymentRequestItem[]; + /** + * An array of `ShippingOption` objects. + * The first shipping option listed appears in the browser payment interface as the default option. + */ + + shippingOptions?: PaymentRequestShippingOption[]; + + /** + * Specify the options to be used when the Apple Pay payment interface opens. + */ + applePay?: ApplePayOption; +} + +/** + * An set of options to create this `PaymentRequest` instance with. + * These options can be updated using `paymentRequest.update`. + */ +export interface PaymentRequestOptions { + /** + * The two-letter country code of your Stripe account (e.g., `US`). + */ + country: string; + + /** + * Three character currency code (e.g., `usd`). + */ + currency: string; + + /** + * This `PaymentRequestItem` is shown to the customer in the browser’s payment interface. + */ + total: PaymentRequestItem; + + /** + * An array of PaymentRequestItem objects. + * These objects are shown as line items in the browser’s payment interface. + * Note that the sum of the line item amounts does not need to add up to the `total` amount above. + */ + displayItems?: PaymentRequestItem[]; + + /** + * By default, the browser's payment interface only asks the customer for actual payment information. + * A customer name can be collected by setting this option to `true`. + * This collected name will appears in the `PaymentRequestEvent` object. + * + * We highly recommend you collect at least one of name, email, or phone as this also results in collection of billing address for Apple Pay. + * The billing address can be used to perform address verification and block fraudulent payments. + * For all other payment methods, the billing address is automatically collected when available. + */ + requestPayerName?: boolean; + + /** + * See the `requestPayerName` option. + */ + requestPayerPhone?: boolean; + + /** + * See the `requestPayerName` option. + */ + requestPayerEmail?: boolean; + + /** + * Collect shipping address by setting this option to `true`. + * The address appears in the `PaymentRequestEvent`. + * + * You must also supply a valid `PaymentRequestShippingOption` to the `shippingOptions` property. + * This can be up front at the time `stripe.paymentRequest` is called, or in response to a `shippingaddresschange` event using the `updateWith` callback. + */ + requestShipping?: boolean; + + /** + * An array of `ShippingOption` objects. + * The first shipping option listed appears in the browser payment interface as the default option. + */ + shippingOptions?: PaymentRequestShippingOption[]; + + /** + * An array of wallet strings. + * Can be one or more of `applePay`, `googlePay`, `link` and `browserCard`. + * Use this option to disable Apple Pay, Google Pay, Link and/or browser-saved cards. + */ + disableWallets?: PaymentRequestWallet[]; + + /** + * Specify the options to be used when the Apple Pay payment interface opens. + */ + applePay?: ApplePayOption; + + /** + * The Stripe account ID which is the business of record. + */ + onBehalfOf?: string; + + /** + * @deprecated + * Use disableWallets instead. + */ + wallets?: PaymentRequestWallet[]; +} + +/** + * A `PaymentRequestItem` object is used to configure a `PaymentRequest`. + */ +export interface PaymentRequestItem { + /** + * The amount in the currency's subunit (e.g. cents, yen, etc.) + */ + amount: number; + + /** + * A name that the browser shows the customer in the payment interface. + */ + label: string; + + /** + * If you might change this amount later (for example, after you have calcluated shipping costs), set this to `true`. + * Note that browsers treat this as a hint for how to display things, and not necessarily as something that will prevent submission. + */ + pending?: boolean; +} + +/** + * The `ShippingOption` object describes a shipping method used with a `PaymentRequest`. + */ +export interface PaymentRequestShippingOption { + /** + * A unique ID you create to keep track of this shipping option. + * You’ll be told the ID of the selected option on changes and on completion. + */ + id: string; + + /** + * A short label for this shipping option. + */ + label: string; + + /** + * A longer description of this shipping option. + */ + detail: string; + + /** + * The amount to show for this shipping option. + * If the cost of this shipping option depends on the shipping address the customer enters, listen for the `shippingaddresschange` event. + */ + amount: number; +} + +export type PaymentRequestWallet = + | 'applePay' + | 'googlePay' + | 'link' + | 'browserCard'; + +export type PaymentRequestCompleteStatus = + /** + * Report to the browser that the payment was successful, and that it can close any active payment interface. + */ + | 'success' + + /** + * Report to the browser that you were unable to process the customer‘s payment. + * Browsers may re-show the payment interface, or simply show a message and close. + */ + | 'fail' + + /** + * Equivalent to `fail`, except that the browser can choose to show a more-specific error message. + */ + | 'invalid_payer_name' + + /** + * Equivalent to `fail`, except that the browser can choose to show a more-specific error message. + */ + | 'invalid_payer_phone' + + /** + * Equivalent to `fail`, except that the browser can choose to show a more-specific error message. + */ + | 'invalid_payer_email' + + /** + * Equivalent to `fail`, except that the browser can choose to show a more-specific error message. + */ + | 'invalid_shipping_address'; + +export interface PaymentRequestEvent { + /** + * Call this function with a `CompleteStatus` when you have processed the token data provided by the API. + * Note that you must must call complete within 30 seconds. + */ + complete: (status: PaymentRequestCompleteStatus) => void; + + /** + * The customer's name. + * Only present if it was explicitly asked for [creating the PaymentRequest object](https://stripe.com/docs/js/payment_request/create). + */ + payerName?: string; + + /** + * The customer's email. + * Only present if it was explicitly asked for [creating the PaymentRequest object](https://stripe.com/docs/js/payment_request/create). + */ + payerEmail?: string; + + /** + * The customer's phone. + * Only present if it was explicitly asked for [creating the PaymentRequest object](https://stripe.com/docs/js/payment_request/create). + */ + payerPhone?: string; + + /** + * The final `ShippingAddress` the customer selected. + * Only present when `requestShipping` is `true` when [creating the PaymentRequest object](https://stripe.com/docs/js/payment_request/create), and you've supplied at least one `ShippingOption`. + */ + shippingAddress?: PaymentRequestShippingAddress; + + /** + * The final `ShippingOption` the customer selected. + * Only present when `requestShipping` is `true` when [creating the PaymentRequest object](https://stripe.com/docs/js/payment_request/create), and you've supplied at least one `ShippingOption`. + */ + shippingOption?: PaymentRequestShippingOption; + + /** + * The unique name of the wallet the customer chose to authorize payment. + * For example, `browserCard`. + */ + walletName: PaymentRequestWallet | string; + + /** + * @deprecated + * Use walletName instead. + */ + methodName: string; +} + +/** + * Describes a shipping address collected with a `PaymentRequest`. + */ +export interface PaymentRequestShippingAddress { + /** + * Two-letter country code, capitalized. + * Valid two-letter country codes are specified by ISO3166 alpha-2. + */ + country?: string; + + /** + * An array of address line items. + * For example, `185 Berry St.`, `Suite 500`, `P.O. Box 12345`, etc. + */ + addressLine?: string[]; + + /** + * The most coarse subdivision of a country. + * Depending on the country, this might correspond to a state, a province, an oblast, a prefecture, or something else along these lines. + */ + region?: string; + + /** + * The name of a city, town, village, etc. + */ + city?: string; + + /** + * The postal code or ZIP code, also known as PIN code in India. + */ + postalCode?: string; + + /** + * The name of the recipient. + * This might be a person, a business name, or contain “care of†(c/o) instructions. + */ + recipient?: string; + + /** + * The phone number of the recipient. + * Note that this might be different from any phone number you collect with `requestPayerPhone`. + */ + phone?: string; + + /** + * The sorting code as used in, for example, France. + * Not present on Apple platforms. + */ + sortingCode?: string; + + /** + * A logical subdivision of a city. + * Can be used for things like neighborhoods, boroughs, districts, or UK dependent localities. + * Not present on Apple platforms. + */ + dependentLocality?: string; +} + +export interface PaymentRequestTokenEvent extends PaymentRequestEvent { + token: Token; +} + +export interface PaymentRequestPaymentMethodEvent extends PaymentRequestEvent { + paymentMethod: PaymentMethod; +} + +export interface PaymentRequestSourceEvent extends PaymentRequestEvent { + source: Source; +} + +export interface PaymentRequestShippingAddressEvent { + /** + * Call this with an `UpdateDetails` object to merge updates into the current `PaymentRequest` object. + * Note that if you subscribe to `shippingaddresschange` events, then you must call `updateWith` within 30 seconds. + */ + updateWith: (details: PaymentRequestUpdateDetails) => void; + + /** + * The customer's selected `ShippingAddress`. + * To maintain privacy, browsers may anonymize the shipping address by removing sensitive information that is not necessary to calculate shipping costs. + * Depending on the country, some fields can be missing or partially redacted. + * For example, the shipping address in the U.S. may only contain a city, state, and ZIP code. + * The full shipping address appears in the `PaymentRequestEvent` object after the purchase is confirmed in the browser’s payment interface + */ + shippingAddress: PaymentRequestShippingAddress; +} + +export type PaymentRequestUpdateDetailsStatus = + /** + * Let the customer proceed. + */ + | 'success' + + /** + * Prevent the customer from making the change they just made. + */ + | 'fail' + + /** + * Equivalent to `fail`, except we show a more specific error message. + * Can only be used in a `shippingaddresschange` handler. + */ + | 'invalid_shipping_address'; + +/** + * An object to pass to the `updateWith` callback on `shippingaddresschange` and `shippingoptionchange` events. + */ +export interface PaymentRequestUpdateDetails { + /** + * The browser uses this value to show an error message to the customer if they've taken an action that invalidates the payment request. + */ + status?: PaymentRequestUpdateDetailsStatus; + + /** + * The new total amount, if applicable. + */ + total?: PaymentRequestItem; + + /** + * These `PaymentRequestItem`s are shown as line items in the browser's payment interface. + * Note that the sum of the line item amounts does not need to add up to the `total` amount. + */ + displayItems?: PaymentRequestItem[]; + + /** + * The first shipping option listed appears in the browser payment interface as the default option. + */ + shippingOptions?: PaymentRequestShippingOption[]; + + /** + * Specify new options to refresh the Apple Pay payment interface. + */ + applePay?: ApplePayUpdateOption; +} + +export interface PaymentRequestShippingOptionEvent { + /** + * Call this with an `UpdateDetails` object to merge updates into the current `PaymentRequest` object. + * Note that if you subscribe to `shippingaddresschange` events, then you must call `updateWith` within 30 seconds. + */ + updateWith: (details: PaymentRequestUpdateDetails) => void; + + /** + * The customer's selected `ShippingOption`. + */ + shippingOption: PaymentRequestShippingOption; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/setup-intents.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/setup-intents.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e5febebece2a9d91f6d890fc9d983873bdbf4cde --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/setup-intents.d.mts @@ -0,0 +1,250 @@ +import {SetupIntentConfirmParams} from '../api'; + +import { + CreatePaymentMethodAcssDebitData, + CreatePaymentMethodAuBecsDebitData, + CreatePaymentMethodBancontactData, + CreatePaymentMethodCardData, + CreatePaymentMethodCashappData, + CreatePaymentMethodIdealData, + CreatePaymentMethodSepaDebitData, + CreatePaymentMethodSofortData, + CreatePaymentMethodPayPalData, + CreatePaymentMethodBacsDebitData, + CreatePaymentMethodUsBankAccountData, + CollectBankAccountParams, +} from './payment-intents'; + +import {Omit} from '../utils'; + +/** + * Data to be sent with a `stripe.confirmCardSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmCardSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodCardData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmCardSetup`. + */ +export interface ConfirmCardSetupOptions { + /* + * Set this to `false` if you want to [handle next actions yourself](https://stripe.com/docs/payments/payment-intents/verifying-status#next-actions), or if you want to defer next action handling until later (e.g. for use in the [PaymentRequest API](https://stripe.com/docs/stripe-js/elements/payment-request-button#complete-payment-intents)). + * Default is `true`. + */ + handleActions?: boolean; +} + +export interface ConfirmCashappSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodCashappData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmCashappSetup`. + */ +export interface ConfirmCashappSetupOptions { + /* + * Set this to `false` if you want to [manually handle the authorization QR code or redirect](https://stripe.com/docs/payments/cash-app-pay/set-up-payment?platform=web&ui=API#web-create-setup-intent). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmIdealSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmIdealSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodIdealData, 'type'>; +} + +/** + * Data to be sent with a `stripe.confirmIdealSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmPayPalSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodPayPalData, 'type'>; + + /** + * The required url your customer will be directed to after they complete authentication. + */ + return_url: string; +} + +/** + * Data to be sent with a `stripe.confirmSepaDebitSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmSepaDebitSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodSepaDebitData, 'type'>; +} + +/** + * Data to be sent with a `stripe.confirmSofortSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmSofortSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodSofortData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmSofortSetup`. + */ +export interface ConfirmSofortSetupOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/sofort/accept-a-payment?platform=web#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmAuBecsDebitSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAuBecsDebitSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodAuBecsDebitData, 'type'>; +} + +/** + * Data to be sent with a `stripe.confirmBacsDebitSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmBacsDebitSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodBacsDebitData, 'type'>; +} + +/** + * Data to be sent with a `stripe.confirmBancontactSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmBancontactSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodBancontactData, 'type'>; +} + +/** + * Data to be sent with a `stripe.confirmAcssDebitSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAcssDebitSetupData extends SetupIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodAcssDebitData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmAcssDebitSetup`. + */ +export interface ConfirmAcssDebitSetupOptions { + /** + * Set this to true if you want to skip displaying the mandate confirmation. + */ + skipMandate?: boolean; +} + +/** + * Data to be sent with a `stripe.verifyMicrodepositsForSetup` request. + */ +export interface VerifyMicrodepositsForSetupData { + /** + * An array of two positive integers, in cents, equal to the values of the microdeposits sent to the bank account. + */ + amounts?: Array<number>; + + /** + * A six-character code starting with SM present in the microdeposit sent to the bank account. + */ + descriptor_code?: string; +} + +export interface ConfirmUsBankAccountSetupData + extends SetupIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodUsBankAccountData, 'type'>; +} + +/** + * Data to be sent with a `stripe.collectBankAccountForSetup` request. + */ +export interface CollectBankAccountForSetupOptions { + /** + * The client secret of the SetupIntent. + */ + clientSecret: string; + + params: CollectBankAccountParams; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array<string>; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/setup-intents.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/setup-intents.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e5febebece2a9d91f6d890fc9d983873bdbf4cde --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/setup-intents.d.ts @@ -0,0 +1,250 @@ +import {SetupIntentConfirmParams} from '../api'; + +import { + CreatePaymentMethodAcssDebitData, + CreatePaymentMethodAuBecsDebitData, + CreatePaymentMethodBancontactData, + CreatePaymentMethodCardData, + CreatePaymentMethodCashappData, + CreatePaymentMethodIdealData, + CreatePaymentMethodSepaDebitData, + CreatePaymentMethodSofortData, + CreatePaymentMethodPayPalData, + CreatePaymentMethodBacsDebitData, + CreatePaymentMethodUsBankAccountData, + CollectBankAccountParams, +} from './payment-intents'; + +import {Omit} from '../utils'; + +/** + * Data to be sent with a `stripe.confirmCardSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmCardSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodCardData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmCardSetup`. + */ +export interface ConfirmCardSetupOptions { + /* + * Set this to `false` if you want to [handle next actions yourself](https://stripe.com/docs/payments/payment-intents/verifying-status#next-actions), or if you want to defer next action handling until later (e.g. for use in the [PaymentRequest API](https://stripe.com/docs/stripe-js/elements/payment-request-button#complete-payment-intents)). + * Default is `true`. + */ + handleActions?: boolean; +} + +export interface ConfirmCashappSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodCashappData, 'type'>; + + /** + * The url your customer will be directed to after they complete authentication. + */ + return_url?: string; +} + +/** + * An options object to control the behavior of `stripe.confirmCashappSetup`. + */ +export interface ConfirmCashappSetupOptions { + /* + * Set this to `false` if you want to [manually handle the authorization QR code or redirect](https://stripe.com/docs/payments/cash-app-pay/set-up-payment?platform=web&ui=API#web-create-setup-intent). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmIdealSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmIdealSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodIdealData, 'type'>; +} + +/** + * Data to be sent with a `stripe.confirmIdealSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmPayPalSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodPayPalData, 'type'>; + + /** + * The required url your customer will be directed to after they complete authentication. + */ + return_url: string; +} + +/** + * Data to be sent with a `stripe.confirmSepaDebitSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmSepaDebitSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodSepaDebitData, 'type'>; +} + +/** + * Data to be sent with a `stripe.confirmSofortSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmSofortSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodSofortData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmSofortSetup`. + */ +export interface ConfirmSofortSetupOptions { + /** + * Set this to `false` if you want to [manually handle the authorization redirect](https://stripe.com/docs/payments/sofort/accept-a-payment?platform=web#handle-redirect). + * Default is `true`. + */ + handleActions?: boolean; +} + +/** + * Data to be sent with a `stripe.confirmAuBecsDebitSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAuBecsDebitSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodAuBecsDebitData, 'type'>; +} + +/** + * Data to be sent with a `stripe.confirmBacsDebitSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmBacsDebitSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodBacsDebitData, 'type'>; +} + +/** + * Data to be sent with a `stripe.confirmBancontactSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmBancontactSetupData extends SetupIntentConfirmParams { + /* + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodBancontactData, 'type'>; +} + +/** + * Data to be sent with a `stripe.confirmAcssDebitSetup` request. + * Refer to the [Setup Intents API](https://stripe.com/docs/api/setup_intents/confirm) for a full list of parameters. + */ +export interface ConfirmAcssDebitSetupData extends SetupIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodAcssDebitData, 'type'>; +} + +/** + * An options object to control the behavior of `stripe.confirmAcssDebitSetup`. + */ +export interface ConfirmAcssDebitSetupOptions { + /** + * Set this to true if you want to skip displaying the mandate confirmation. + */ + skipMandate?: boolean; +} + +/** + * Data to be sent with a `stripe.verifyMicrodepositsForSetup` request. + */ +export interface VerifyMicrodepositsForSetupData { + /** + * An array of two positive integers, in cents, equal to the values of the microdeposits sent to the bank account. + */ + amounts?: Array<number>; + + /** + * A six-character code starting with SM present in the microdeposit sent to the bank account. + */ + descriptor_code?: string; +} + +export interface ConfirmUsBankAccountSetupData + extends SetupIntentConfirmParams { + /** + * Either the `id` of an existing [PaymentMethod](https://stripe.com/docs/api/payment_methods), or an object containing data to create a `PaymentMethod` with. + * This field is optional if a `PaymentMethod` has already been attached to this `SetupIntent`. + * + * @recommended + */ + payment_method?: string | Omit<CreatePaymentMethodUsBankAccountData, 'type'>; +} + +/** + * Data to be sent with a `stripe.collectBankAccountForSetup` request. + */ +export interface CollectBankAccountForSetupOptions { + /** + * The client secret of the SetupIntent. + */ + clientSecret: string; + + params: CollectBankAccountParams; + + /** + * Specifies which fields in the response should be expanded. + */ + expand?: Array<string>; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/stripe.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/stripe.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..e94088ed5c0b31637cbe4c20468657d0562e8688 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/stripe.d.mts @@ -0,0 +1,1486 @@ +import * as api from '../api'; +import * as paymentIntents from './payment-intents'; +import * as setupIntents from './setup-intents'; +import * as confirmationTokens from './confirmation-tokens'; +import * as orders from './orders'; +import * as tokens from './token-and-sources'; +import * as elements from './elements'; +import * as financialConnections from './financial-connections'; +import * as ephemeralKeys from './ephemeral-keys'; + +import { + StripeElements, + StripeElementsOptionsClientSecret, + StripeElementsOptionsMode, +} from './elements-group'; +import {CheckoutLocale, RedirectToCheckoutOptions} from './checkout'; +import {PaymentRequestOptions, PaymentRequest} from './payment-request'; +import {StripeElement, StripeElementLocale} from './elements-group'; +import { + StripeCustomCheckoutOptions, + StripeCustomCheckout, +} from './custom-checkout'; +import { + StripeEmbeddedCheckoutOptions, + StripeEmbeddedCheckout, +} from './embedded-checkout'; + +export interface Stripe { + ///////////////////////////// + /// Elements + /// + /// https://stripe.com/docs/js/elements_object + ///////////////////////////// + + /** + * Create an `Elements` instance, which manages a group of elements. + * + * https://stripe.com/docs/js/elements_object/create + */ + elements(options?: StripeElementsOptionsClientSecret): StripeElements; + + /** + * Create an `Elements` instance, which manages a group of elements. + * + * https://stripe.com/docs/js/elements_object/create_without_intent + */ + elements(options?: StripeElementsOptionsMode): StripeElements; + + ///////////////////////////// + /// Checkout + /// + /// https://stripe.com/docs/js/checkout + ///////////////////////////// + + /** + * Use `stripe.redirectToCheckout` to redirect your customers to [Checkout](https://stripe.com/docs/payments/checkout), a Stripe-hosted page to securely collect payment information. + * When the customer completes their purchase, they are redirected back to your website. + */ + redirectToCheckout( + options: RedirectToCheckoutOptions + ): Promise<never | {error: StripeError}>; + + ///////////////////////////// + /// Payment Intents + /// + /// https://stripe.com/docs/js/payment_intents + ///////////////////////////// + + /** + * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * By default, `stripe.confirmPayment` will always redirect to your return_url after a successful confirmation. + * If you set `redirect: "if_required"`, then `stripe.confirmPayment` will only redirect if your user chooses a redirect-based payment method. + * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_payment + */ + confirmPayment(options: { + elements: StripeElements; + confirmParams?: Partial<paymentIntents.ConfirmPaymentData>; + redirect: 'if_required'; + }): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * By default, `stripe.confirmPayment` will always redirect to your return_url after a successful confirmation. + * If you set `redirect: "if_required"`, then `stripe.confirmPayment` will only redirect if your user chooses a redirect-based payment method. + * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_payment + */ + confirmPayment(options: { + elements?: StripeElements; + clientSecret: string; + confirmParams?: Partial<paymentIntents.ConfirmPaymentData>; + redirect: 'if_required'; + }): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_payment + */ + confirmPayment(options: { + elements: StripeElements; + confirmParams: paymentIntents.ConfirmPaymentData; + redirect?: 'always'; + }): Promise<never | {error: StripeError}>; + + /** + * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_payment + */ + confirmPayment(options: { + elements?: StripeElements; + clientSecret: string; + confirmParams: paymentIntents.ConfirmPaymentData; + redirect?: 'always'; + }): Promise<never | {error: StripeError}>; + + /** + * Use `stripe.confirmAcssDebitPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow when the customer submits your payment form. + * When called, it will automatically pop up a modal to collect bank account details and verification, accept the mandate, and confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) when the user submits the form. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * `stripe.confirmAcssDebitPayment` automatically creates a new `PaymentMethod` for you when your customer completes the modal UI. + * It can also be called with an existing `PaymentMethod` which will load the modal UI to collect a new mandate agreement. + * If you have already attached a `PaymentMethod`, you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_acss_debit_payment + */ + confirmAcssDebitPayment( + clientSecret: string, + data?: paymentIntents.ConfirmAcssDebitPaymentData, + options?: paymentIntents.ConfirmAcssDebitPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmUsBankAccountPayment` in the [Accept a payment](https://stripe.com/docs/payments/ach-debit/accept-a-payment) flow for the [ACH Direct Debit]((https://stripe.com/docs/payments/ach-debit) payment method to record the customer’s authorization for payment. + * + * When you confirm a [PaymentIntent](https://stripe.com/docs/api/payment_intents), it needs to have an attached PaymentMethod. + * Use `stripe.collectBankAccountForPayment` to collect and attach a [PaymentMethod](https://stripe.com/docs/api/payment_methods), or provide bank account details using the `data` parameter if a `PaymentMethod` was not already provided. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_us_bank_account_payment + */ + confirmUsBankAccountPayment( + clientSecret: string, + data?: paymentIntents.ConfirmUsBankAccountPaymentData + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmAlipayPayment` in the [Alipay Payments](https://stripe.com/docs/payments/alipay) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_alipay_payment + */ + confirmAlipayPayment( + clientSecret: string, + data?: paymentIntents.ConfirmAlipayPaymentData, + options?: paymentIntents.ConfirmAlipayPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmAuBecsDebitPayment` in the [BECS Direct Debit Payments](https://stripe.com/docs/payments/payment-methods/au-becs-debit) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/payment-methods/au-becs-debit-quickstart-payment-intents) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_au_becs_debit_payment + */ + confirmAuBecsDebitPayment( + clientSecret: string, + data?: paymentIntents.ConfirmAuBecsDebitPaymentData + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmBancontactPayment` in the [Bancontact Payments with Payment Methods](https://stripe.com/docs/payments/bancontact#web) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_bancontact_payment + */ + confirmBancontactPayment( + clientSecret: string, + data?: paymentIntents.ConfirmBancontactPaymentData, + options?: paymentIntents.ConfirmBancontactPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmBlikPayment` in the [BLIK Payments with Payment Methods](https://stripe.com/docs/payments/blik) flow when the customer submits your payment form. + * When called, it will confirm the PaymentIntent with data you provide, and it will automatically prompt the customer to authorize the transaction. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_blik_payment + */ + confirmBlikPayment( + clientSecret: string, + data: paymentIntents.ConfirmBlikPaymentData, + options?: paymentIntents.ConfirmBlikPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmBoletoPayment` in the [Boleto Payment](https://stripe.com/docs/payments/boleto) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/boleto) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_boleto_payment + */ + confirmBoletoPayment( + clientSecret: string, + data?: paymentIntents.ConfirmBoletoPaymentData, + options?: paymentIntents.ConfirmBoletoPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmCardPayment` when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide and carry out 3DS or other next actions if they are required. + * + * If you are using [Dynamic 3D Secure](https://stripe.com/docs/payments/3d-secure#three-ds-radar), `stripe.confirmCardPayment` will trigger your Radar rules to execute and may open a dialog for your customer to authenticate their payment. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_card_payment + */ + confirmCardPayment( + clientSecret: string, + data?: paymentIntents.ConfirmCardPaymentData, + options?: paymentIntents.ConfirmCardPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmCashappPayment` in the [Cash App Payments](https://stripe.com/docs/payments/cash-app-pay) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/cash-app-pay) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_cashapp_payment + */ + confirmCashappPayment( + clientSecret: string, + data?: paymentIntents.ConfirmCashappPaymentData, + options?: paymentIntents.ConfirmCashappPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmCustomerBalancePayment` when the customer submits your payment form. + * + * When called, it will confirm the PaymentIntent with data you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/bank-transfers) for more details. + * + * Since the Customer Balance payment method draws from a balance, the attempt will succeed or fail depending on the current balance amount. To collect more funds from the customer when the cash balance is insufficient, use the customer balance with bank transfer funding parameters. + * The confirmation attempt will finish in one of the following result states: + * 1. If the customer balance was enough to pay the amount, the status is succeeded. The funding_type data is effectively ignored. + * 2. If the balance was not enough to pay the amount, and you didn't send the funding_type, the status is requires_payment_method. + * 3. If the balance was not enough to pay the amount, and you did send the funding_type, the status is requires_action. The paymentIntent.next_action.display_bank_transfer_instructions hash contains bank transfer details for funding the Customer Balance. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_customer_balance_payment + */ + confirmCustomerBalancePayment( + clientSecret: string, + data: paymentIntents.ConfirmCustomerBalancePaymentData, + options: paymentIntents.ConfirmCustomerBalancePaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmEpsPayment` in the [EPS Payments with Payment Methods](https://stripe.com/docs/payments/eps#web) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_eps_payment + */ + confirmEpsPayment( + clientSecret: string, + data?: paymentIntents.ConfirmEpsPaymentData, + options?: paymentIntents.ConfirmEpsPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmFpxPayment` in the [FPX Payments with Payment Methods](https://stripe.com/docs/payments/fpx#web) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_fpx_payment + */ + confirmFpxPayment( + clientSecret: string, + data?: paymentIntents.ConfirmFpxPaymentData, + options?: paymentIntents.ConfirmFpxPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmGiropayPayment` in the [giropay Payments with Payment Methods](https://stripe.com/docs/payments/giropay#web) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_giropay_payment + */ + confirmGiropayPayment( + clientSecret: string, + data?: paymentIntents.ConfirmGiropayPaymentData, + options?: paymentIntents.ConfirmGiropayPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmGrabPayPayment` in the [GrabPay payments](https://stripe.com/docs/payments/grabpay) flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents). + * Refer to our [integration guide](https://stripe.com/docs/payments/grabpay/accept-a-payment) for more details. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_grabpay_payment + */ + + confirmGrabPayPayment( + clientSecret: string, + data?: paymentIntents.ConfirmGrabPayPaymentData, + options?: paymentIntents.ConfirmGrabPayPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmIdealPayment` in the [iDEAL Payments with Payment Methods](https://stripe.com/docs/payments/ideal) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_ideal_payment + */ + confirmIdealPayment( + clientSecret: string, + data?: paymentIntents.ConfirmIdealPaymentData, + options?: paymentIntents.ConfirmIdealPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmKlarnaPayment` in the [Klarna Payments](https://stripe.com/docs/payments/klarna) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_klarna_payment + */ + confirmKlarnaPayment( + clientSecret: string, + data?: paymentIntents.ConfirmKlarnaPaymentData, + options?: paymentIntents.ConfirmKlarnaPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmKonbiniPayment` in the [Konbini](https://stripe.com/docs/payments/konbini) payment flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/konbini/accept-a-payment) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_konbini_payment + */ + confirmKonbiniPayment( + clientSecret: string, + data?: paymentIntents.ConfirmKonbiniPaymentData, + options?: paymentIntents.ConfirmKonbiniPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmOxxoPayment` in the [OXXO Payment](https://stripe.com/docs/payments/oxxo) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/oxxo) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_oxxo_payment + */ + confirmOxxoPayment( + clientSecret: string, + data?: paymentIntents.ConfirmOxxoPaymentData, + options?: paymentIntents.ConfirmOxxoPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmP24Payment` in the [Przelewy24 Payments with Payment Methods](https://stripe.com/docs/payments/p24#web) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_p24_payment + */ + confirmP24Payment( + clientSecret: string, + data?: paymentIntents.ConfirmP24PaymentData, + options?: paymentIntents.ConfirmP24PaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmPayNowPayment` in the [PayNow Payments](https://stripe.com/docs/payments/paynow) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/paynow) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + */ + confirmPayNowPayment( + clientSecret: string, + data?: paymentIntents.ConfirmPayNowPaymentData, + options?: paymentIntents.ConfirmPayNowPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmPayPalPayment` in the [PayPal Payments](https://stripe.com/docs/payments/paypal) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_paypal_payment + */ + confirmPayPalPayment( + clientSecret: string, + data?: paymentIntents.ConfirmPayPalPaymentData + ): Promise<PaymentIntentResult>; + + /** + + * Use `stripe.confirmPixPayment` in the [Pix Payments](https://stripe.com/docs/payments/pix) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/pix) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_pix_payment + */ + confirmPixPayment( + clientSecret: string, + data?: paymentIntents.ConfirmPixPaymentData, + options?: paymentIntents.ConfirmPixPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmPromptPayPayment` in the [PromptPay Payments](https://stripe.com/docs/payments/promptpay) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/promptpay) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + */ + confirmPromptPayPayment( + clientSecret: string, + data?: paymentIntents.ConfirmPromptPayPaymentData, + options?: paymentIntents.ConfirmPromptPayPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmSepaDebitPayment` in the [SEPA Direct Debit Payments](https://stripe.com/docs/payments/sepa-debit) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/sepa-debit) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_sepa_debit_payment + */ + confirmSepaDebitPayment( + clientSecret: string, + data?: paymentIntents.ConfirmSepaDebitPaymentData + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmSofortPayment` in the [Sofort Payments with Payment Methods](https://stripe.com/docs/payments/sofort) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide. It will then automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_sofort_payment + */ + confirmSofortPayment( + clientSecret: string, + data?: paymentIntents.ConfirmSofortPaymentData, + options?: paymentIntents.ConfirmSofortPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmWechatPayPayment` in the [Wechat Pay Payments](https://stripe.com/docs/payments/wechat-pay) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/wechat-pay/accept-a-payment) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_wechat_pay_payment + */ + confirmWechatPayPayment( + clientSecret: string, + data?: paymentIntents.ConfirmWechatPayPaymentData, + options?: paymentIntents.ConfirmWechatPayPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.handleCardAction` in the Payment Intents API [manual confirmation](https://stripe.com/docs/payments/payment-intents/web-manual) flow to handle a [PaymentIntent](https://stripe.com/docs/api/payment_intents) with the `requires_action` status. + * It will throw an error if the `PaymentIntent` has a different status. + * + * Note that `stripe.handleCardAction` may take several seconds to complete. + * During that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner. + * If you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator. + * + * Additionally, `stripe.handleCardAction` may trigger a [3D Secure](https://stripe.com/docs/payments/3d-secure) authentication challenge. + * The authentication challenge requires a context switch that can be hard to follow on a screen-reader. + * Ensure that your form is accessible by ensuring that success or error messages are clearly read out. + * + * @docs https://stripe.com/docs/js/payment_intents/handle_card_action + */ + handleCardAction(clientSecret: string): Promise<PaymentIntentResult>; + + /** + * Use `stripe.handleNextAction` in the [finalizing payments on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server) flow to finish confirmation of a [PaymentIntent](https://stripe.com/docs/api/payment_intents) or [SetupIntent](https://stripe.com/docs/api/setup_intents) with the `requires_action` status. + * It will throw an error if the `PaymentIntent` or `SetupIntent` has a different status. + * + * Note that `stripe.handleNextAction` may take several seconds to complete. + * During that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner. + * If you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator. + * + * Additionally, `stripe.handleNextAction` may trigger a [3D Secure](https://stripe.com/docs/payments/3d-secure) authentication challenge. + * The authentication challenge requires a context switch that can be hard to follow on a screen-reader. + * Ensure that your form is accessible by ensuring that success or error messages are clearly read out. + * + * @docs https://stripe.com/docs/js/payment_intents/handle_next_action + */ + handleNextAction(options: { + clientSecret: string; + }): Promise<PaymentIntentOrSetupIntentResult>; + + /** + * Use `stripe.verifyMicrodepositsForPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow + * to verify a customer's bank account with micro-deposits. + * + * @docs https://stripe.com/docs/js/payment_intents/verify_microdeposits_for_payment + */ + verifyMicrodepositsForPayment( + clientSecret: string, + data?: paymentIntents.VerifyMicrodepositsForPaymentData + ): Promise<PaymentIntentResult>; + + /** + * Use stripe.createRadarSession to create a [Radar Session](https://stripe.com/docs/radar/radar-session) in your checkout flow or when saving card details. + * A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments. + * This metadata includes information like IP address, browser, screen or device information, and other device characteristics. + * By using Radar Sessions, you can capture critical fraud information without tokenizing on Stripe. + */ + createRadarSession(): Promise<RadarSessionPayload>; + + /** + * Use `stripe.collectBankAccountForPayment` in the [Accept a payment flow](https://stripe.com/docs/payments/ach-debit/accept-a-payment) for the [ACH Direct Debit](https://stripe.com/docs/payments/ach-debit) + * payment method to collect the customer’s bank account in your payment form. + * + * @docs https://stripe.com/docs/js/payment_intents/collect_bank_account_for_payment + */ + collectBankAccountForPayment( + options: paymentIntents.CollectBankAccountForPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/payment_methods/create_payment_method + */ + createPaymentMethod( + paymentMethodData: paymentIntents.CreatePaymentMethodData + ): Promise<PaymentMethodResult>; + + /** + * Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/payment_methods/create_payment_method_elements + */ + createPaymentMethod( + options: paymentIntents.CreatePaymentMethodFromElements + ): Promise<PaymentMethodResult>; + + /** + * Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/payment_methods/create_payment_method_elements + */ + createPaymentMethod( + options: paymentIntents.CreatePaymentMethodFromElement + ): Promise<PaymentMethodResult>; + + /** + * Use stripe.createConfirmationToken to convert payment information collected by elements into a [ConfirmationToken](https://stripe.com/docs/api/confirmation_tokens) object that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/confirmation_tokens/create_confirmation_token + */ + createConfirmationToken( + options: confirmationTokens.CreateConfirmationToken + ): Promise<ConfirmationTokenResult>; + + /** + * Retrieve a [PaymentIntent](https://stripe.com/docs/api/payment_intents) using its [client secret](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret). + * + * @docs https://stripe.com/docs/js/payment_intents/retrieve_payment_intent + */ + retrievePaymentIntent(clientSecret: string): Promise<PaymentIntentResult>; + + ///////////////////////////// + /// Setup Intents + /// + /// https://stripe.com/docs/js/setup_intents + ///////////////////////////// + + /** + * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * By default, stripe.`confirmSetup` will always redirect to your return_url after a successful confirmation. + * If you set `redirect: "if_required"`, then `stripe.confirmSetup` will only redirect if your user chooses a redirect-based payment method. + * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_setup + */ + confirmSetup(options: { + elements: StripeElements; + confirmParams?: Partial<paymentIntents.ConfirmPaymentData>; + redirect: 'if_required'; + }): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * By default, stripe.`confirmSetup` will always redirect to your return_url after a successful confirmation. + * If you set `redirect: "if_required"`, then `stripe.confirmSetup` will only redirect if your user chooses a redirect-based payment method. + * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_setup + */ + confirmSetup(options: { + elements?: StripeElements; + clientSecret: string; + confirmParams?: Partial<paymentIntents.ConfirmPaymentData>; + redirect: 'if_required'; + }): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_setup + */ + confirmSetup(options: { + elements: StripeElements; + confirmParams: paymentIntents.ConfirmPaymentData; + redirect?: 'always'; + }): Promise<never | {error: StripeError}>; + + /** + * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_setup + */ + confirmSetup(options: { + elements?: StripeElements; + clientSecret: string; + confirmParams: paymentIntents.ConfirmPaymentData; + redirect?: 'always'; + }): Promise<never | {error: StripeError}>; + + /** + * Use `stripe.confirmAcssDebitSetup` to [save details for future payments with pre-authorized debit in Canada](https://stripe.com/docs/payments/acss-debit/set-up-payment). + * When called, it will automatically pop up a modal to collect bank account details and verification, accept the mandate, and confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) when the user submits the form. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * `stripe.confirmAcssDebitSetup` automatically creates a new `PaymentMethod` for you when your customer completes the modal UI. + * It can also be called with an existing `PaymentMethod` which will load the modal UI to collect a new mandate agreement. + * If you have already attached a `PaymentMethod`, you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_acss_debit_setup + */ + confirmAcssDebitSetup( + clientSecret: string, + data?: setupIntents.ConfirmAcssDebitSetupData, + options?: setupIntents.ConfirmAcssDebitSetupOptions + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmUsBankAccountSetup` in the [Save bank details](https://stripe.com/docs/payments/ach-debit/set-up-payment) flow for the [ACH Direct Debit payment](https://stripe.com/docs/payments/ach-debit) method to record the customer’s authorization for future payments. + * + * When you confirm a [SetupIntent](https://stripe.com/docs/api/setup_intents), it needs to have an attached PaymentMethod. + * Use `stripe.collectBankAccountForSetup` to collect and attach a [PaymentMethod](https://stripe.com/docs/api/payment_methods), or provide bank account details using the `data` parameter if a `PaymentMethod` was not already provided. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_us_bank_account_setup + */ + confirmUsBankAccountSetup( + clientSecret: string, + data?: setupIntents.ConfirmUsBankAccountSetupData + ): Promise<SetupIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmAuBecsDebitSetup` in the [BECS Direct Debit with Setup Intents](https://stripe.com/docs/payments/payment-methods/au-becs-debit-quickstart-setup-intents) flow when the customer submits your payment form. + * When called, it will confirm the `SetupIntent` with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/payment-methods/au-becs-debit-quickstart-setup-intents) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_au_becs_debit_setup + */ + confirmAuBecsDebitSetup( + clientSecret: string, + data?: setupIntents.ConfirmAuBecsDebitSetupData + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmBacsDebitSetup` in the [Bacs Direct Debit Payments](https://stripe.com/docs/payments/payment-methods/bacs-debit) flow when the customer submits your payment form. + * When called, it will confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_bacs_debit_setup + */ + confirmBacsDebitSetup( + clientSecret: string, + data?: setupIntents.ConfirmBacsDebitSetupData + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmBancontactSetup` in the [Set up future payments](https://stripe.com/docs/payments/bancontact/set-up-payment) flow to use Bancontact bank details to set up a SEPA Direct Debit payment method for future payments. + * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/bancontact/set-up-payment) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_bancontact_setup + */ + confirmBancontactSetup( + clientSecret: string, + data?: setupIntents.ConfirmBancontactSetupData + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmCardSetup` in the [Setup Intents API flow](https://stripe.com/docs/payments/save-and-reuse) when the customer submits your payment form. + * When called, it will confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) with `data` you provide and carry out 3DS or other next actions if they are required. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_card_setup + */ + confirmCardSetup( + clientSecret: string, + data?: setupIntents.ConfirmCardSetupData, + options?: setupIntents.ConfirmCardSetupOptions + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmCashappSetup` in the [Setup Intents API flow](https://stripe.com/docs/payments/save-and-reuse) when the customer submits your payment form. + * When called, it will confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) with `data` you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/cash-app-pay) for more details.. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_cashapp_setup + */ + confirmCashappSetup( + clientSecret: string, + data?: setupIntents.ConfirmCashappSetupData, + options?: setupIntents.ConfirmCashappSetupOptions + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmIdealSetup` in the [Set up future payments](https://stripe.com/docs/payments/ideal/set-up-payment) flow to use iDEAL bank details to set up a SEPA Direct Debit payment method for future payments. + * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/ideal/set-up-payment) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_ideal_setup + */ + confirmIdealSetup( + clientSecret: string, + data?: setupIntents.ConfirmIdealSetupData + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmPayPalSetup` in the [Set up future payments](https://stripe.com/docs/payments/paypal/set-up-future-payments) flow when the customer submits your payment form. + * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/paypal/set-up-future-payments) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_paypal_setup + */ + confirmPayPalSetup( + clientSecret: string, + data?: setupIntents.ConfirmPayPalSetupData + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmSepaDebitSetup` in the [SEPA Direct Debit with Setup Intents](https://stripe.com/docs/payments/sepa-debit-setup-intents) flow when the customer submits your payment form. + * When called, it will confirm the `SetupIntent` with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/sepa-debit-setup-intents) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_sepa_debit_setup + */ + confirmSepaDebitSetup( + clientSecret: string, + data?: setupIntents.ConfirmSepaDebitSetupData + ): Promise<SetupIntentResult>; + + /* + * Use `stripe.confirmSofortSetup` in the [Set up future payments](https://stripe.com/docs/payments/sofort/set-up-payment) flow to use SOFORT bank details to set up a SEPA Direct Debit payment method for future payments. + * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/sofort/set-up-payment) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + */ + confirmSofortSetup( + clientSecret: string, + data?: setupIntents.ConfirmSofortSetupData, + options?: setupIntents.ConfirmSofortSetupOptions + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmAffirmPayment` in the [Affirm payments](https://stripe.com/docs/payments/affirm) flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents). + * Refer to our [integration guide](https://stripe.com/docs/payments/affirm/accept-a-payment) for more details. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_affirm_payment + */ + + confirmAffirmPayment( + clientSecret: string, + data?: paymentIntents.ConfirmAffirmPaymentData, + options?: paymentIntents.ConfirmAffirmPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmAfterpayClearpayPayment` in the [Afterpay / Clearpay payments](https://stripe.com/docs/payments/afterpay-clearpay) flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents). + * Refer to our [integration guide](https://stripe.com/docs/payments/afterpay-clearpay/accept-a-payment) for more details. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_afterpay_clearpay_payment + */ + + confirmAfterpayClearpayPayment( + clientSecret: string, + data?: paymentIntents.ConfirmAfterpayClearpayPaymentData, + options?: paymentIntents.ConfirmAfterpayClearpayPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.verifyMicrodepositsForSetup` in the [Save details for future payments with pre-authorized debit in Canada](https://stripe.com/docs/payments/acss-debit/set-up-payment) flow + * to verify customer's bank account with micro-deposits. + * + * @docs https://stripe.com/docs/js/payment_intents/verify_microdeposits_for_setup + */ + verifyMicrodepositsForSetup( + clientSecret: string, + data?: setupIntents.VerifyMicrodepositsForSetupData + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.collectBankAccountForSetup` in the [Save bank details](https://stripe.com/docs/payments/ach-debit/set-up-payment) flow for the [ACH Direct Debit](https://stripe.com/docs/payments/ach-debit) + * payment method to collect the customer’s bank account in your payment form. + * + * @docs https://stripe.com/docs/js/setup_intents/collect_bank_account_for_setup + */ + collectBankAccountForSetup( + options: setupIntents.CollectBankAccountForSetupOptions + ): Promise<SetupIntentResult>; + + /** + * Retrieve a [SetupIntent](https://stripe.com/docs/api/setup_intents) using its client secret. + * + * @docs https://stripe.com/docs/js/setup_intents/retrieve_setup_intent + */ + retrieveSetupIntent(clientSecret: string): Promise<SetupIntentResult>; + + ///////////////////////////// + /// Orders + /// + /// https://stripe.com/docs/js/orders + ///////////////////////////// + + /** + * Use `stripe.processOrder` to submit and confirm payment for an [Order](https://stripe.com/docs/api/orders_v2) using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.processOrder` will attempt to complete any required actions, such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * By default, `stripe.processOrder` will always redirect to your return_url after a successful confirmation. + * If you set `redirect: "if_required"`, then `stripe.processOrder` will only redirect if your user chooses a redirect-based method. + * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately. + * + * @docs https://stripe.com/docs/js/orders/process_order + */ + processOrder(options: { + elements: StripeElements; + confirmParams?: Partial<orders.ProcessOrderParams>; + redirect: 'if_required'; + }): Promise<ProcessOrderResult>; + + /** + * Use `stripe.processOrder` to submit and confirm payment for an [Order](https://stripe.com/docs/api/orders_v2) using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.processOrder` will attempt to complete any required actions, such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * @docs https://stripe.com/docs/js/orders/process_order + */ + processOrder(options: { + elements: StripeElements; + confirmParams: orders.ProcessOrderParams; + redirect?: 'always'; + }): Promise<never | {error: StripeError}>; + + /** + * Retrieve an [Order](https://stripe.com/docs/api/orders_v2) using its [client secret](https://stripe.com/docs/api/orders_v2/object#order_v2_object-client_secret). + * + * @docs https://stripe.com/docs/js/orders/retrieve_order + */ + retrieveOrder(clientSecret: string): Promise<RetrieveOrderResult>; + + ///////////////////////////// + /// Payment Request + /// + /// https://stripe.com/docs/js/payment_request + ///////////////////////////// + + /** + * Use `stripe.paymentRequest` to create a `PaymentRequest` object. + * Creating a `PaymentRequest` requires that you configure it with an `options` object. + * + * In Safari, `stripe.paymentRequest` uses Apple Pay, and in other browsers it uses the [Payment Request API standard](https://www.w3.org/TR/payment-request/). + */ + paymentRequest(options: PaymentRequestOptions): PaymentRequest; + + ///////////////////////////// + /// Token and Sources + /// + /// https://stripe.com/docs/js/tokens_sources + ///////////////////////////// + + /** + * Use `stripe.createToken` to convert information collected by an `IbanElement` into a single-use [Token](https://stripe.com/docs/api#tokens) that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=ibanElement + */ + createToken( + tokenType: elements.StripeIbanElement, + data: tokens.CreateTokenIbanData + ): Promise<TokenResult>; + + /** + * Use `stripe.createToken` to convert information collected by card elements into a single-use [Token](https://stripe.com/docs/api#tokens) that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=cardElement + */ + createToken( + tokenType: elements.StripeCardElement | elements.StripeCardNumberElement, + data?: tokens.CreateTokenCardData + ): Promise<TokenResult>; + + /** + * Use `stripe.createToken` to convert personally identifiable information (PII) into a single-use [Token](https://stripe.com/docs/api#tokens) for account identity verification. + * + * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=pii + */ + createToken( + tokenType: 'pii', + data: tokens.CreateTokenPiiData + ): Promise<TokenResult>; + + /** + * Use `stripe.createToken` to convert bank account information into a single-use token that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=bank_account + */ + createToken( + tokenType: 'bank_account', + data: tokens.CreateTokenBankAccountData + ): Promise<TokenResult>; + + /** + * Use `stripe.createToken` to tokenize the recollected CVC for a saved card. + + * First, render a `CardCvcElement` to collect the data. + * Then pass the `CardCvcElement` to `stripe.createToken` to tokenize the collected data. + * + * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=cvc_update + */ + createToken( + tokenType: 'cvc_update', + element: elements.StripeCardCvcElement + ): Promise<TokenResult>; + + /** + * Use `stripe.createToken` to create a single-use token that wraps a user’s legal entity information. + * Use this when creating or updating a Connect account. + * See the [account tokens documentation](https://stripe.com/docs/connect/account-tokens) to learn more. + */ + createToken( + tokenType: 'account', + data: api.TokenCreateParams.Account + ): Promise<TokenResult>; + + /** + * Use `stripe.createToken` to create a single-use token that represents the details for a person. + * Use this when creating or updating persons associated with a Connect account. + * See the [documentation](https://stripe.com/docs/connect/account-tokens) to learn more. + */ + createToken( + tokenType: 'person', + data: api.TokenCreateParams.Person + ): Promise<TokenResult>; + + /** + * Use `stripe.createSource` to convert payment information collected by elements into a `Source` object that you safely pass to your server to use in an API call. + * See the [Sources documentation](https://stripe.com/docs/sources) for more information about sources. + */ + createSource( + element: StripeElement, + sourceData: tokens.CreateSourceData + ): Promise<SourceResult>; + + /** + * Use `stripe.createSource` to convert raw payment information into a `Source` object that you safely pass to your server to use in an API call. + * See the [Sources documentation](https://stripe.com/docs/sources) for more information about sources. + */ + createSource(sourceData: tokens.CreateSourceData): Promise<SourceResult>; + + /** + * Retrieve a [Source](https://stripe.com/docs/api#sources) using its unique ID and client secret. + * + * @docs https://stripe.com/docs/js/tokens_sources/retrieve_source + */ + retrieveSource(source: tokens.RetrieveSourceParam): Promise<SourceResult>; + + ///////////////////////////// + /// Analytics + /// + ///////////////////////////// + + /** + * Use `stripe.registerAppInfo` to register a frontend open source library. + */ + registerAppInfo(wrapperLibrary: WrapperLibrary): void; + + ///////////////////////////// + /// Identity + /// + ///////////////////////////// + + /** + * Use `stripe.verifyIdentity` to display an [Identity](https://stripe.com/docs/identity) modal that securely collects verification information. + * + * * @docs https://stripe.com/docs/js/identity/modal + */ + verifyIdentity(clientSecret: string): Promise<VerificationSessionResult>; + + ///////////////////////////// + /// Financial Connections + /// + ///////////////////////////// + + /** + * Use `stripe.collectFinancialConnectionsAccounts` to display a [Financial Connections](https://stripe.com/docs/financial-connections) modal that lets you securely collect financial accounts. + * + * * @docs https://stripe.com/docs/js/financial_connections/collect_financial_connections_accounts + */ + collectFinancialConnectionsAccounts( + options: financialConnections.CollectFinancialConnectionsAccountsOptions + ): Promise<FinancialConnectionsSessionResult>; + + /** + * Use `stripe.collectBankAccountToken` to display a [Financial Connections](https://stripe.com/docs/financial-connections) modal that lets you securely collect a [Bank Account Token](https://stripe.com/docs/api/tokens/object). + * + * * @docs https://stripe.com/docs/js/financial_connections/collect_bank_account_token + */ + collectBankAccountToken( + options: financialConnections.CollectBankAccountTokenOptions + ): Promise<CollectBankAccountTokenResult>; + + /** + * Use `stripe.createEphemeralKeyNonce` to create an ephemeral key nonce that lets you securely create ephemeral keys + * + * * @docs https://stripe.com/docs/js/issuing/create_ephemeral_key_nonce + */ + createEphemeralKeyNonce( + options: ephemeralKeys.EphemeralKeyNonceOptions + ): Promise<EphemeralKeyNonceResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + initCustomCheckout( + options: StripeCustomCheckoutOptions + ): Promise<StripeCustomCheckout>; + + /** + * Use `stripe.initEmbeddedCheckout` to initialize an embedded Checkout instance + * + * * @docs https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=embedded-checkout + */ + initEmbeddedCheckout( + options: StripeEmbeddedCheckoutOptions + ): Promise<StripeEmbeddedCheckout>; +} + +export type PaymentIntentResult = + | {paymentIntent: api.PaymentIntent; error?: undefined} + | {paymentIntent?: undefined; error: StripeError}; + +export type SetupIntentResult = + | {setupIntent: api.SetupIntent; error?: undefined} + | {setupIntent?: undefined; error: StripeError}; + +export type PaymentIntentOrSetupIntentResult = + | { + paymentIntent: api.PaymentIntent; + setupIntent?: undefined; + error?: undefined; + } + | {paymentIntent?: undefined; setupIntent: api.SetupIntent; error?: undefined} + | {paymentIntent?: undefined; setupIntent?: undefined; error: StripeError}; + +export type ProcessOrderResult = + | {paymentIntent: api.PaymentIntent; order: api.Order; error?: undefined} + | {paymentIntent?: undefined; order: api.Order; error?: undefined} + | {paymentIntent?: undefined; order?: undefined; error: StripeError}; + +export type RetrieveOrderResult = + | {order: api.Order; error?: undefined} + | {order?: undefined; error: StripeError}; + +export type PaymentMethodResult = + | {paymentMethod: api.PaymentMethod; error?: undefined} + | {paymentMethod?: undefined; error: StripeError}; + +export type ConfirmationTokenResult = + | {confirmationToken: api.ConfirmationToken; error?: undefined} + | {confirmationToken?: undefined; error: StripeError}; + +export type SourceResult = + | {source: api.Source; error?: undefined} + | {source?: undefined; error: StripeError}; + +export type TokenResult = + | {token: api.Token; error?: undefined} + | {token?: undefined; error: StripeError}; + +export type VerificationSessionResult = + | {verificationSession: api.VerificationSession; error?: undefined} + | {verificationSession?: undefined; error: StripeError}; + +export type FinancialConnectionsSessionResult = + | { + financialConnectionsSession: api.FinancialConnectionsSession; + error?: undefined; + } + | {financialConnectionsSession: undefined; error: StripeError}; + +export type CollectBankAccountTokenResult = + | { + financialConnectionsSession: api.FinancialConnectionsSession; + token: api.BankAccountToken; + error?: undefined; + } + | { + financialConnectionsSession: undefined; + token: undefined; + error: StripeError; + }; + +export type EphemeralKeyNonceResult = + | {nonce: string; error?: undefined} + | {nonce?: undefined; error: StripeError}; + +/* A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments. + This metadata includes information like IP address, browser, screen or device information, and other device characteristics. + You can find more details about how Radar uses this data by reading about how Radar performs [advanced fraud detection](https://stripe.com/docs/disputes/prevention/advanced-fraud-detection). + */ +export type RadarSessionPayload = + | {radarSession: Record<any, any>; error?: undefined} + | {radarSession?: undefined; error: StripeError}; + +export interface WrapperLibrary { + /** + * Your library’s name, maximum length is 30 + */ + name: string; + + /** + * Required for Stripe Verified Partners, optional otherwise + * Your Partner ID from the Partners section of the Dashboard + */ + partner_id?: string; + + /** + * Your library's version, in the format of x.x.x + */ + version?: string; + + /** + * The URL for your library's website with your contact details + */ + url?: string; +} + +/** + * Use `Stripe(publishableKey, options?)` to create an instance of the `Stripe` object. + * The Stripe object is your entrypoint to the rest of the Stripe.js SDK. + * + * Your Stripe publishable [API key](https://stripe.com/docs/keys) is required when calling this function, as it identifies your website to Stripe. + * + * When you’re ready to accept live payments, replace the test key with your live key in production. + * Learn more about how API keys work in [test mode and live mode](https://stripe.com/docs/dashboard#viewing-test-data). + */ +export interface StripeConstructor { + ( + /** + * Your publishable key. + */ + publishableKey: string, + + /** + * Initialization options. + */ + options?: StripeConstructorOptions + ): Stripe; +} + +export interface StripeConstructorOptions { + /** + * For usage with [Connect](https://stripe.com/docs/connect) only. + * Specifying a connected account ID (e.g., `acct_24BFMpJ1svR5A89k`) allows you to perform actions on behalf of that account. + */ + stripeAccount?: string; + + /** + * Override your account's [API version](https://stripe.com/docs/api/versioning). + */ + apiVersion?: string; + + /** + * The [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) used to globally configure localization in Stripe.js. + * Setting the locale here will localize error strings for all Stripe.js methods. + * It will also configure the locale for [Elements](#element_mount) and [Checkout](https://stripe.com/docs/js/checkout/redirect_to_checkout). Default is `auto` (Stripe detects the locale of the browser). + * + * Supported values depend on which features you are using. + * Checkout supports a slightly different set of locales than the rest of Stripe.js. + * If you are planning on using Checkout, make sure to use a [value](#checkout_redirect_to_checkout-options-locale) that it supports. + */ + locale?: StripeElementLocale | CheckoutLocale; + + /** + * Opt-in to prerelease Stripe.js features by passing `betas` when instantiating a `Stripe` object. + * + * Supported values for the `betas` option can be found in integration guides for prerelease features. + * Most users of Stripe.js do not pass this option. + */ + betas?: string[]; +} + +export type StripeErrorType = + /** + * Failure to connect to Stripe's API. + */ + | 'api_connection_error' + + /** + * API errors cover any other type of problem (e.g., a temporary problem with Stripe's servers), and are extremely uncommon. + */ + | 'api_error' + + /** + * Failure to properly authenticate yourself in the request. + */ + | 'authentication_error' + + /** + * Card errors are the most common type of error you should expect to handle. + * They result when the user enters a card that can't be charged for some reason. + */ + | 'card_error' + + /** + * Idempotency errors occur when an `Idempotency-Key` is re-used on a request that does not match the first request's API endpoint and parameters. + */ + | 'idempotency_error' + + /** + * Invalid request errors arise when your request has invalid parameters. + */ + | 'invalid_request_error' + + /** + * Too many requests hit the API too quickly. + */ + | 'rate_limit_error' + + /** + * Errors triggered by our client-side libraries when failing to validate fields (e.g., when a card number or expiration date is invalid or incomplete). + */ + | 'validation_error'; + +export interface StripeError { + /** + * The type of error. + */ + type: StripeErrorType; + + /** + * For card errors, the ID of the failed charge + */ + charge?: string; + + /** + * For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + */ + code?: string; + + /** + * For card errors resulting from a card issuer decline, a short string indicating the [card issuer’s reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + */ + decline_code?: string; + + /** + * A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + */ + doc_url?: string; + + /** + * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + */ + message?: string; + + /** + * If the error is parameter-specific, the parameter related to the error. + * For example, you can use this to display a message near the correct form field. + */ + param?: string; + + /** + * The `PaymentIntent` object for errors returned on a request involving a `PaymentIntent`. + */ + payment_intent?: api.PaymentIntent; + + /** + * The `PaymentMethod` object for errors returned on a request involving a `PaymentMethod`. + */ + payment_method?: api.PaymentMethod; + + /** + * The `SetupIntent` object for errors returned on a request involving a `SetupIntent`. + */ + setup_intent?: api.SetupIntent; + + /** + * The `Source` object for errors returned on a request involving a `Source`. + */ + source?: api.Source; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/stripe.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/stripe.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e94088ed5c0b31637cbe4c20468657d0562e8688 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/stripe.d.ts @@ -0,0 +1,1486 @@ +import * as api from '../api'; +import * as paymentIntents from './payment-intents'; +import * as setupIntents from './setup-intents'; +import * as confirmationTokens from './confirmation-tokens'; +import * as orders from './orders'; +import * as tokens from './token-and-sources'; +import * as elements from './elements'; +import * as financialConnections from './financial-connections'; +import * as ephemeralKeys from './ephemeral-keys'; + +import { + StripeElements, + StripeElementsOptionsClientSecret, + StripeElementsOptionsMode, +} from './elements-group'; +import {CheckoutLocale, RedirectToCheckoutOptions} from './checkout'; +import {PaymentRequestOptions, PaymentRequest} from './payment-request'; +import {StripeElement, StripeElementLocale} from './elements-group'; +import { + StripeCustomCheckoutOptions, + StripeCustomCheckout, +} from './custom-checkout'; +import { + StripeEmbeddedCheckoutOptions, + StripeEmbeddedCheckout, +} from './embedded-checkout'; + +export interface Stripe { + ///////////////////////////// + /// Elements + /// + /// https://stripe.com/docs/js/elements_object + ///////////////////////////// + + /** + * Create an `Elements` instance, which manages a group of elements. + * + * https://stripe.com/docs/js/elements_object/create + */ + elements(options?: StripeElementsOptionsClientSecret): StripeElements; + + /** + * Create an `Elements` instance, which manages a group of elements. + * + * https://stripe.com/docs/js/elements_object/create_without_intent + */ + elements(options?: StripeElementsOptionsMode): StripeElements; + + ///////////////////////////// + /// Checkout + /// + /// https://stripe.com/docs/js/checkout + ///////////////////////////// + + /** + * Use `stripe.redirectToCheckout` to redirect your customers to [Checkout](https://stripe.com/docs/payments/checkout), a Stripe-hosted page to securely collect payment information. + * When the customer completes their purchase, they are redirected back to your website. + */ + redirectToCheckout( + options: RedirectToCheckoutOptions + ): Promise<never | {error: StripeError}>; + + ///////////////////////////// + /// Payment Intents + /// + /// https://stripe.com/docs/js/payment_intents + ///////////////////////////// + + /** + * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * By default, `stripe.confirmPayment` will always redirect to your return_url after a successful confirmation. + * If you set `redirect: "if_required"`, then `stripe.confirmPayment` will only redirect if your user chooses a redirect-based payment method. + * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_payment + */ + confirmPayment(options: { + elements: StripeElements; + confirmParams?: Partial<paymentIntents.ConfirmPaymentData>; + redirect: 'if_required'; + }): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * By default, `stripe.confirmPayment` will always redirect to your return_url after a successful confirmation. + * If you set `redirect: "if_required"`, then `stripe.confirmPayment` will only redirect if your user chooses a redirect-based payment method. + * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_payment + */ + confirmPayment(options: { + elements?: StripeElements; + clientSecret: string; + confirmParams?: Partial<paymentIntents.ConfirmPaymentData>; + redirect: 'if_required'; + }): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_payment + */ + confirmPayment(options: { + elements: StripeElements; + confirmParams: paymentIntents.ConfirmPaymentData; + redirect?: 'always'; + }): Promise<never | {error: StripeError}>; + + /** + * Use `stripe.confirmPayment` to confirm a PaymentIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmPayment` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_payment + */ + confirmPayment(options: { + elements?: StripeElements; + clientSecret: string; + confirmParams: paymentIntents.ConfirmPaymentData; + redirect?: 'always'; + }): Promise<never | {error: StripeError}>; + + /** + * Use `stripe.confirmAcssDebitPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow when the customer submits your payment form. + * When called, it will automatically pop up a modal to collect bank account details and verification, accept the mandate, and confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) when the user submits the form. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * `stripe.confirmAcssDebitPayment` automatically creates a new `PaymentMethod` for you when your customer completes the modal UI. + * It can also be called with an existing `PaymentMethod` which will load the modal UI to collect a new mandate agreement. + * If you have already attached a `PaymentMethod`, you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_acss_debit_payment + */ + confirmAcssDebitPayment( + clientSecret: string, + data?: paymentIntents.ConfirmAcssDebitPaymentData, + options?: paymentIntents.ConfirmAcssDebitPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmUsBankAccountPayment` in the [Accept a payment](https://stripe.com/docs/payments/ach-debit/accept-a-payment) flow for the [ACH Direct Debit]((https://stripe.com/docs/payments/ach-debit) payment method to record the customer’s authorization for payment. + * + * When you confirm a [PaymentIntent](https://stripe.com/docs/api/payment_intents), it needs to have an attached PaymentMethod. + * Use `stripe.collectBankAccountForPayment` to collect and attach a [PaymentMethod](https://stripe.com/docs/api/payment_methods), or provide bank account details using the `data` parameter if a `PaymentMethod` was not already provided. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_us_bank_account_payment + */ + confirmUsBankAccountPayment( + clientSecret: string, + data?: paymentIntents.ConfirmUsBankAccountPaymentData + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmAlipayPayment` in the [Alipay Payments](https://stripe.com/docs/payments/alipay) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_alipay_payment + */ + confirmAlipayPayment( + clientSecret: string, + data?: paymentIntents.ConfirmAlipayPaymentData, + options?: paymentIntents.ConfirmAlipayPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmAuBecsDebitPayment` in the [BECS Direct Debit Payments](https://stripe.com/docs/payments/payment-methods/au-becs-debit) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/payment-methods/au-becs-debit-quickstart-payment-intents) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_au_becs_debit_payment + */ + confirmAuBecsDebitPayment( + clientSecret: string, + data?: paymentIntents.ConfirmAuBecsDebitPaymentData + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmBancontactPayment` in the [Bancontact Payments with Payment Methods](https://stripe.com/docs/payments/bancontact#web) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_bancontact_payment + */ + confirmBancontactPayment( + clientSecret: string, + data?: paymentIntents.ConfirmBancontactPaymentData, + options?: paymentIntents.ConfirmBancontactPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmBlikPayment` in the [BLIK Payments with Payment Methods](https://stripe.com/docs/payments/blik) flow when the customer submits your payment form. + * When called, it will confirm the PaymentIntent with data you provide, and it will automatically prompt the customer to authorize the transaction. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_blik_payment + */ + confirmBlikPayment( + clientSecret: string, + data: paymentIntents.ConfirmBlikPaymentData, + options?: paymentIntents.ConfirmBlikPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmBoletoPayment` in the [Boleto Payment](https://stripe.com/docs/payments/boleto) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/boleto) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_boleto_payment + */ + confirmBoletoPayment( + clientSecret: string, + data?: paymentIntents.ConfirmBoletoPaymentData, + options?: paymentIntents.ConfirmBoletoPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmCardPayment` when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide and carry out 3DS or other next actions if they are required. + * + * If you are using [Dynamic 3D Secure](https://stripe.com/docs/payments/3d-secure#three-ds-radar), `stripe.confirmCardPayment` will trigger your Radar rules to execute and may open a dialog for your customer to authenticate their payment. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_card_payment + */ + confirmCardPayment( + clientSecret: string, + data?: paymentIntents.ConfirmCardPaymentData, + options?: paymentIntents.ConfirmCardPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmCashappPayment` in the [Cash App Payments](https://stripe.com/docs/payments/cash-app-pay) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/cash-app-pay) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_cashapp_payment + */ + confirmCashappPayment( + clientSecret: string, + data?: paymentIntents.ConfirmCashappPaymentData, + options?: paymentIntents.ConfirmCashappPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmCustomerBalancePayment` when the customer submits your payment form. + * + * When called, it will confirm the PaymentIntent with data you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/bank-transfers) for more details. + * + * Since the Customer Balance payment method draws from a balance, the attempt will succeed or fail depending on the current balance amount. To collect more funds from the customer when the cash balance is insufficient, use the customer balance with bank transfer funding parameters. + * The confirmation attempt will finish in one of the following result states: + * 1. If the customer balance was enough to pay the amount, the status is succeeded. The funding_type data is effectively ignored. + * 2. If the balance was not enough to pay the amount, and you didn't send the funding_type, the status is requires_payment_method. + * 3. If the balance was not enough to pay the amount, and you did send the funding_type, the status is requires_action. The paymentIntent.next_action.display_bank_transfer_instructions hash contains bank transfer details for funding the Customer Balance. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_customer_balance_payment + */ + confirmCustomerBalancePayment( + clientSecret: string, + data: paymentIntents.ConfirmCustomerBalancePaymentData, + options: paymentIntents.ConfirmCustomerBalancePaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmEpsPayment` in the [EPS Payments with Payment Methods](https://stripe.com/docs/payments/eps#web) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_eps_payment + */ + confirmEpsPayment( + clientSecret: string, + data?: paymentIntents.ConfirmEpsPaymentData, + options?: paymentIntents.ConfirmEpsPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmFpxPayment` in the [FPX Payments with Payment Methods](https://stripe.com/docs/payments/fpx#web) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_fpx_payment + */ + confirmFpxPayment( + clientSecret: string, + data?: paymentIntents.ConfirmFpxPaymentData, + options?: paymentIntents.ConfirmFpxPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmGiropayPayment` in the [giropay Payments with Payment Methods](https://stripe.com/docs/payments/giropay#web) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_giropay_payment + */ + confirmGiropayPayment( + clientSecret: string, + data?: paymentIntents.ConfirmGiropayPaymentData, + options?: paymentIntents.ConfirmGiropayPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmGrabPayPayment` in the [GrabPay payments](https://stripe.com/docs/payments/grabpay) flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents). + * Refer to our [integration guide](https://stripe.com/docs/payments/grabpay/accept-a-payment) for more details. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_grabpay_payment + */ + + confirmGrabPayPayment( + clientSecret: string, + data?: paymentIntents.ConfirmGrabPayPaymentData, + options?: paymentIntents.ConfirmGrabPayPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmIdealPayment` in the [iDEAL Payments with Payment Methods](https://stripe.com/docs/payments/ideal) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_ideal_payment + */ + confirmIdealPayment( + clientSecret: string, + data?: paymentIntents.ConfirmIdealPaymentData, + options?: paymentIntents.ConfirmIdealPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmKlarnaPayment` in the [Klarna Payments](https://stripe.com/docs/payments/klarna) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_klarna_payment + */ + confirmKlarnaPayment( + clientSecret: string, + data?: paymentIntents.ConfirmKlarnaPaymentData, + options?: paymentIntents.ConfirmKlarnaPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmKonbiniPayment` in the [Konbini](https://stripe.com/docs/payments/konbini) payment flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/konbini/accept-a-payment) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_konbini_payment + */ + confirmKonbiniPayment( + clientSecret: string, + data?: paymentIntents.ConfirmKonbiniPaymentData, + options?: paymentIntents.ConfirmKonbiniPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmOxxoPayment` in the [OXXO Payment](https://stripe.com/docs/payments/oxxo) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/oxxo) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_oxxo_payment + */ + confirmOxxoPayment( + clientSecret: string, + data?: paymentIntents.ConfirmOxxoPaymentData, + options?: paymentIntents.ConfirmOxxoPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmP24Payment` in the [Przelewy24 Payments with Payment Methods](https://stripe.com/docs/payments/p24#web) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_p24_payment + */ + confirmP24Payment( + clientSecret: string, + data?: paymentIntents.ConfirmP24PaymentData, + options?: paymentIntents.ConfirmP24PaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmPayNowPayment` in the [PayNow Payments](https://stripe.com/docs/payments/paynow) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/paynow) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + */ + confirmPayNowPayment( + clientSecret: string, + data?: paymentIntents.ConfirmPayNowPaymentData, + options?: paymentIntents.ConfirmPayNowPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmPayPalPayment` in the [PayPal Payments](https://stripe.com/docs/payments/paypal) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_paypal_payment + */ + confirmPayPalPayment( + clientSecret: string, + data?: paymentIntents.ConfirmPayPalPaymentData + ): Promise<PaymentIntentResult>; + + /** + + * Use `stripe.confirmPixPayment` in the [Pix Payments](https://stripe.com/docs/payments/pix) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/pix) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_pix_payment + */ + confirmPixPayment( + clientSecret: string, + data?: paymentIntents.ConfirmPixPaymentData, + options?: paymentIntents.ConfirmPixPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmPromptPayPayment` in the [PromptPay Payments](https://stripe.com/docs/payments/promptpay) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/promptpay) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + */ + confirmPromptPayPayment( + clientSecret: string, + data?: paymentIntents.ConfirmPromptPayPaymentData, + options?: paymentIntents.ConfirmPromptPayPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmSepaDebitPayment` in the [SEPA Direct Debit Payments](https://stripe.com/docs/payments/sepa-debit) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/sepa-debit) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_sepa_debit_payment + */ + confirmSepaDebitPayment( + clientSecret: string, + data?: paymentIntents.ConfirmSepaDebitPaymentData + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmSofortPayment` in the [Sofort Payments with Payment Methods](https://stripe.com/docs/payments/sofort) flow when the customer submits your payment form. + * When called, it will confirm the `PaymentIntent` with `data` you provide. It will then automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_sofort_payment + */ + confirmSofortPayment( + clientSecret: string, + data?: paymentIntents.ConfirmSofortPaymentData, + options?: paymentIntents.ConfirmSofortPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmWechatPayPayment` in the [Wechat Pay Payments](https://stripe.com/docs/payments/wechat-pay) with Payment Methods flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents) with `data` you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/wechat-pay/accept-a-payment) for more details. + * + * When you confirm a `PaymentIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `PaymentIntent`, this method can automatically create and attach a new PaymentMethod for you. + * If you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_wechat_pay_payment + */ + confirmWechatPayPayment( + clientSecret: string, + data?: paymentIntents.ConfirmWechatPayPaymentData, + options?: paymentIntents.ConfirmWechatPayPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.handleCardAction` in the Payment Intents API [manual confirmation](https://stripe.com/docs/payments/payment-intents/web-manual) flow to handle a [PaymentIntent](https://stripe.com/docs/api/payment_intents) with the `requires_action` status. + * It will throw an error if the `PaymentIntent` has a different status. + * + * Note that `stripe.handleCardAction` may take several seconds to complete. + * During that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner. + * If you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator. + * + * Additionally, `stripe.handleCardAction` may trigger a [3D Secure](https://stripe.com/docs/payments/3d-secure) authentication challenge. + * The authentication challenge requires a context switch that can be hard to follow on a screen-reader. + * Ensure that your form is accessible by ensuring that success or error messages are clearly read out. + * + * @docs https://stripe.com/docs/js/payment_intents/handle_card_action + */ + handleCardAction(clientSecret: string): Promise<PaymentIntentResult>; + + /** + * Use `stripe.handleNextAction` in the [finalizing payments on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server) flow to finish confirmation of a [PaymentIntent](https://stripe.com/docs/api/payment_intents) or [SetupIntent](https://stripe.com/docs/api/setup_intents) with the `requires_action` status. + * It will throw an error if the `PaymentIntent` or `SetupIntent` has a different status. + * + * Note that `stripe.handleNextAction` may take several seconds to complete. + * During that time, you should disable your form from being resubmitted and show a waiting indicator like a spinner. + * If you receive an error result, you should be sure to show that error to the customer, re-enable the form, and hide the waiting indicator. + * + * Additionally, `stripe.handleNextAction` may trigger a [3D Secure](https://stripe.com/docs/payments/3d-secure) authentication challenge. + * The authentication challenge requires a context switch that can be hard to follow on a screen-reader. + * Ensure that your form is accessible by ensuring that success or error messages are clearly read out. + * + * @docs https://stripe.com/docs/js/payment_intents/handle_next_action + */ + handleNextAction(options: { + clientSecret: string; + }): Promise<PaymentIntentOrSetupIntentResult>; + + /** + * Use `stripe.verifyMicrodepositsForPayment` in the [Accept a Canadian pre-authorized debit payment](https://stripe.com/docs/payments/acss-debit/accept-a-payment) flow + * to verify a customer's bank account with micro-deposits. + * + * @docs https://stripe.com/docs/js/payment_intents/verify_microdeposits_for_payment + */ + verifyMicrodepositsForPayment( + clientSecret: string, + data?: paymentIntents.VerifyMicrodepositsForPaymentData + ): Promise<PaymentIntentResult>; + + /** + * Use stripe.createRadarSession to create a [Radar Session](https://stripe.com/docs/radar/radar-session) in your checkout flow or when saving card details. + * A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments. + * This metadata includes information like IP address, browser, screen or device information, and other device characteristics. + * By using Radar Sessions, you can capture critical fraud information without tokenizing on Stripe. + */ + createRadarSession(): Promise<RadarSessionPayload>; + + /** + * Use `stripe.collectBankAccountForPayment` in the [Accept a payment flow](https://stripe.com/docs/payments/ach-debit/accept-a-payment) for the [ACH Direct Debit](https://stripe.com/docs/payments/ach-debit) + * payment method to collect the customer’s bank account in your payment form. + * + * @docs https://stripe.com/docs/js/payment_intents/collect_bank_account_for_payment + */ + collectBankAccountForPayment( + options: paymentIntents.CollectBankAccountForPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/payment_methods/create_payment_method + */ + createPaymentMethod( + paymentMethodData: paymentIntents.CreatePaymentMethodData + ): Promise<PaymentMethodResult>; + + /** + * Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/payment_methods/create_payment_method_elements + */ + createPaymentMethod( + options: paymentIntents.CreatePaymentMethodFromElements + ): Promise<PaymentMethodResult>; + + /** + * Use stripe.createPaymentMethod to convert payment information collected by elements into a [PaymentMethod](https://stripe.com/docs/api/payment_methods) object that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/payment_methods/create_payment_method_elements + */ + createPaymentMethod( + options: paymentIntents.CreatePaymentMethodFromElement + ): Promise<PaymentMethodResult>; + + /** + * Use stripe.createConfirmationToken to convert payment information collected by elements into a [ConfirmationToken](https://stripe.com/docs/api/confirmation_tokens) object that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/confirmation_tokens/create_confirmation_token + */ + createConfirmationToken( + options: confirmationTokens.CreateConfirmationToken + ): Promise<ConfirmationTokenResult>; + + /** + * Retrieve a [PaymentIntent](https://stripe.com/docs/api/payment_intents) using its [client secret](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-client_secret). + * + * @docs https://stripe.com/docs/js/payment_intents/retrieve_payment_intent + */ + retrievePaymentIntent(clientSecret: string): Promise<PaymentIntentResult>; + + ///////////////////////////// + /// Setup Intents + /// + /// https://stripe.com/docs/js/setup_intents + ///////////////////////////// + + /** + * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * By default, stripe.`confirmSetup` will always redirect to your return_url after a successful confirmation. + * If you set `redirect: "if_required"`, then `stripe.confirmSetup` will only redirect if your user chooses a redirect-based payment method. + * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_setup + */ + confirmSetup(options: { + elements: StripeElements; + confirmParams?: Partial<paymentIntents.ConfirmPaymentData>; + redirect: 'if_required'; + }): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * By default, stripe.`confirmSetup` will always redirect to your return_url after a successful confirmation. + * If you set `redirect: "if_required"`, then `stripe.confirmSetup` will only redirect if your user chooses a redirect-based payment method. + * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_setup + */ + confirmSetup(options: { + elements?: StripeElements; + clientSecret: string; + confirmParams?: Partial<paymentIntents.ConfirmPaymentData>; + redirect: 'if_required'; + }): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_setup + */ + confirmSetup(options: { + elements: StripeElements; + confirmParams: paymentIntents.ConfirmPaymentData; + redirect?: 'always'; + }): Promise<never | {error: StripeError}>; + + /** + * Use `stripe.confirmSetup` to confirm a SetupIntent using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.confirmSetup` will attempt to complete any [required actions](https://stripe.com/docs/payments/intents), such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_setup + */ + confirmSetup(options: { + elements?: StripeElements; + clientSecret: string; + confirmParams: paymentIntents.ConfirmPaymentData; + redirect?: 'always'; + }): Promise<never | {error: StripeError}>; + + /** + * Use `stripe.confirmAcssDebitSetup` to [save details for future payments with pre-authorized debit in Canada](https://stripe.com/docs/payments/acss-debit/set-up-payment). + * When called, it will automatically pop up a modal to collect bank account details and verification, accept the mandate, and confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) when the user submits the form. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * `stripe.confirmAcssDebitSetup` automatically creates a new `PaymentMethod` for you when your customer completes the modal UI. + * It can also be called with an existing `PaymentMethod` which will load the modal UI to collect a new mandate agreement. + * If you have already attached a `PaymentMethod`, you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_acss_debit_setup + */ + confirmAcssDebitSetup( + clientSecret: string, + data?: setupIntents.ConfirmAcssDebitSetupData, + options?: setupIntents.ConfirmAcssDebitSetupOptions + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmUsBankAccountSetup` in the [Save bank details](https://stripe.com/docs/payments/ach-debit/set-up-payment) flow for the [ACH Direct Debit payment](https://stripe.com/docs/payments/ach-debit) method to record the customer’s authorization for future payments. + * + * When you confirm a [SetupIntent](https://stripe.com/docs/api/setup_intents), it needs to have an attached PaymentMethod. + * Use `stripe.collectBankAccountForSetup` to collect and attach a [PaymentMethod](https://stripe.com/docs/api/payment_methods), or provide bank account details using the `data` parameter if a `PaymentMethod` was not already provided. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_us_bank_account_setup + */ + confirmUsBankAccountSetup( + clientSecret: string, + data?: setupIntents.ConfirmUsBankAccountSetupData + ): Promise<SetupIntentResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + * + * Use `stripe.confirmAuBecsDebitSetup` in the [BECS Direct Debit with Setup Intents](https://stripe.com/docs/payments/payment-methods/au-becs-debit-quickstart-setup-intents) flow when the customer submits your payment form. + * When called, it will confirm the `SetupIntent` with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/payment-methods/au-becs-debit-quickstart-setup-intents) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_au_becs_debit_setup + */ + confirmAuBecsDebitSetup( + clientSecret: string, + data?: setupIntents.ConfirmAuBecsDebitSetupData + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmBacsDebitSetup` in the [Bacs Direct Debit Payments](https://stripe.com/docs/payments/payment-methods/bacs-debit) flow when the customer submits your payment form. + * When called, it will confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_bacs_debit_setup + */ + confirmBacsDebitSetup( + clientSecret: string, + data?: setupIntents.ConfirmBacsDebitSetupData + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmBancontactSetup` in the [Set up future payments](https://stripe.com/docs/payments/bancontact/set-up-payment) flow to use Bancontact bank details to set up a SEPA Direct Debit payment method for future payments. + * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/bancontact/set-up-payment) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_bancontact_setup + */ + confirmBancontactSetup( + clientSecret: string, + data?: setupIntents.ConfirmBancontactSetupData + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmCardSetup` in the [Setup Intents API flow](https://stripe.com/docs/payments/save-and-reuse) when the customer submits your payment form. + * When called, it will confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) with `data` you provide and carry out 3DS or other next actions if they are required. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_card_setup + */ + confirmCardSetup( + clientSecret: string, + data?: setupIntents.ConfirmCardSetupData, + options?: setupIntents.ConfirmCardSetupOptions + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmCashappSetup` in the [Setup Intents API flow](https://stripe.com/docs/payments/save-and-reuse) when the customer submits your payment form. + * When called, it will confirm the [SetupIntent](https://stripe.com/docs/api/setup_intents) with `data` you provide. + * Refer to our [integration guide](https://stripe.com/docs/payments/cash-app-pay) for more details.. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_cashapp_setup + */ + confirmCashappSetup( + clientSecret: string, + data?: setupIntents.ConfirmCashappSetupData, + options?: setupIntents.ConfirmCashappSetupOptions + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmIdealSetup` in the [Set up future payments](https://stripe.com/docs/payments/ideal/set-up-payment) flow to use iDEAL bank details to set up a SEPA Direct Debit payment method for future payments. + * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/ideal/set-up-payment) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_ideal_setup + */ + confirmIdealSetup( + clientSecret: string, + data?: setupIntents.ConfirmIdealSetupData + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmPayPalSetup` in the [Set up future payments](https://stripe.com/docs/payments/paypal/set-up-future-payments) flow when the customer submits your payment form. + * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/paypal/set-up-future-payments) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_paypal_setup + */ + confirmPayPalSetup( + clientSecret: string, + data?: setupIntents.ConfirmPayPalSetupData + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmSepaDebitSetup` in the [SEPA Direct Debit with Setup Intents](https://stripe.com/docs/payments/sepa-debit-setup-intents) flow when the customer submits your payment form. + * When called, it will confirm the `SetupIntent` with `data` you provide. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/sepa-debit-setup-intents) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + * + * @docs https://stripe.com/docs/js/setup_intents/confirm_sepa_debit_setup + */ + confirmSepaDebitSetup( + clientSecret: string, + data?: setupIntents.ConfirmSepaDebitSetupData + ): Promise<SetupIntentResult>; + + /* + * Use `stripe.confirmSofortSetup` in the [Set up future payments](https://stripe.com/docs/payments/sofort/set-up-payment) flow to use SOFORT bank details to set up a SEPA Direct Debit payment method for future payments. + * When called, it will confirm a `SetupIntent` with `data` you provide, and it will automatically redirect the customer to authorize the transaction. + * Once authorization is complete, the customer will be redirected back to your specified `return_url`. + * Note that there are some additional requirements to this flow that are not covered in this reference. + * Refer to our [integration guide](https://stripe.com/docs/payments/sofort/set-up-payment) for more details. + * + * When you confirm a `SetupIntent`, it needs to have an attached [PaymentMethod](https://stripe.com/docs/api/payment_methods). + * In addition to confirming the `SetupIntent`, this method can automatically create and attach a new `PaymentMethod` for you. + * It can also be called with an existing `PaymentMethod`, or if you have already attached a `PaymentMethod` you can call this method without needing to provide any additional data. + */ + confirmSofortSetup( + clientSecret: string, + data?: setupIntents.ConfirmSofortSetupData, + options?: setupIntents.ConfirmSofortSetupOptions + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.confirmAffirmPayment` in the [Affirm payments](https://stripe.com/docs/payments/affirm) flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents). + * Refer to our [integration guide](https://stripe.com/docs/payments/affirm/accept-a-payment) for more details. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_affirm_payment + */ + + confirmAffirmPayment( + clientSecret: string, + data?: paymentIntents.ConfirmAffirmPaymentData, + options?: paymentIntents.ConfirmAffirmPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.confirmAfterpayClearpayPayment` in the [Afterpay / Clearpay payments](https://stripe.com/docs/payments/afterpay-clearpay) flow when the customer submits your payment form. + * When called, it will confirm the [PaymentIntent](https://stripe.com/docs/api/payment_intents). + * Refer to our [integration guide](https://stripe.com/docs/payments/afterpay-clearpay/accept-a-payment) for more details. + * + * @docs https://stripe.com/docs/js/payment_intents/confirm_afterpay_clearpay_payment + */ + + confirmAfterpayClearpayPayment( + clientSecret: string, + data?: paymentIntents.ConfirmAfterpayClearpayPaymentData, + options?: paymentIntents.ConfirmAfterpayClearpayPaymentOptions + ): Promise<PaymentIntentResult>; + + /** + * Use `stripe.verifyMicrodepositsForSetup` in the [Save details for future payments with pre-authorized debit in Canada](https://stripe.com/docs/payments/acss-debit/set-up-payment) flow + * to verify customer's bank account with micro-deposits. + * + * @docs https://stripe.com/docs/js/payment_intents/verify_microdeposits_for_setup + */ + verifyMicrodepositsForSetup( + clientSecret: string, + data?: setupIntents.VerifyMicrodepositsForSetupData + ): Promise<SetupIntentResult>; + + /** + * Use `stripe.collectBankAccountForSetup` in the [Save bank details](https://stripe.com/docs/payments/ach-debit/set-up-payment) flow for the [ACH Direct Debit](https://stripe.com/docs/payments/ach-debit) + * payment method to collect the customer’s bank account in your payment form. + * + * @docs https://stripe.com/docs/js/setup_intents/collect_bank_account_for_setup + */ + collectBankAccountForSetup( + options: setupIntents.CollectBankAccountForSetupOptions + ): Promise<SetupIntentResult>; + + /** + * Retrieve a [SetupIntent](https://stripe.com/docs/api/setup_intents) using its client secret. + * + * @docs https://stripe.com/docs/js/setup_intents/retrieve_setup_intent + */ + retrieveSetupIntent(clientSecret: string): Promise<SetupIntentResult>; + + ///////////////////////////// + /// Orders + /// + /// https://stripe.com/docs/js/orders + ///////////////////////////// + + /** + * Use `stripe.processOrder` to submit and confirm payment for an [Order](https://stripe.com/docs/api/orders_v2) using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.processOrder` will attempt to complete any required actions, such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * By default, `stripe.processOrder` will always redirect to your return_url after a successful confirmation. + * If you set `redirect: "if_required"`, then `stripe.processOrder` will only redirect if your user chooses a redirect-based method. + * Setting `if_required` requires that you handle successful confirmations for redirect-based and non-redirect based payment methods separately. + * + * @docs https://stripe.com/docs/js/orders/process_order + */ + processOrder(options: { + elements: StripeElements; + confirmParams?: Partial<orders.ProcessOrderParams>; + redirect: 'if_required'; + }): Promise<ProcessOrderResult>; + + /** + * Use `stripe.processOrder` to submit and confirm payment for an [Order](https://stripe.com/docs/api/orders_v2) using data collected by the [Payment Element](https://stripe.com/docs/js/element/payment_element). + * When called, `stripe.processOrder` will attempt to complete any required actions, such as authenticating your user by displaying a 3DS dialog or redirecting them to a bank authorization page. + * Your user will be redirected to the return_url you pass once the confirmation is complete. + * + * @docs https://stripe.com/docs/js/orders/process_order + */ + processOrder(options: { + elements: StripeElements; + confirmParams: orders.ProcessOrderParams; + redirect?: 'always'; + }): Promise<never | {error: StripeError}>; + + /** + * Retrieve an [Order](https://stripe.com/docs/api/orders_v2) using its [client secret](https://stripe.com/docs/api/orders_v2/object#order_v2_object-client_secret). + * + * @docs https://stripe.com/docs/js/orders/retrieve_order + */ + retrieveOrder(clientSecret: string): Promise<RetrieveOrderResult>; + + ///////////////////////////// + /// Payment Request + /// + /// https://stripe.com/docs/js/payment_request + ///////////////////////////// + + /** + * Use `stripe.paymentRequest` to create a `PaymentRequest` object. + * Creating a `PaymentRequest` requires that you configure it with an `options` object. + * + * In Safari, `stripe.paymentRequest` uses Apple Pay, and in other browsers it uses the [Payment Request API standard](https://www.w3.org/TR/payment-request/). + */ + paymentRequest(options: PaymentRequestOptions): PaymentRequest; + + ///////////////////////////// + /// Token and Sources + /// + /// https://stripe.com/docs/js/tokens_sources + ///////////////////////////// + + /** + * Use `stripe.createToken` to convert information collected by an `IbanElement` into a single-use [Token](https://stripe.com/docs/api#tokens) that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=ibanElement + */ + createToken( + tokenType: elements.StripeIbanElement, + data: tokens.CreateTokenIbanData + ): Promise<TokenResult>; + + /** + * Use `stripe.createToken` to convert information collected by card elements into a single-use [Token](https://stripe.com/docs/api#tokens) that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=cardElement + */ + createToken( + tokenType: elements.StripeCardElement | elements.StripeCardNumberElement, + data?: tokens.CreateTokenCardData + ): Promise<TokenResult>; + + /** + * Use `stripe.createToken` to convert personally identifiable information (PII) into a single-use [Token](https://stripe.com/docs/api#tokens) for account identity verification. + * + * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=pii + */ + createToken( + tokenType: 'pii', + data: tokens.CreateTokenPiiData + ): Promise<TokenResult>; + + /** + * Use `stripe.createToken` to convert bank account information into a single-use token that you safely pass to your server to use in an API call. + * + * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=bank_account + */ + createToken( + tokenType: 'bank_account', + data: tokens.CreateTokenBankAccountData + ): Promise<TokenResult>; + + /** + * Use `stripe.createToken` to tokenize the recollected CVC for a saved card. + + * First, render a `CardCvcElement` to collect the data. + * Then pass the `CardCvcElement` to `stripe.createToken` to tokenize the collected data. + * + * @docs https://stripe.com/docs/js/tokens_sources/create_token?type=cvc_update + */ + createToken( + tokenType: 'cvc_update', + element: elements.StripeCardCvcElement + ): Promise<TokenResult>; + + /** + * Use `stripe.createToken` to create a single-use token that wraps a user’s legal entity information. + * Use this when creating or updating a Connect account. + * See the [account tokens documentation](https://stripe.com/docs/connect/account-tokens) to learn more. + */ + createToken( + tokenType: 'account', + data: api.TokenCreateParams.Account + ): Promise<TokenResult>; + + /** + * Use `stripe.createToken` to create a single-use token that represents the details for a person. + * Use this when creating or updating persons associated with a Connect account. + * See the [documentation](https://stripe.com/docs/connect/account-tokens) to learn more. + */ + createToken( + tokenType: 'person', + data: api.TokenCreateParams.Person + ): Promise<TokenResult>; + + /** + * Use `stripe.createSource` to convert payment information collected by elements into a `Source` object that you safely pass to your server to use in an API call. + * See the [Sources documentation](https://stripe.com/docs/sources) for more information about sources. + */ + createSource( + element: StripeElement, + sourceData: tokens.CreateSourceData + ): Promise<SourceResult>; + + /** + * Use `stripe.createSource` to convert raw payment information into a `Source` object that you safely pass to your server to use in an API call. + * See the [Sources documentation](https://stripe.com/docs/sources) for more information about sources. + */ + createSource(sourceData: tokens.CreateSourceData): Promise<SourceResult>; + + /** + * Retrieve a [Source](https://stripe.com/docs/api#sources) using its unique ID and client secret. + * + * @docs https://stripe.com/docs/js/tokens_sources/retrieve_source + */ + retrieveSource(source: tokens.RetrieveSourceParam): Promise<SourceResult>; + + ///////////////////////////// + /// Analytics + /// + ///////////////////////////// + + /** + * Use `stripe.registerAppInfo` to register a frontend open source library. + */ + registerAppInfo(wrapperLibrary: WrapperLibrary): void; + + ///////////////////////////// + /// Identity + /// + ///////////////////////////// + + /** + * Use `stripe.verifyIdentity` to display an [Identity](https://stripe.com/docs/identity) modal that securely collects verification information. + * + * * @docs https://stripe.com/docs/js/identity/modal + */ + verifyIdentity(clientSecret: string): Promise<VerificationSessionResult>; + + ///////////////////////////// + /// Financial Connections + /// + ///////////////////////////// + + /** + * Use `stripe.collectFinancialConnectionsAccounts` to display a [Financial Connections](https://stripe.com/docs/financial-connections) modal that lets you securely collect financial accounts. + * + * * @docs https://stripe.com/docs/js/financial_connections/collect_financial_connections_accounts + */ + collectFinancialConnectionsAccounts( + options: financialConnections.CollectFinancialConnectionsAccountsOptions + ): Promise<FinancialConnectionsSessionResult>; + + /** + * Use `stripe.collectBankAccountToken` to display a [Financial Connections](https://stripe.com/docs/financial-connections) modal that lets you securely collect a [Bank Account Token](https://stripe.com/docs/api/tokens/object). + * + * * @docs https://stripe.com/docs/js/financial_connections/collect_bank_account_token + */ + collectBankAccountToken( + options: financialConnections.CollectBankAccountTokenOptions + ): Promise<CollectBankAccountTokenResult>; + + /** + * Use `stripe.createEphemeralKeyNonce` to create an ephemeral key nonce that lets you securely create ephemeral keys + * + * * @docs https://stripe.com/docs/js/issuing/create_ephemeral_key_nonce + */ + createEphemeralKeyNonce( + options: ephemeralKeys.EphemeralKeyNonceOptions + ): Promise<EphemeralKeyNonceResult>; + + /** + * Requires beta access: + * Contact [Stripe support](https://support.stripe.com/) for more information. + */ + initCustomCheckout( + options: StripeCustomCheckoutOptions + ): Promise<StripeCustomCheckout>; + + /** + * Use `stripe.initEmbeddedCheckout` to initialize an embedded Checkout instance + * + * * @docs https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=embedded-checkout + */ + initEmbeddedCheckout( + options: StripeEmbeddedCheckoutOptions + ): Promise<StripeEmbeddedCheckout>; +} + +export type PaymentIntentResult = + | {paymentIntent: api.PaymentIntent; error?: undefined} + | {paymentIntent?: undefined; error: StripeError}; + +export type SetupIntentResult = + | {setupIntent: api.SetupIntent; error?: undefined} + | {setupIntent?: undefined; error: StripeError}; + +export type PaymentIntentOrSetupIntentResult = + | { + paymentIntent: api.PaymentIntent; + setupIntent?: undefined; + error?: undefined; + } + | {paymentIntent?: undefined; setupIntent: api.SetupIntent; error?: undefined} + | {paymentIntent?: undefined; setupIntent?: undefined; error: StripeError}; + +export type ProcessOrderResult = + | {paymentIntent: api.PaymentIntent; order: api.Order; error?: undefined} + | {paymentIntent?: undefined; order: api.Order; error?: undefined} + | {paymentIntent?: undefined; order?: undefined; error: StripeError}; + +export type RetrieveOrderResult = + | {order: api.Order; error?: undefined} + | {order?: undefined; error: StripeError}; + +export type PaymentMethodResult = + | {paymentMethod: api.PaymentMethod; error?: undefined} + | {paymentMethod?: undefined; error: StripeError}; + +export type ConfirmationTokenResult = + | {confirmationToken: api.ConfirmationToken; error?: undefined} + | {confirmationToken?: undefined; error: StripeError}; + +export type SourceResult = + | {source: api.Source; error?: undefined} + | {source?: undefined; error: StripeError}; + +export type TokenResult = + | {token: api.Token; error?: undefined} + | {token?: undefined; error: StripeError}; + +export type VerificationSessionResult = + | {verificationSession: api.VerificationSession; error?: undefined} + | {verificationSession?: undefined; error: StripeError}; + +export type FinancialConnectionsSessionResult = + | { + financialConnectionsSession: api.FinancialConnectionsSession; + error?: undefined; + } + | {financialConnectionsSession: undefined; error: StripeError}; + +export type CollectBankAccountTokenResult = + | { + financialConnectionsSession: api.FinancialConnectionsSession; + token: api.BankAccountToken; + error?: undefined; + } + | { + financialConnectionsSession: undefined; + token: undefined; + error: StripeError; + }; + +export type EphemeralKeyNonceResult = + | {nonce: string; error?: undefined} + | {nonce?: undefined; error: StripeError}; + +/* A Radar Session is a snapshot of the browser metadata and device details that helps Radar make more accurate predictions on your payments. + This metadata includes information like IP address, browser, screen or device information, and other device characteristics. + You can find more details about how Radar uses this data by reading about how Radar performs [advanced fraud detection](https://stripe.com/docs/disputes/prevention/advanced-fraud-detection). + */ +export type RadarSessionPayload = + | {radarSession: Record<any, any>; error?: undefined} + | {radarSession?: undefined; error: StripeError}; + +export interface WrapperLibrary { + /** + * Your library’s name, maximum length is 30 + */ + name: string; + + /** + * Required for Stripe Verified Partners, optional otherwise + * Your Partner ID from the Partners section of the Dashboard + */ + partner_id?: string; + + /** + * Your library's version, in the format of x.x.x + */ + version?: string; + + /** + * The URL for your library's website with your contact details + */ + url?: string; +} + +/** + * Use `Stripe(publishableKey, options?)` to create an instance of the `Stripe` object. + * The Stripe object is your entrypoint to the rest of the Stripe.js SDK. + * + * Your Stripe publishable [API key](https://stripe.com/docs/keys) is required when calling this function, as it identifies your website to Stripe. + * + * When you’re ready to accept live payments, replace the test key with your live key in production. + * Learn more about how API keys work in [test mode and live mode](https://stripe.com/docs/dashboard#viewing-test-data). + */ +export interface StripeConstructor { + ( + /** + * Your publishable key. + */ + publishableKey: string, + + /** + * Initialization options. + */ + options?: StripeConstructorOptions + ): Stripe; +} + +export interface StripeConstructorOptions { + /** + * For usage with [Connect](https://stripe.com/docs/connect) only. + * Specifying a connected account ID (e.g., `acct_24BFMpJ1svR5A89k`) allows you to perform actions on behalf of that account. + */ + stripeAccount?: string; + + /** + * Override your account's [API version](https://stripe.com/docs/api/versioning). + */ + apiVersion?: string; + + /** + * The [IETF language tag](https://en.wikipedia.org/wiki/IETF_language_tag) used to globally configure localization in Stripe.js. + * Setting the locale here will localize error strings for all Stripe.js methods. + * It will also configure the locale for [Elements](#element_mount) and [Checkout](https://stripe.com/docs/js/checkout/redirect_to_checkout). Default is `auto` (Stripe detects the locale of the browser). + * + * Supported values depend on which features you are using. + * Checkout supports a slightly different set of locales than the rest of Stripe.js. + * If you are planning on using Checkout, make sure to use a [value](#checkout_redirect_to_checkout-options-locale) that it supports. + */ + locale?: StripeElementLocale | CheckoutLocale; + + /** + * Opt-in to prerelease Stripe.js features by passing `betas` when instantiating a `Stripe` object. + * + * Supported values for the `betas` option can be found in integration guides for prerelease features. + * Most users of Stripe.js do not pass this option. + */ + betas?: string[]; +} + +export type StripeErrorType = + /** + * Failure to connect to Stripe's API. + */ + | 'api_connection_error' + + /** + * API errors cover any other type of problem (e.g., a temporary problem with Stripe's servers), and are extremely uncommon. + */ + | 'api_error' + + /** + * Failure to properly authenticate yourself in the request. + */ + | 'authentication_error' + + /** + * Card errors are the most common type of error you should expect to handle. + * They result when the user enters a card that can't be charged for some reason. + */ + | 'card_error' + + /** + * Idempotency errors occur when an `Idempotency-Key` is re-used on a request that does not match the first request's API endpoint and parameters. + */ + | 'idempotency_error' + + /** + * Invalid request errors arise when your request has invalid parameters. + */ + | 'invalid_request_error' + + /** + * Too many requests hit the API too quickly. + */ + | 'rate_limit_error' + + /** + * Errors triggered by our client-side libraries when failing to validate fields (e.g., when a card number or expiration date is invalid or incomplete). + */ + | 'validation_error'; + +export interface StripeError { + /** + * The type of error. + */ + type: StripeErrorType; + + /** + * For card errors, the ID of the failed charge + */ + charge?: string; + + /** + * For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + */ + code?: string; + + /** + * For card errors resulting from a card issuer decline, a short string indicating the [card issuer’s reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + */ + decline_code?: string; + + /** + * A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + */ + doc_url?: string; + + /** + * A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + */ + message?: string; + + /** + * If the error is parameter-specific, the parameter related to the error. + * For example, you can use this to display a message near the correct form field. + */ + param?: string; + + /** + * The `PaymentIntent` object for errors returned on a request involving a `PaymentIntent`. + */ + payment_intent?: api.PaymentIntent; + + /** + * The `PaymentMethod` object for errors returned on a request involving a `PaymentMethod`. + */ + payment_method?: api.PaymentMethod; + + /** + * The `SetupIntent` object for errors returned on a request involving a `SetupIntent`. + */ + setup_intent?: api.SetupIntent; + + /** + * The `Source` object for errors returned on a request involving a `Source`. + */ + source?: api.Source; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/token-and-sources.d.mts b/node_modules/@stripe/stripe-js/dist/stripe-js/token-and-sources.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..99bd323974bf8859c5c1f71a24af123b93d2c777 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/token-and-sources.d.mts @@ -0,0 +1,110 @@ +import {SourceCreateParams} from '../api'; + +/** + * An object containing the unique ID and client secret for a `Source`. + * + * You can use a `Source` object created with `stripe.createSource` as the argument to `stripe.retrieveSource`, as every `Source` object has both `id` and `client_secret` keys. + */ +export interface RetrieveSourceParam { + /** + * Unique identifier of the `Source`. + */ + id: string; + + /** + * A secret available to the web client that created the `Source`, for purposes of retrieving the `Source` later from that same client. + */ + client_secret: string; +} + +/** + * An object containing additional payment information you might have collected. + * + * Although these fields are optional, we highly recommend collecting name and address. + * This information can be used to perform a number of verifications, such as CVC, ZIP, and address verification. + * Radar includes built-in rules that can block payments where the ZIP or CVC verifications with the cardholder’s bank failed. + */ +export interface CreateTokenCardData { + /** + * @recommended + */ + name?: string; + + address_line1?: string; + + address_line2?: string; + + address_city?: string; + + address_state?: string; + + address_zip?: string; + + /** + * A two character country code (for example, `US`). + * + * @recommended + */ + address_country?: string; + + /** + * Required in order to [add the card to a Connect account](https://stripe.com/docs/connect/payouts#bank-accounts) (in all other cases, this parameter is not used). + * Currently, the only supported currency for debit card payouts is `usd`. + */ + currency?: string; +} + +export interface CreateTokenIbanData { + /** + * Three character currency code (e.g., `eur`). + */ + currency: string; + + account_holder_name: string; + + account_holder_type: string; +} + +export interface CreateTokenPiiData { + personal_id_number: string; +} + +export interface CreateTokenBankAccountData { + country: string; + + currency: string; + + routing_number?: string; + + account_number: string; + + account_holder_name?: string; + + account_holder_type: string; + + account_type?: string; +} + +/** + * A required object containing the `type` of `Source` you want to create, and any additional payment information that you have collected. + * See the [Sources API](https://stripe.com/docs/api#create_source) reference for details. + * + * You cannot pass raw card information to `stripe.createSource(sourceData)`. + * Instead, you must gather card information in an `Element` and use `stripe.createSource(element, sourceData)`. + * You can also pass an existing card token to convert it into a `Source` object. + */ +export interface CreateSourceData extends SourceCreateParams { + bancontact?: CreateSourceData.DeprecatedMethodData; + + ideal?: CreateSourceData.DeprecatedMethodData; + + klarna?: CreateSourceData.DeprecatedMethodData; + + sepa_debit?: CreateSourceData.DeprecatedMethodData; + + sofort?: CreateSourceData.DeprecatedMethodData; +} + +export namespace CreateSourceData { + export type DeprecatedMethodData = Record<string, unknown>; +} diff --git a/node_modules/@stripe/stripe-js/dist/stripe-js/token-and-sources.d.ts b/node_modules/@stripe/stripe-js/dist/stripe-js/token-and-sources.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..99bd323974bf8859c5c1f71a24af123b93d2c777 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/stripe-js/token-and-sources.d.ts @@ -0,0 +1,110 @@ +import {SourceCreateParams} from '../api'; + +/** + * An object containing the unique ID and client secret for a `Source`. + * + * You can use a `Source` object created with `stripe.createSource` as the argument to `stripe.retrieveSource`, as every `Source` object has both `id` and `client_secret` keys. + */ +export interface RetrieveSourceParam { + /** + * Unique identifier of the `Source`. + */ + id: string; + + /** + * A secret available to the web client that created the `Source`, for purposes of retrieving the `Source` later from that same client. + */ + client_secret: string; +} + +/** + * An object containing additional payment information you might have collected. + * + * Although these fields are optional, we highly recommend collecting name and address. + * This information can be used to perform a number of verifications, such as CVC, ZIP, and address verification. + * Radar includes built-in rules that can block payments where the ZIP or CVC verifications with the cardholder’s bank failed. + */ +export interface CreateTokenCardData { + /** + * @recommended + */ + name?: string; + + address_line1?: string; + + address_line2?: string; + + address_city?: string; + + address_state?: string; + + address_zip?: string; + + /** + * A two character country code (for example, `US`). + * + * @recommended + */ + address_country?: string; + + /** + * Required in order to [add the card to a Connect account](https://stripe.com/docs/connect/payouts#bank-accounts) (in all other cases, this parameter is not used). + * Currently, the only supported currency for debit card payouts is `usd`. + */ + currency?: string; +} + +export interface CreateTokenIbanData { + /** + * Three character currency code (e.g., `eur`). + */ + currency: string; + + account_holder_name: string; + + account_holder_type: string; +} + +export interface CreateTokenPiiData { + personal_id_number: string; +} + +export interface CreateTokenBankAccountData { + country: string; + + currency: string; + + routing_number?: string; + + account_number: string; + + account_holder_name?: string; + + account_holder_type: string; + + account_type?: string; +} + +/** + * A required object containing the `type` of `Source` you want to create, and any additional payment information that you have collected. + * See the [Sources API](https://stripe.com/docs/api#create_source) reference for details. + * + * You cannot pass raw card information to `stripe.createSource(sourceData)`. + * Instead, you must gather card information in an `Element` and use `stripe.createSource(element, sourceData)`. + * You can also pass an existing card token to convert it into a `Source` object. + */ +export interface CreateSourceData extends SourceCreateParams { + bancontact?: CreateSourceData.DeprecatedMethodData; + + ideal?: CreateSourceData.DeprecatedMethodData; + + klarna?: CreateSourceData.DeprecatedMethodData; + + sepa_debit?: CreateSourceData.DeprecatedMethodData; + + sofort?: CreateSourceData.DeprecatedMethodData; +} + +export namespace CreateSourceData { + export type DeprecatedMethodData = Record<string, unknown>; +} diff --git a/node_modules/@stripe/stripe-js/dist/utils.d.mts b/node_modules/@stripe/stripe-js/dist/utils.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..7a699645926bf50d4fbf25e160fcc58e689517e3 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/utils.d.mts @@ -0,0 +1,2 @@ +// Polyfill for TypeScript < 3.5 compatibility +export type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>; diff --git a/node_modules/@stripe/stripe-js/dist/utils.d.ts b/node_modules/@stripe/stripe-js/dist/utils.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a699645926bf50d4fbf25e160fcc58e689517e3 --- /dev/null +++ b/node_modules/@stripe/stripe-js/dist/utils.d.ts @@ -0,0 +1,2 @@ +// Polyfill for TypeScript < 3.5 compatibility +export type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>; diff --git a/node_modules/@stripe/stripe-js/lib/index.d.mts b/node_modules/@stripe/stripe-js/lib/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..6e610401617a91b80ccc93d0d7493b712841d342 --- /dev/null +++ b/node_modules/@stripe/stripe-js/lib/index.d.mts @@ -0,0 +1 @@ +export * from '../dist'; diff --git a/node_modules/@stripe/stripe-js/lib/index.d.ts b/node_modules/@stripe/stripe-js/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6e610401617a91b80ccc93d0d7493b712841d342 --- /dev/null +++ b/node_modules/@stripe/stripe-js/lib/index.d.ts @@ -0,0 +1 @@ +export * from '../dist'; diff --git a/node_modules/@stripe/stripe-js/lib/index.js b/node_modules/@stripe/stripe-js/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8aef2374dca56fcf6c2b3895c5c0aee69fda6b5b --- /dev/null +++ b/node_modules/@stripe/stripe-js/lib/index.js @@ -0,0 +1,2 @@ +// eslint-disable-next-line no-undef +module.exports = require('../dist'); diff --git a/node_modules/@stripe/stripe-js/lib/index.mjs b/node_modules/@stripe/stripe-js/lib/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..1bc96cab1d9ebcb04c6f482b8874c5c7b7d6eda7 --- /dev/null +++ b/node_modules/@stripe/stripe-js/lib/index.mjs @@ -0,0 +1 @@ +export * from '../dist/index.mjs'; diff --git a/node_modules/@stripe/stripe-js/package.json b/node_modules/@stripe/stripe-js/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1fcec0ad2accfe480ed6ea2179c670f5919b18dd --- /dev/null +++ b/node_modules/@stripe/stripe-js/package.json @@ -0,0 +1,66 @@ +{ + "name": "@stripe/stripe-js", + "version": "3.3.0", + "description": "Stripe.js loading utility", + "repository": "github:stripe/stripe-js", + "main": "lib/index.js", + "module": "lib/index.mjs", + "jsnext:main": "lib/index.mjs", + "types": "lib/index.d.ts", + "typings": "lib/index.d.ts", + "scripts": { + "test": "yarn lint && yarn test:unit && yarn test:types && yarn typecheck", + "test:unit": "jest", + "test:types": "zx ./tests/types/scripts/test.mjs", + "lint": "eslint '{src,types}/**/*.{ts,js}' && yarn prettier-check", + "typecheck": "tsc", + "copy-types": "./scripts/copy-types", + "build": "yarn clean && yarn rollup -c && yarn copy-types", + "clean": "rimraf dist", + "prepublishOnly": "echo \"\nPlease use ./scripts/publish instead\n\" && exit 1", + "prettier": "prettier './**/*.{js,ts,md,html,css}' --write", + "prettier-check": "prettier './**/*.{js,ts,md,html,css}' --check" + }, + "keywords": [ + "Stripe", + "Stripe.js", + "Elements" + ], + "author": "Stripe (https://www.stripe.com)", + "license": "MIT", + "homepage": "https://stripe.com/docs/js", + "files": [ + "dist", + "lib", + "pure", + "src" + ], + "engines": { + "node": ">=12.16" + }, + "devDependencies": { + "@babel/core": "^7.7.2", + "@babel/preset-env": "^7.7.1", + "@rollup/plugin-replace": "^2.3.1", + "@types/jest": "^24.0.25", + "@typescript-eslint/eslint-plugin": "^4.15.2", + "@typescript-eslint/parser": "^4.15.2", + "babel-eslint": "^10.0.3", + "babel-jest": "^24.9.0", + "conditional-type-checks": "^1.0.5", + "eslint": "^6.8.0", + "eslint-config-prettier": "^6.8.0", + "eslint-plugin-import": "^2.18.2", + "eslint-plugin-jest": "^22.6.3", + "eslint-plugin-prettier": "^3.1.1", + "jest": "^24.9.0", + "prettier": "^1.19.1", + "rimraf": "^2.6.2", + "rollup": "^1.29.0", + "rollup-plugin-babel": "^4.3.3", + "rollup-plugin-typescript2": "^0.25.3", + "ts-jest": "^24.3.0", + "typescript": "^4.1.2", + "zx": "^4.2.0" + } +} diff --git a/node_modules/@stripe/stripe-js/pure/index.d.mts b/node_modules/@stripe/stripe-js/pure/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..c740ab68cb5492c806940e664036acaea9f5c112 --- /dev/null +++ b/node_modules/@stripe/stripe-js/pure/index.d.mts @@ -0,0 +1 @@ +export * from '../dist/pure'; diff --git a/node_modules/@stripe/stripe-js/pure/index.d.ts b/node_modules/@stripe/stripe-js/pure/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c740ab68cb5492c806940e664036acaea9f5c112 --- /dev/null +++ b/node_modules/@stripe/stripe-js/pure/index.d.ts @@ -0,0 +1 @@ +export * from '../dist/pure'; diff --git a/node_modules/@stripe/stripe-js/pure/index.js b/node_modules/@stripe/stripe-js/pure/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cfbaaa16d6e22081262729661b64d5a3034775f2 --- /dev/null +++ b/node_modules/@stripe/stripe-js/pure/index.js @@ -0,0 +1 @@ +module.exports = require('../dist/pure'); diff --git a/node_modules/@stripe/stripe-js/pure/index.mjs b/node_modules/@stripe/stripe-js/pure/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..7c901383cc55e1b0a0bf0c8f56a6dea5876c74af --- /dev/null +++ b/node_modules/@stripe/stripe-js/pure/index.mjs @@ -0,0 +1 @@ +export * from '../dist/pure.mjs'; diff --git a/node_modules/@stripe/stripe-js/src/index.test.ts b/node_modules/@stripe/stripe-js/src/index.test.ts new file mode 100644 index 0000000000000000000000000000000000000000..8af7c761b454cff1ba6d1bb67dc8f746fc681431 --- /dev/null +++ b/node_modules/@stripe/stripe-js/src/index.test.ts @@ -0,0 +1,232 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ + +const dispatchScriptEvent = (eventType: string): void => { + const injectedScript = document.querySelector( + 'script[src="https://js.stripe.com/v3"]' + ); + + if (!injectedScript) { + throw new Error('could not find Stripe.js script element'); + } + + injectedScript.dispatchEvent(new Event(eventType)); +}; + +describe('Stripe module loader', () => { + afterEach(() => { + const script = document.querySelector( + 'script[src="https://js.stripe.com/v3"], script[src="https://js.stripe.com/v3/"]' + ); + if (script && script.parentElement) { + script.parentElement.removeChild(script); + } + delete window.Stripe; + jest.resetModules(); + }); + + it('injects the Stripe script as a side effect after a tick', () => { + require('./index'); + + expect( + document.querySelector('script[src="https://js.stripe.com/v3"]') + ).toBe(null); + + return Promise.resolve().then(() => { + expect( + document.querySelector('script[src="https://js.stripe.com/v3"]') + ).not.toBe(null); + }); + }); + + it('does not inject the script when Stripe is already loaded', () => { + require('./index'); + + window.Stripe = jest.fn((key) => ({key})) as any; + + return new Promise((resolve) => setTimeout(resolve)).then(() => { + expect( + document.querySelector('script[src="https://js.stripe.com/v3"]') + ).toBe(null); + }); + }); + + describe('does not inject a duplicate script when one is already present', () => { + test('when the script does not have a trailing slash', () => { + require('./index'); + + const script = document.createElement('script'); + script.src = 'https://js.stripe.com/v3'; + document.body.appendChild(script); + + return Promise.resolve().then(() => { + expect( + document.querySelectorAll( + 'script[src="https://js.stripe.com/v3"], script[src="https://js.stripe.com/v3/"]' + ) + ).toHaveLength(1); + }); + }); + + test('when the script has a trailing slash', () => { + require('./index'); + + const script = document.createElement('script'); + script.src = 'https://js.stripe.com/v3/'; + document.body.appendChild(script); + + return Promise.resolve().then(() => { + expect( + document.querySelectorAll( + 'script[src="https://js.stripe.com/v3"], script[src="https://js.stripe.com/v3/"]' + ) + ).toHaveLength(1); + }); + }); + + test('ignores non-Stripe.js scripts that start with the v3 url', async () => { + const script = document.createElement('script'); + script.src = 'https://js.stripe.com/v3/futureBundle.js'; + document.body.appendChild(script); + + require('./index'); + + await Promise.resolve(); + + expect( + document.querySelectorAll('script[src^="https://js.stripe.com/v3"]') + ).toHaveLength(2); + + expect( + document.querySelector( + 'script[src="https://js.stripe.com/v3/futureBundle.js"]' + ) + ).not.toBe(null); + + expect( + document.querySelector('script[src="https://js.stripe.com/v3"]') + ).not.toBe(null); + }); + }); + + describe.each(['./index', './pure'])('loadStripe (%s.ts)', (requirePath) => { + beforeEach(() => { + jest.restoreAllMocks(); + jest.spyOn(console, 'warn').mockReturnValue(); + }); + + it('resolves loadStripe with Stripe object', async () => { + const {loadStripe} = require(requirePath); + const stripePromise = loadStripe('pk_test_foo'); + + await new Promise((resolve) => setTimeout(resolve)); + window.Stripe = jest.fn((key) => ({key})) as any; + dispatchScriptEvent('load'); + + return expect(stripePromise).resolves.toEqual({key: 'pk_test_foo'}); + }); + + it('rejects when the script fails', async () => { + const {loadStripe} = require(requirePath); + const stripePromise = loadStripe('pk_test_foo'); + + await Promise.resolve(); + dispatchScriptEvent('error'); + + await expect(stripePromise).rejects.toEqual( + new Error('Failed to load Stripe.js') + ); + + expect(console.warn).not.toHaveBeenCalled(); + }); + + it('rejects when Stripe is not added to the window for some reason', async () => { + const {loadStripe} = require(requirePath); + const stripePromise = loadStripe('pk_test_foo'); + + await Promise.resolve(); + dispatchScriptEvent('load'); + + return expect(stripePromise).rejects.toEqual( + new Error('Stripe.js not available') + ); + }); + + it('rejects on first load, and succeeds on second load resolving with Stripe object', async () => { + const {loadStripe} = require(requirePath); + + // start of first load, expect load failure + let stripePromise = loadStripe('pk_test_foo'); + + await Promise.resolve(); + dispatchScriptEvent('error'); + + await expect(stripePromise).rejects.toEqual( + new Error('Failed to load Stripe.js') + ); + + expect(console.warn).not.toHaveBeenCalled(); + + // start of second load, expect successful load + stripePromise = loadStripe('pk_test_foo'); + + await new Promise((resolve) => setTimeout(resolve)); + window.Stripe = jest.fn((key) => ({key})) as any; + dispatchScriptEvent('load'); + + return expect(stripePromise).resolves.toEqual({key: 'pk_test_foo'}); + }); + + it('rejects on first load and second load but succeeds on third load resolving with Stripe object', async () => { + const {loadStripe} = require(requirePath); + + // start of first load, expect load failure + let stripePromise = loadStripe('pk_test_foo'); + + await Promise.resolve(); + dispatchScriptEvent('error'); + + await expect(stripePromise).rejects.toEqual( + new Error('Failed to load Stripe.js') + ); + + expect(console.warn).not.toHaveBeenCalled(); + + // start of second load, expect load failure + stripePromise = loadStripe('pk_test_foo'); + + await Promise.resolve(); + dispatchScriptEvent('error'); + + await expect(stripePromise).rejects.toEqual( + new Error('Failed to load Stripe.js') + ); + + expect(console.warn).not.toHaveBeenCalled(); + + // start of third load, expect success + stripePromise = loadStripe('pk_test_foo'); + + await new Promise((resolve) => setTimeout(resolve)); + window.Stripe = jest.fn((key) => ({key})) as any; + dispatchScriptEvent('load'); + + return expect(stripePromise).resolves.toEqual({key: 'pk_test_foo'}); + }); + }); + + describe('loadStripe (index.ts)', () => { + it('does not cause unhandled rejects when the script fails', async () => { + require('./index'); + + await Promise.resolve(); + dispatchScriptEvent('error'); + + // Turn the task loop to make sure the internal promise handler has been invoked + await new Promise((resolve) => setImmediate(resolve)); + + expect(console.warn).toHaveBeenCalledWith( + new Error('Failed to load Stripe.js') + ); + }); + }); +}); diff --git a/node_modules/@stripe/stripe-js/src/index.ts b/node_modules/@stripe/stripe-js/src/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..090abb2cdd046bb08662e300f8aaa2d03c5b7a15 --- /dev/null +++ b/node_modules/@stripe/stripe-js/src/index.ts @@ -0,0 +1,38 @@ +import {StripeConstructor} from '../types'; +import {loadScript, initStripe, LoadStripe} from './shared'; + +let stripePromise: Promise<StripeConstructor | null> | null; +let loadCalled = false; + +const getStripePromise: () => Promise<StripeConstructor | null> = () => { + if (stripePromise) { + return stripePromise; + } + + stripePromise = loadScript(null).catch((error) => { + // clear cache on error + stripePromise = null; + return Promise.reject(error); + }); + return stripePromise; +}; + +// Execute our own script injection after a tick to give users time to do their +// own script injection. +Promise.resolve() + .then(() => getStripePromise()) + .catch((error) => { + if (!loadCalled) { + console.warn(error); + } + }); + +export const loadStripe: LoadStripe = (...args) => { + loadCalled = true; + const startTime = Date.now(); + + // if previous attempts are unsuccessful, will re-load script + return getStripePromise().then((maybeStripe) => + initStripe(maybeStripe, args, startTime) + ); +}; diff --git a/node_modules/@stripe/stripe-js/src/pure.test.ts b/node_modules/@stripe/stripe-js/src/pure.test.ts new file mode 100644 index 0000000000000000000000000000000000000000..9fbbb68823de0280901f79f22e36aebbdd3e4b53 --- /dev/null +++ b/node_modules/@stripe/stripe-js/src/pure.test.ts @@ -0,0 +1,144 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ + +const SCRIPT_SELECTOR = 'script[src^="https://js.stripe.com/v3"]'; + +describe('pure module', () => { + beforeEach(() => { + jest.spyOn(console, 'warn').mockReturnValue(); + }); + + afterEach(() => { + const scripts = Array.from(document.querySelectorAll(SCRIPT_SELECTOR)); + + for (const script of scripts) { + if (script.parentElement) { + script.parentElement.removeChild(script); + } + } + + delete window.Stripe; + + jest.resetModules(); + jest.restoreAllMocks(); + }); + + test('does not inject the script if loadStripe is not called', async () => { + require('./pure'); + + expect(document.querySelector(SCRIPT_SELECTOR)).toBe(null); + }); + + test('it injects the script if loadStripe is called', async () => { + const {loadStripe} = require('./pure'); + loadStripe('pk_test_foo'); + + expect(document.querySelector(SCRIPT_SELECTOR)).not.toBe(null); + }); + + test('it can load the script with advanced fraud signals disabled', () => { + const {loadStripe} = require('./pure'); + + loadStripe.setLoadParameters({advancedFraudSignals: false}); + loadStripe('pk_test_foo'); + + expect( + document.querySelector( + 'script[src^="https://js.stripe.com/v3?advancedFraudSignals=false"]' + ) + ).not.toBe(null); + }); + + test('it should throw when setting invalid load parameters', () => { + const {loadStripe} = require('./pure'); + + expect(() => { + loadStripe.setLoadParameters({howdy: true}); + }).toThrow('invalid load parameters'); + }); + + test('it should warn when calling loadStripe if a script already exists when parameters are set', () => { + const script = document.createElement('script'); + script.src = 'https://js.stripe.com/v3'; + document.body.appendChild(script); + + const {loadStripe} = require('./pure'); + loadStripe.setLoadParameters({advancedFraudSignals: true}); + loadStripe('pk_test_123'); + + expect(console.warn).toHaveBeenCalledTimes(1); + expect(console.warn).toHaveBeenLastCalledWith( + 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used' + ); + }); + + test('it should warn when calling loadStripe if a script is added after parameters are set', () => { + const {loadStripe} = require('./pure'); + loadStripe.setLoadParameters({advancedFraudSignals: true}); + + const script = document.createElement('script'); + script.src = 'https://js.stripe.com/v3'; + document.body.appendChild(script); + + loadStripe('pk_test_123'); + + expect(console.warn).toHaveBeenCalledTimes(1); + expect(console.warn).toHaveBeenLastCalledWith( + 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used' + ); + }); + + test('it should warn when window.Stripe already exists if parameters are set', () => { + window.Stripe = jest.fn((key) => ({key})) as any; + + const {loadStripe} = require('./pure'); + loadStripe.setLoadParameters({advancedFraudSignals: true}); + loadStripe('pk_test_123'); + + expect(console.warn).toHaveBeenCalledTimes(1); + expect(console.warn).toHaveBeenLastCalledWith( + 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used' + ); + }); + + test('it should not warn when a script already exists if parameters are not set', () => { + const script = document.createElement('script'); + script.src = 'https://js.stripe.com/v3'; + document.body.appendChild(script); + + const {loadStripe} = require('./pure'); + loadStripe('pk_test_123'); + + expect(console.warn).toHaveBeenCalledTimes(0); + }); + + test('it should not warn when window.Stripe already exists if parameters are not set', () => { + window.Stripe = jest.fn((key) => ({key})) as any; + + const {loadStripe} = require('./pure'); + loadStripe('pk_test_123'); + + expect(console.warn).toHaveBeenCalledTimes(0); + }); + + test('throws an error if calling setLoadParameters after loadStripe', () => { + const {loadStripe} = require('./pure'); + + loadStripe.setLoadParameters({advancedFraudSignals: false}); + loadStripe('pk_foo'); + + expect(() => { + loadStripe.setLoadParameters({advancedFraudSignals: true}); + }).toThrow('cannot change load parameters'); + }); + + test('does not throw an error if calling setLoadParameters after loadStripe but the parameters are the same', () => { + const {loadStripe} = require('./pure'); + + loadStripe.setLoadParameters({advancedFraudSignals: false}); + loadStripe('pk_foo'); + + expect(() => { + loadStripe.setLoadParameters({advancedFraudSignals: false}); + }).not.toThrow('cannot change load parameters'); + }); +}); diff --git a/node_modules/@stripe/stripe-js/src/pure.ts b/node_modules/@stripe/stripe-js/src/pure.ts new file mode 100644 index 0000000000000000000000000000000000000000..54a61dafb1d880e9058f46e89bd19672e5802eb7 --- /dev/null +++ b/node_modules/@stripe/stripe-js/src/pure.ts @@ -0,0 +1,54 @@ +import { + validateLoadParams, + loadScript, + initStripe, + LoadStripe, + LoadParams, +} from './shared'; + +type SetLoadParams = (params: LoadParams) => void; + +let loadParams: null | LoadParams; +let loadStripeCalled = false; + +export const loadStripe: LoadStripe & {setLoadParameters: SetLoadParams} = ( + ...args +) => { + loadStripeCalled = true; + const startTime = Date.now(); + + return loadScript(loadParams).then((maybeStripe) => + initStripe(maybeStripe, args, startTime) + ); +}; + +loadStripe.setLoadParameters = (params): void => { + // we won't throw an error if setLoadParameters is called with the same values as before + if (loadStripeCalled && loadParams) { + const validatedParams = validateLoadParams(params); + const parameterKeys = Object.keys(validatedParams) as Array< + keyof LoadParams + >; + + const sameParameters = parameterKeys.reduce( + (previousValue, currentValue) => { + return ( + previousValue && params[currentValue] === loadParams?.[currentValue] + ); + }, + true + ); + + if (sameParameters) { + return; + } + } + + if (loadStripeCalled) { + throw new Error( + 'You cannot change load parameters after calling loadStripe' + ); + } + + loadParams = validateLoadParams(params); +}; diff --git a/node_modules/@stripe/stripe-js/src/shared.test.ts b/node_modules/@stripe/stripe-js/src/shared.test.ts new file mode 100644 index 0000000000000000000000000000000000000000..351773bcfd76d8963e32a3a6f7abd755920bc9de --- /dev/null +++ b/node_modules/@stripe/stripe-js/src/shared.test.ts @@ -0,0 +1,65 @@ +import {validateLoadParams, findScript} from './shared'; + +describe('validateLoadParams', () => { + const INVALID_INPUTS: any[] = [ + [undefined], + [false], + [null], + [true], + [{}], + [8], + [{advancedFraud: true}], + [{advancedFraudSignals: true, someOtherKey: true}], + [{advancedFraudSignals: 'true'}], + ]; + + test.each(INVALID_INPUTS)('throws on invalid input: %p', (input) => { + expect(() => validateLoadParams(input)).toThrow('invalid load parameters'); + }); + + test('validates valid input', () => { + expect(validateLoadParams({advancedFraudSignals: true})).toEqual({ + advancedFraudSignals: true, + }); + + expect(validateLoadParams({advancedFraudSignals: false})).toEqual({ + advancedFraudSignals: false, + }); + }); +}); + +describe('findScript', () => { + const CASES: Array<[string, boolean]> = [ + ['https://js.stripe.com/v3?advancedFraudSignals=true', true], + ['https://js.stripe.com/v3', true], + ['https://js.stripe.com/v3/', true], + ['https://js.stripe.com/v3?advancedFraudSignals=false', true], + ['https://js.stripe.com/v3?ab=cd', true], + ['https://js.stripe.com/v3/something.js', false], + ['https://js.stripe.com/v3/something.js?advancedFraudSignals=false', false], + ['https://js.stripe.com/v3/something.js?ab=cd', false], + ]; + + afterEach(() => { + for (const [url] of CASES) { + const script = document.querySelector(`script[src="${url}"]`); + + if (script && script.parentElement) { + script.parentElement.removeChild(script); + } + } + + delete window.Stripe; + }); + + test.each(CASES)( + 'findScript with <script src="%s"></script>', + (url, shouldBeFound) => { + const script = document.createElement('script'); + script.src = url; + document.body.appendChild(script); + + expect(!!findScript()).toBe(shouldBeFound); + } + ); +}); diff --git a/node_modules/@stripe/stripe-js/src/shared.ts b/node_modules/@stripe/stripe-js/src/shared.ts new file mode 100644 index 0000000000000000000000000000000000000000..26111df83d6de5c5e62d74893680306f187f5b69 --- /dev/null +++ b/node_modules/@stripe/stripe-js/src/shared.ts @@ -0,0 +1,188 @@ +import {Stripe, StripeConstructor} from '../types'; + +export type LoadStripe = ( + ...args: Parameters<StripeConstructor> +) => Promise<Stripe | null>; + +export interface LoadParams { + advancedFraudSignals: boolean; +} + +// `_VERSION` will be rewritten by `@rollup/plugin-replace` as a string literal +// containing the package.json version +declare const _VERSION: string; + +const V3_URL = 'https://js.stripe.com/v3'; +const V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/; +const EXISTING_SCRIPT_MESSAGE = + 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used'; + +export const findScript = (): HTMLScriptElement | null => { + const scripts = document.querySelectorAll<HTMLScriptElement>( + `script[src^="${V3_URL}"]` + ); + + for (let i = 0; i < scripts.length; i++) { + const script = scripts[i]; + + if (!V3_URL_REGEX.test(script.src)) { + continue; + } + + return script; + } + + return null; +}; + +const injectScript = (params: null | LoadParams): HTMLScriptElement => { + const queryString = + params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : ''; + const script = document.createElement('script'); + script.src = `${V3_URL}${queryString}`; + + const headOrBody = document.head || document.body; + + if (!headOrBody) { + throw new Error( + 'Expected document.body not to be null. Stripe.js requires a <body> element.' + ); + } + + headOrBody.appendChild(script); + + return script; +}; + +const registerWrapper = (stripe: any, startTime: number): void => { + if (!stripe || !stripe._registerWrapper) { + return; + } + + stripe._registerWrapper({name: 'stripe-js', version: _VERSION, startTime}); +}; + +let stripePromise: Promise<StripeConstructor | null> | null = null; + +let onErrorListener: (() => void) | null = null; +let onLoadListener: (() => void) | null = null; + +const onError = (reject: (reason?: any) => void) => () => { + reject(new Error('Failed to load Stripe.js')); +}; + +const onLoad = ( + resolve: ( + value: StripeConstructor | PromiseLike<StripeConstructor | null> | null + ) => void, + reject: (reason?: any) => void +) => () => { + if (window.Stripe) { + resolve(window.Stripe); + } else { + reject(new Error('Stripe.js not available')); + } +}; + +export const loadScript = ( + params: null | LoadParams +): Promise<StripeConstructor | null> => { + // Ensure that we only attempt to load Stripe.js at most once + if (stripePromise !== null) { + return stripePromise; + } + + stripePromise = new Promise((resolve, reject) => { + if (typeof window === 'undefined' || typeof document === 'undefined') { + // Resolve to null when imported server side. This makes the module + // safe to import in an isomorphic code base. + resolve(null); + return; + } + + if (window.Stripe && params) { + console.warn(EXISTING_SCRIPT_MESSAGE); + } + + if (window.Stripe) { + resolve(window.Stripe); + return; + } + + try { + let script = findScript(); + + if (script && params) { + console.warn(EXISTING_SCRIPT_MESSAGE); + } else if (!script) { + script = injectScript(params); + } else if ( + script && + onLoadListener !== null && + onErrorListener !== null + ) { + // remove event listeners + script.removeEventListener('load', onLoadListener); + script.removeEventListener('error', onErrorListener); + + // if script exists, but we are reloading due to an error, + // reload script to trigger 'load' event + script.parentNode?.removeChild(script); + script = injectScript(params); + } + + onLoadListener = onLoad(resolve, reject); + onErrorListener = onError(reject); + script.addEventListener('load', onLoadListener); + + script.addEventListener('error', onErrorListener); + } catch (error) { + reject(error); + return; + } + }); + // Resets stripePromise on error + return stripePromise.catch((error) => { + stripePromise = null; + return Promise.reject(error); + }); +}; + +export const initStripe = ( + maybeStripe: StripeConstructor | null, + args: Parameters<StripeConstructor>, + startTime: number +): Stripe | null => { + if (maybeStripe === null) { + return null; + } + + const stripe = maybeStripe.apply(undefined, args); + registerWrapper(stripe, startTime); + return stripe; +}; + +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +export const validateLoadParams = (params: any): LoadParams => { + const errorMessage = `invalid load parameters; expected object of shape + + {advancedFraudSignals: boolean} + +but received + + ${JSON.stringify(params)} +`; + + if (params === null || typeof params !== 'object') { + throw new Error(errorMessage); + } + + if ( + Object.keys(params).length === 1 && + typeof params.advancedFraudSignals === 'boolean' + ) { + return params; + } + + throw new Error(errorMessage); +}; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..317af97ebf23ab27ed9dd4ae5efd416e252d28ac --- /dev/null +++ b/package-lock.json @@ -0,0 +1,27 @@ +{ + "name": "COM3014", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "dependencies": { + "@stripe/stripe-js": "^3.3.0" + } + }, + "node_modules/@stripe/stripe-js": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@stripe/stripe-js/-/stripe-js-3.3.0.tgz", + "integrity": "sha512-dUgAsko9KoYC1U2TIawHzbkQJzPoApxCc1Qf6/j318d1ArViyh6ROHVYTxnU3RlOQL/utUD9I4/QoyiCowsgrw==", + "engines": { + "node": ">=12.16" + } + } + }, + "dependencies": { + "@stripe/stripe-js": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@stripe/stripe-js/-/stripe-js-3.3.0.tgz", + "integrity": "sha512-dUgAsko9KoYC1U2TIawHzbkQJzPoApxCc1Qf6/j318d1ArViyh6ROHVYTxnU3RlOQL/utUD9I4/QoyiCowsgrw==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..15749b28e65bac09998b027989ba8800e7ab279a --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "@stripe/stripe-js": "^3.3.0" + } +}