From 9df80d1148e13f8abc8ce38b79633c10caaf4fe9 Mon Sep 17 00:00:00 2001 From: Alex Teusz Date: Fri, 23 Feb 2024 11:42:40 +0100 Subject: [PATCH 1/3] updated stripe npm module and removed deprecated oder nodes --- extensions/stripe/package-lock.json | 867 ++++++++++++++++-- extensions/stripe/package.json | 2 +- extensions/stripe/src/module.ts | 26 +- .../src/nodes/customers/createCustomer.ts | 4 +- .../stripe/src/nodes/customers/getCustomer.ts | 5 +- .../customers/getCustomerPaymentMethods.ts | 5 +- .../stripe/src/nodes/invoices/getInvoices.ts | 4 +- .../stripe/src/nodes/invoices/payInvoice.ts | 5 +- .../src/nodes/orders/createCardToken.ts | 205 ----- .../stripe/src/nodes/orders/createOrder.ts | 277 ------ .../stripe/src/nodes/orders/createSKU.ts | 292 ------ .../stripe/src/nodes/orders/payOrder.ts | 233 ----- .../paymentIntents/createPaymentIntent.ts | 186 ++++ .../stripe/src/nodes/products/getProducts.ts | 5 +- .../nodes/promotion/createPromotionCode.ts | 5 +- .../stripe/src/nodes/refunds/createRefund.ts | 5 +- .../stripe/src/nodes/refunds/getCharges.ts | 5 +- 17 files changed, 974 insertions(+), 1157 deletions(-) delete mode 100644 extensions/stripe/src/nodes/orders/createCardToken.ts delete mode 100644 extensions/stripe/src/nodes/orders/createOrder.ts delete mode 100644 extensions/stripe/src/nodes/orders/createSKU.ts delete mode 100644 extensions/stripe/src/nodes/orders/payOrder.ts create mode 100644 extensions/stripe/src/nodes/paymentIntents/createPaymentIntent.ts diff --git a/extensions/stripe/package-lock.json b/extensions/stripe/package-lock.json index 72307606..4f172bfd 100644 --- a/extensions/stripe/package-lock.json +++ b/extensions/stripe/package-lock.json @@ -1,29 +1,634 @@ { "name": "stripe", "version": "4.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "stripe", + "version": "4.0.0", + "license": "MIT", + "dependencies": { + "@cognigy/extension-tools": "^0.13.0", + "stripe": "^14.18.0", + "tslint": "^6.1.2" + }, + "devDependencies": { + "@types/node": "^13.13.15", + "typescript": "^3.8.3" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", + "dependencies": { + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@cognigy/extension-tools": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@cognigy/extension-tools/-/extension-tools-0.13.0.tgz", + "integrity": "sha512-FAY2X2F0KcUbwNMGql0q7Nh1NBpO/1i+ruQRos0NXgXoZNOhXIH3MAB85Rdd/pqzoNaqvZowiE5Ve5aQ0gF03w==" + }, + "node_modules/@types/node": { + "version": "13.13.52", + "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", + "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", + "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dependencies": { + "hasown": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/object-inspect": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + }, + "node_modules/qs": { + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/set-function-length": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", + "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", + "dependencies": { + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/side-channel": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz", + "integrity": "sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==", + "dependencies": { + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, + "node_modules/stripe": { + "version": "14.18.0", + "resolved": "https://registry.npmjs.org/stripe/-/stripe-14.18.0.tgz", + "integrity": "sha512-yLqKPqYgGJbMxrQiE4+i2i00ZVA2NRIZbZ1rejzj5XR3F3Uc+1iy9QE133knZudhVGMw367b8vTpB8D9pYMETw==", + "dependencies": { + "@types/node": ">=8.1.0", + "qs": "^6.11.0" + }, + "engines": { + "node": ">=12.*" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, + "node_modules/tslint": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.1.3.tgz", + "integrity": "sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==", + "deprecated": "TSLint has been deprecated in favor of ESLint. Please see https://github.com/palantir/tslint/issues/4534 for more information.", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^4.0.1", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.3", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.13.0", + "tsutils": "^2.29.0" + }, + "bin": { + "tslint": "bin/tslint" + }, + "engines": { + "node": ">=4.8.0" + }, + "peerDependencies": { + "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev || >= 4.0.0-dev" + } + }, + "node_modules/tsutils": { + "version": "2.29.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", + "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", + "dependencies": { + "tslib": "^1.8.1" + }, + "peerDependencies": { + "typescript": ">=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev" + } + }, + "node_modules/typescript": { + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + } + }, "dependencies": { "@babel/code-frame": { - "version": "7.12.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", - "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", + "integrity": "sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==", "requires": { - "@babel/highlight": "^7.12.13" + "@babel/highlight": "^7.23.4", + "chalk": "^2.4.2" } }, "@babel/helper-validator-identifier": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", - "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==" + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==" }, "@babel/highlight": { - "version": "7.14.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", - "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "requires": { - "@babel/helper-validator-identifier": "^7.14.0", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" } }, @@ -35,8 +640,7 @@ "@types/node": { "version": "13.13.52", "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==", - "dev": true + "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==" }, "ansi-styles": { "version": "3.2.1", @@ -71,15 +675,18 @@ "builtin-modules": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=" + "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==" }, "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" } }, "chalk": { @@ -103,7 +710,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "commander": { "version": "2.20.3", @@ -113,17 +720,40 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==" }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==" }, "esprima": { "version": "4.0.1", @@ -133,58 +763,81 @@ "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.1" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" } }, "glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", + "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "requires": { - "function-bind": "^1.1.1" + "get-intrinsic": "^1.1.3" } }, "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==" }, - "has-symbols": { + "has-property-descriptors": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", - "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==" + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "hasown": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", + "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", + "requires": { + "function-bind": "^1.1.2" + } }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "requires": { "once": "^1.3.0", "wrappy": "1" @@ -196,11 +849,11 @@ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "is-core-module": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz", - "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "requires": { - "has": "^1.0.3" + "hasown": "^2.0.0" } }, "js-tokens": { @@ -218,35 +871,35 @@ } }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" }, "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "requires": { - "minimist": "^1.2.5" + "minimist": "^1.2.6" } }, "object-inspect": { - "version": "1.10.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.10.3.tgz", - "integrity": "sha512-e5mCJlSH7poANfC8z8S9s9S2IN5/4Zb3aZ33f5s8YqoazCFzNLloLU8r5VCG+G7WoqLvAAZoVMcy3tp/3X0Plw==" + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==" }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", "requires": { "wrappy": "1" } @@ -254,7 +907,7 @@ "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" }, "path-parse": { "version": "1.0.7", @@ -262,56 +915,64 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "qs": { - "version": "6.10.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz", - "integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==", + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", "requires": { "side-channel": "^1.0.4" } }, "resolve": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz", - "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "requires": { - "is-core-module": "^2.2.0", - "path-parse": "^1.0.6" + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" } }, "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" + }, + "set-function-length": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.1.tgz", + "integrity": "sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==", + "requires": { + "define-data-property": "^1.1.2", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.3", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.1" + } }, "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.5.tgz", + "integrity": "sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==", "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.6", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" } }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", - "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" }, "stripe": { - "version": "8.154.0", - "resolved": "https://registry.npmjs.org/stripe/-/stripe-8.154.0.tgz", - "integrity": "sha512-e+FQ+2PqDVXsm4MBXUDkQSnYqyJWdRr6JJvFI0QPCrgsi4qWWutFEyznGgplSgSdD3gMqgAeB+qhqo6pGSYMwQ==", + "version": "14.18.0", + "resolved": "https://registry.npmjs.org/stripe/-/stripe-14.18.0.tgz", + "integrity": "sha512-yLqKPqYgGJbMxrQiE4+i2i00ZVA2NRIZbZ1rejzj5XR3F3Uc+1iy9QE133knZudhVGMw367b8vTpB8D9pYMETw==", "requires": { "@types/node": ">=8.1.0", - "qs": "^6.6.0" - }, - "dependencies": { - "@types/node": { - "version": "15.12.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-15.12.2.tgz", - "integrity": "sha512-zjQ69G564OCIWIOHSXyQEEDpdpGl+G348RAKY0XXy9Z5kU9Vzv1GMNnkar/ZJ8dzXB3COzD9Mo9NtRZ4xfgUww==" - } + "qs": "^6.11.0" } }, "supports-color": { @@ -322,6 +983,11 @@ "has-flag": "^3.0.0" } }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + }, "tslib": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", @@ -356,15 +1022,14 @@ } }, "typescript": { - "version": "3.9.9", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz", - "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==", - "dev": true + "version": "3.9.10", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", + "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==" }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" } } } diff --git a/extensions/stripe/package.json b/extensions/stripe/package.json index 0d6cdb25..59be1a3e 100644 --- a/extensions/stripe/package.json +++ b/extensions/stripe/package.json @@ -21,7 +21,7 @@ "license": "MIT", "dependencies": { "@cognigy/extension-tools": "^0.13.0", - "stripe": "^8.154.0", + "stripe": "^14.18.0", "tslint": "^6.1.2" }, "devDependencies": { diff --git a/extensions/stripe/src/module.ts b/extensions/stripe/src/module.ts index 5ce95e2b..f6c091dd 100644 --- a/extensions/stripe/src/module.ts +++ b/extensions/stripe/src/module.ts @@ -1,39 +1,21 @@ import { createExtension } from "@cognigy/extension-tools"; import { stripeConnection } from "./connections/stripeConnection"; -import { createCardTokenNode, onSuccesCreateCardToken, onErrorCreateCardToken } from "./nodes/orders/createCardToken"; -import { createOrderNode, onErrorCreateOrder, onSuccesCreateOrder } from "./nodes/orders/createOrder"; -import { createSKUNode, onSuccesCreateSKU, onErrorCreateSKU } from "./nodes/orders/createSKU"; import { createCustomerNode } from "./nodes/customers/createCustomer"; import { getCustomerNode, onFoundCustomer, onNotFoundCustomer } from "./nodes/customers/getCustomer"; import { getCustomerPaymentMethodsNode, onFoundCustomerPaymentMethods, onNotFoundCustomerPaymentMethods } from "./nodes/customers/getCustomerPaymentMethods"; import { getCustomerInvoicesNode, onFoundInvoices, OnNotFoundInvoices } from "./nodes/invoices/getInvoices"; import { onErrorPayInvoice, onSuccessPayInvoice, payInvoiceNode } from "./nodes/invoices/payInvoice"; -import { onErrorPayOrder, onSuccessPayOrder, payOrderNode } from "./nodes/orders/payOrder"; +// import { onErrorPayOrder, onSuccessPayOrder, payOrderNode } from "./nodes/orders/payOrder"; import { getProductsNode } from "./nodes/products/getProducts"; import { getChargesNode, onChargesFound, OnNoChargesFound } from "./nodes/refunds/getCharges"; import { createRefundNode, onErrorRefund, onSuccessRefund } from "./nodes/refunds/createRefund"; import { createPromotionCodeNode } from "./nodes/promotion/createPromotionCode"; +import { createPaymentIntentNode } from "./nodes/paymentIntents/createPaymentIntent"; export default createExtension({ nodes: [ - createCardTokenNode, - onSuccesCreateCardToken, - onErrorCreateCardToken, - - createSKUNode, - onSuccesCreateSKU, - onErrorCreateSKU, - - createOrderNode, - onSuccesCreateOrder, - onErrorCreateOrder, - - payOrderNode, - onSuccessPayOrder, - onErrorPayOrder, - getProductsNode, getCustomerNode, @@ -62,7 +44,9 @@ export default createExtension({ onSuccessRefund, onErrorRefund, - createPromotionCodeNode + createPromotionCodeNode, + + createPaymentIntentNode ], connections: [ diff --git a/extensions/stripe/src/nodes/customers/createCustomer.ts b/extensions/stripe/src/nodes/customers/createCustomer.ts index b5a4c4e8..76095f35 100644 --- a/extensions/stripe/src/nodes/customers/createCustomer.ts +++ b/extensions/stripe/src/nodes/customers/createCustomer.ts @@ -131,9 +131,7 @@ export const createCustomerNode = createNodeDescriptor({ const { connection, name, phone, email, storeLocation, inputKey, contextKey } = config; const { secretKey } = connection; - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); + const stripe = new Stripe(secretKey); try { diff --git a/extensions/stripe/src/nodes/customers/getCustomer.ts b/extensions/stripe/src/nodes/customers/getCustomer.ts index ed459508..2813429f 100644 --- a/extensions/stripe/src/nodes/customers/getCustomer.ts +++ b/extensions/stripe/src/nodes/customers/getCustomer.ts @@ -120,9 +120,8 @@ export const getCustomerNode = createNodeDescriptor({ const { connection, email, storeLocation, inputKey, contextKey } = config; const { secretKey } = connection; - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); + const stripe = new Stripe(secretKey); + try { diff --git a/extensions/stripe/src/nodes/customers/getCustomerPaymentMethods.ts b/extensions/stripe/src/nodes/customers/getCustomerPaymentMethods.ts index 649c613f..d4ad03ec 100644 --- a/extensions/stripe/src/nodes/customers/getCustomerPaymentMethods.ts +++ b/extensions/stripe/src/nodes/customers/getCustomerPaymentMethods.ts @@ -130,9 +130,8 @@ export const getCustomerPaymentMethodsNode = createNodeDescriptor({ const { connection, customerId, paymentMethod, storeLocation, inputKey, contextKey } = config; const { secretKey } = connection; - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); + const stripe = new Stripe(secretKey); + try { diff --git a/extensions/stripe/src/nodes/invoices/getInvoices.ts b/extensions/stripe/src/nodes/invoices/getInvoices.ts index 16e71f89..640dc144 100644 --- a/extensions/stripe/src/nodes/invoices/getInvoices.ts +++ b/extensions/stripe/src/nodes/invoices/getInvoices.ts @@ -142,9 +142,7 @@ export const getCustomerInvoicesNode = createNodeDescriptor({ const { connection, customerId, status, storeLocation, inputKey, contextKey } = config; const { secretKey } = connection; - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); + const stripe = new Stripe(secretKey); try { diff --git a/extensions/stripe/src/nodes/invoices/payInvoice.ts b/extensions/stripe/src/nodes/invoices/payInvoice.ts index 62d52248..83a735e2 100644 --- a/extensions/stripe/src/nodes/invoices/payInvoice.ts +++ b/extensions/stripe/src/nodes/invoices/payInvoice.ts @@ -136,9 +136,8 @@ export const payInvoiceNode = createNodeDescriptor({ const { connection, invoiceId, usePaymentMethod, paymentMethodId, storeLocation, inputKey, contextKey } = config; const { secretKey } = connection; - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); + const stripe = new Stripe(secretKey); + try { diff --git a/extensions/stripe/src/nodes/orders/createCardToken.ts b/extensions/stripe/src/nodes/orders/createCardToken.ts deleted file mode 100644 index af577a87..00000000 --- a/extensions/stripe/src/nodes/orders/createCardToken.ts +++ /dev/null @@ -1,205 +0,0 @@ -import { createNodeDescriptor, INodeFunctionBaseParams } from "@cognigy/extension-tools"; -import Stripe from "stripe"; - -export interface ICreateCardTokenParams extends INodeFunctionBaseParams { - config: { - connection: { - secretKey: string; - }; - cardNumber: string; - exp_month: string; - exp_year: string; - cvc: string; - storeLocation: string; - inputKey: string; - contextKey: string; - }; -} - -export const createCardTokenNode = createNodeDescriptor({ - type: "createCardToken", - defaultLabel: "Create Card Token", - summary: "Creates a new credit card for payment", - fields: [ - { - key: "connection", - label: "Stripe Connection", - type: "connection", - params: { - connectionType: "stripe", - required: true - } - }, - { - key: "cardNumber", - label: "Card Number", - type: "cognigyText", - description: "The number of the credit card that should be used for the payment", - params: { - required: true - } - }, - { - key: "exp_month", - label: "Expiration Month", - type: "cognigyText", - defaultValue: "1", - description: "The expiration month of the used credit card which needs to be provided as a number between 1 and 12", - params: { - required: true - } - }, - { - key: "exp_year", - label: "Expiration Year", - type: "cognigyText", - description: "The expiration year of the used credit card", - defaultValue: "2024", - params: { - required: true, - } - }, - { - key: "cvc", - label: "CVC", - type: "cognigyText", - defaultValue: "132", - description: "The CVC code of the used credit card", - params: { - required: true - } - }, - { - key: "storeLocation", - type: "select", - label: "Where to store the result", - params: { - options: [ - { - label: "Input", - value: "input" - }, - { - label: "Context", - value: "context" - } - ], - required: true - }, - defaultValue: "context" - }, - { - key: "inputKey", - type: "cognigyText", - label: "Input Key to store Result", - defaultValue: "stripe.token", - condition: { - key: "storeLocation", - value: "input" - } - }, - { - key: "contextKey", - type: "cognigyText", - label: "Context Key to store Result", - defaultValue: "stripe.token", - condition: { - key: "storeLocation", - value: "context" - } - } - ], - sections: [ - { - key: "storageOption", - label: "Storage Option", - defaultCollapsed: true, - fields: [ - "storeLocation", - "inputKey", - "contextKey", - ] - } - ], - form: [ - { type: "field", key: "connection" }, - { type: "field", key: "cardNumber" }, - { type: "field", key: "exp_month" }, - { type: "field", key: "exp_year" }, - { type: "field", key: "cvc" }, - { type: "section", key: "storageOption" }, - ], - appearance: { - color: "#556cd6" - }, - dependencies: { - children: [ - "onSuccesCreateCardToken", - "onErrorCreateCardToken" - ] - }, - function: async ({ cognigy, config, childConfigs }: ICreateCardTokenParams) => { - const { api } = cognigy; - const { connection, cardNumber, exp_month, exp_year, cvc, storeLocation, inputKey, contextKey } = config; - const { secretKey } = connection; - - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); - - try { - - const token = await stripe.tokens.create({ - card: { - number: cardNumber, - exp_month, - exp_year, - cvc, - }, - }); - - const onSuccessChild = childConfigs.find(child => child.type === "onSuccesCreateCardToken"); - api.setNextNode(onSuccessChild.id); - - if (storeLocation === "context") { - api.addToContext(contextKey, token, "simple"); - } else { - // @ts-ignore - api.addToInput(inputKey, token); - } - } catch (error) { - - const onErrorChild = childConfigs.find(child => child.type === "onErrorCreateCardToken"); - api.setNextNode(onErrorChild.id); - - if (storeLocation === "context") { - api.addToContext(contextKey, error, "simple"); - } else { - // @ts-ignore - api.addToInput(inputKey, error); - } - } - } -}); - -export const onSuccesCreateCardToken = createNodeDescriptor({ - type: "onSuccesCreateCardToken", - parentType: "createCardToken", - defaultLabel: "On Success", - appearance: { - color: "#61d188", - textColor: "white", - variant: "mini" - } -}); - -export const onErrorCreateCardToken = createNodeDescriptor({ - type: "onErrorCreateCardToken", - parentType: "createCardToken", - defaultLabel: "On Error", - appearance: { - color: "#cf142b", - textColor: "white", - variant: "mini" - } -}); diff --git a/extensions/stripe/src/nodes/orders/createOrder.ts b/extensions/stripe/src/nodes/orders/createOrder.ts deleted file mode 100644 index bdc492c3..00000000 --- a/extensions/stripe/src/nodes/orders/createOrder.ts +++ /dev/null @@ -1,277 +0,0 @@ -import { createNodeDescriptor, INodeFunctionBaseParams } from "@cognigy/extension-tools"; -import Stripe from "stripe"; - -export interface ICreateOrderParams extends INodeFunctionBaseParams { - config: { - connection: { - secretKey: string; - }; - currency: string; - email: string; - itemSKUId: string; - name: string; - line1: string; - city: string; - state: string; - country: string; - postal_code: string; - storeLocation: string; - inputKey: string; - contextKey: string; - }; -} - -export const createOrderNode = createNodeDescriptor({ - type: "createOrder", - defaultLabel: "Create Order", - summary: "Creates a new order with a list of items and shipping address", - fields: [ - { - key: "connection", - label: "Stripe Connection", - type: "connection", - params: { - connectionType: "stripe", - required: true - } - }, - { - key: "currency", - label: "Currency", - type: "select", - defaultValue: "eur", - description: "The currency that should be used", - params: { - required: true, - options: [ - { - label: "Euro", - value: "eur" - }, - { - label: "US Dollar", - value: "usd" - } - ] - } - }, - { - key: "email", - label: "Email", - type: "cognigyText", - defaultValue: "{{input.userId}}", - description: "The email address of the customer", - params: { - required: true - } - }, - { - key: "itemSKUId", - label: "SKU ID", - type: "cognigyText", - defaultValue: "{{context.stripe.sku.id}}", - description: "The ID of the created stripe stock keeping unit", - params: { - required: true - } - }, - { - key: "name", - label: "Name", - type: "cognigyText", - params: { - required: true - } - }, - { - key: "line1", - label: "Address", - type: "cognigyText", - params: { - required: true - } - }, - { - key: "city", - label: "City", - type: "cognigyText", - params: { - required: true - } - }, - { - key: "country", - label: "Country", - type: "cognigyText", - params: { - required: true - } - }, - { - key: "postal_code", - label: "Postal Code", - type: "cognigyText", - params: { - required: true - } - }, - { - key: "storeLocation", - type: "select", - label: "Where to store the result", - params: { - options: [ - { - label: "Input", - value: "input" - }, - { - label: "Context", - value: "context" - } - ], - required: true - }, - defaultValue: "context" - }, - { - key: "inputKey", - type: "cognigyText", - label: "Input Key to store Result", - defaultValue: "stripe.order", - condition: { - key: "storeLocation", - value: "input" - } - }, - { - key: "contextKey", - type: "cognigyText", - label: "Context Key to store Result", - defaultValue: "stripe.order", - condition: { - key: "storeLocation", - value: "context" - } - } - ], - sections: [ - { - key: "storageOption", - label: "Storage Option", - defaultCollapsed: true, - fields: [ - "storeLocation", - "inputKey", - "contextKey", - ] - }, - { - key: "shippingInformation", - label: "Shipping", - defaultCollapsed: false, - fields: [ - "name", - "line1", - "city", - "country", - "postal_code" - ] - } - ], - form: [ - { type: "field", key: "connection" }, - { type: "field", key: "currency" }, - { type: "field", key: "email" }, - { type: "field", key: "itemSKUId" }, - { type: "field", key: "targetLang" }, - { type: "section", key: "shippingInformation" }, - { type: "section", key: "storageOption" }, - ], - appearance: { - color: "#556cd6" - }, - dependencies: { - children: [ - "onSuccesCreateOrder", - "onErrorCreateOrder" - ] - }, - function: async ({ cognigy, config, childConfigs }: ICreateOrderParams) => { - const { api } = cognigy; - const { connection, currency, email, itemSKUId, name, line1, city, state, country, postal_code, storeLocation, inputKey, contextKey } = config; - const { secretKey } = connection; - - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); - - try { - - const order: Stripe.Response = await stripe.orders.create({ - currency, - email, - items: [ - { - type: "sku", - parent: itemSKUId - }, - ], - shipping: { - name, - address: { - line1, - city, - state, - country, - postal_code - }, - }, - }); - - - const onSuccessChild = childConfigs.find(child => child.type === "onSuccesCreateOrder"); - api.setNextNode(onSuccessChild.id); - - if (storeLocation === "context") { - api.addToContext(contextKey, order, "simple"); - } else { - // @ts-ignore - api.addToInput(inputKey, order); - } - } catch (error) { - - const onErrorChild = childConfigs.find(child => child.type === "onErrorCreateOrder"); - api.setNextNode(onErrorChild.id); - - if (storeLocation === "context") { - api.addToContext(contextKey, error, "simple"); - } else { - // @ts-ignore - api.addToInput(inputKey, error); - } - } - } -}); - -export const onSuccesCreateOrder = createNodeDescriptor({ - type: "onSuccesCreateOrder", - parentType: "createOrder", - defaultLabel: "On Success", - appearance: { - color: "#61d188", - textColor: "white", - variant: "mini" - } -}); - -export const onErrorCreateOrder = createNodeDescriptor({ - type: "onErrorCreateOrder", - parentType: "createOrder", - defaultLabel: "On Error", - appearance: { - color: "#cf142b", - textColor: "white", - variant: "mini" - } -}); diff --git a/extensions/stripe/src/nodes/orders/createSKU.ts b/extensions/stripe/src/nodes/orders/createSKU.ts deleted file mode 100644 index 74922688..00000000 --- a/extensions/stripe/src/nodes/orders/createSKU.ts +++ /dev/null @@ -1,292 +0,0 @@ -import { createNodeDescriptor, INodeFunctionBaseParams } from "@cognigy/extension-tools"; -import Stripe from "stripe"; - -export interface ICreateSKUParams extends INodeFunctionBaseParams { - config: { - connection: { - secretKey: string; - }; - currency: string; - price: number; - inventoryType: Stripe.SkuCreateParams.Inventory.Type; - inventoryQuantity: number; - productId: string; - useAttributes: boolean; - attributes: any; - storeLocation: string; - inputKey: string; - contextKey: string; - }; -} - -export const createSKUNode = createNodeDescriptor({ - type: "createSKU", - defaultLabel: "Create SKU", - summary: "Creates a new Stock Keeping Unit", - fields: [ - { - key: "connection", - label: "Stripe Connection", - type: "connection", - params: { - connectionType: "stripe", - required: true - } - }, - { - key: "currency", - label: "Currency", - type: "select", - defaultValue: "eur", - description: "The currency that should be used", - params: { - required: true, - options: [ - { - label: "Euro", - value: "eur" - }, - { - label: "US Dollar", - value: "usd" - } - ] - } - }, - { - key: "price", - label: "Price", - type: "number", - defaultValue: "0", - description: "The price for this new stock keeping unit", - params: { - required: true - } - }, - { - key: "inventoryType", - label: "Inventory Type", - type: "select", - defaultValue: "finite", - params: { - required: true, - options: [ - { - label: "Finite", - value: "finite" - }, - { - label: "Bucket", - value: "bucket" - }, - { - label: "Infinite", - value: "infinite" - } - ] - } - }, - { - key: "inventoryQuantity", - label: "Inventory Quantity", - type: "number", - defaultValue: "1", - description: "How many items of the product should be used", - params: { - required: true - }, - condition: { - key: "inventoryType", - value: "finite" - } - }, - { - key: "productId", - label: "Product ID", - type: "cognigyText", - defaultValue: "{{context.stripe.product.id}}", - description: "The stripe ID of the product that should be used", - params: { - required: true - } - }, - { - key: "useAttributes", - label: "Configure Attributes", - type: "toggle", - defaultValue: false, - description: "Whether to configure attributes for the product" - }, - { - key: "attributes", - label: "Attributes", - type: "json", - defaultValue: "{}", - description: "Optional attributes that should be specified for the product", - condition: { - key: "useAttributes", - value: true - } - }, - { - key: "storeLocation", - type: "select", - label: "Where to store the result", - params: { - options: [ - { - label: "Input", - value: "input" - }, - { - label: "Context", - value: "context" - } - ], - required: true - }, - defaultValue: "context" - }, - { - key: "inputKey", - type: "cognigyText", - label: "Input Key to store Result", - defaultValue: "stripe.sku", - condition: { - key: "storeLocation", - value: "input" - } - }, - { - key: "contextKey", - type: "cognigyText", - label: "Context Key to store Result", - defaultValue: "stripe.sku", - condition: { - key: "storeLocation", - value: "context" - } - } - ], - sections: [ - { - key: "storageOption", - label: "Storage Option", - defaultCollapsed: true, - fields: [ - "storeLocation", - "inputKey", - "contextKey", - ] - }, - { - key: "attributesOption", - label: "Attributes", - defaultCollapsed: true, - fields: [ - "useAttributes", - "attributes" - ] - } - ], - form: [ - { type: "field", key: "connection" }, - { type: "field", key: "currency" }, - { type: "field", key: "price" }, - { type: "field", key: "inventoryQuantity" }, - { type: "field", key: "inventoryType" }, - { type: "field", key: "productId" }, - { type: "section", key: "attributesOption" }, - { type: "section", key: "storageOption" }, - ], - appearance: { - color: "#556cd6" - }, - dependencies: { - children: [ - "onSuccesCreateSKU", - "onErrorCreateSKU" - ] - }, - function: async ({ cognigy, config, childConfigs }: ICreateSKUParams) => { - const { api } = cognigy; - const { connection, currency, price, inventoryQuantity, inventoryType, productId, useAttributes, attributes, storeLocation, inputKey, contextKey } = config; - const { secretKey } = connection; - - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); - - try { - - let sku: Stripe.Response; - - if (useAttributes) { - sku = await stripe.skus.create({ - attributes, - price, - currency, - inventory: { - type: inventoryType, - quantity: inventoryQuantity - }, - product: productId - }); - } else { - sku = await stripe.skus.create({ - price, - currency, - inventory: { - type: inventoryType, - quantity: inventoryQuantity - }, - product: productId - }); - } - - - const onSuccessChild = childConfigs.find(child => child.type === "onSuccesCreateSKU"); - api.setNextNode(onSuccessChild.id); - - if (storeLocation === "context") { - api.addToContext(contextKey, sku, "simple"); - } else { - // @ts-ignore - api.addToInput(inputKey, sku); - } - } catch (error) { - - const onErrorChild = childConfigs.find(child => child.type === "onErrorCreateSKU"); - api.setNextNode(onErrorChild.id); - - if (storeLocation === "context") { - api.addToContext(contextKey, error, "simple"); - } else { - // @ts-ignore - api.addToInput(inputKey, error); - } - } - } -}); - -export const onSuccesCreateSKU = createNodeDescriptor({ - type: "onSuccesCreateSKU", - parentType: "createSKU", - defaultLabel: "On Success", - appearance: { - color: "#61d188", - textColor: "white", - variant: "mini" - } -}); - -export const onErrorCreateSKU = createNodeDescriptor({ - type: "onErrorCreateSKU", - parentType: "createSKU", - defaultLabel: "On Error", - appearance: { - color: "#cf142b", - textColor: "white", - variant: "mini" - } -}); diff --git a/extensions/stripe/src/nodes/orders/payOrder.ts b/extensions/stripe/src/nodes/orders/payOrder.ts deleted file mode 100644 index cb02f658..00000000 --- a/extensions/stripe/src/nodes/orders/payOrder.ts +++ /dev/null @@ -1,233 +0,0 @@ -import { createNodeDescriptor, INodeFunctionBaseParams } from "@cognigy/extension-tools"; -import Stripe from "stripe"; - -export interface ICreateCardTokenParams extends INodeFunctionBaseParams { - config: { - connection: { - secretKey: string; - }; - orderId: string; - paymentOption: string; - customerId: string; - source: string; - storeLocation: string; - inputKey: string; - contextKey: string; - }; -} - -export const payOrderNode = createNodeDescriptor({ - type: "payOrder", - defaultLabel: "Pay Order", - summary: "Pay an order in stripe", - fields: [ - { - key: "connection", - label: "Stripe Connection", - type: "connection", - params: { - connectionType: "stripe", - required: true - } - }, - { - key: "orderId", - label: "Order ID", - type: "cognigyText", - defaultValue: "{{context.stripe.order.id}}", - description: "The ID of the order that should be paid in stripe", - params: { - required: true - } - }, - { - key: "paymentOption", - label: "Payment Option", - type: "select", - defaultValue: "customer", - description: "How to pay the order, with a customer account or a credit card", - params: { - required: true, - options: [ - { - label: "Customer Account", - value: "customer" - }, - { - label: "Credit Card", - value: "card" - } - ] - } - }, - { - key: "source", - label: "Card Token ID", - type: "cognigyText", - defaultValue: "{{context.stripe.token.id}}", - description: "The token ID of the credit card that should be used in stripe", - params: { - required: true - }, - condition: { - key: "paymentOption", - value: "card" - } - }, - { - key: "customerId", - label: "Customer ID", - type: "cognigyText", - defaultValue: "{{context.stripe.customer.id}}", - description: "The token ID of the customer that should be used for the payment", - params: { - required: true - }, - condition: { - key: "paymentOption", - value: "customer" - } - }, - { - key: "storeLocation", - type: "select", - label: "Where to store the result", - params: { - options: [ - { - label: "Input", - value: "input" - }, - { - label: "Context", - value: "context" - } - ], - required: true - }, - defaultValue: "context" - }, - { - key: "inputKey", - type: "cognigyText", - label: "Input Key to store Result", - defaultValue: "stripe.payment", - condition: { - key: "storeLocation", - value: "input" - } - }, - { - key: "contextKey", - type: "cognigyText", - label: "Context Key to store Result", - defaultValue: "stripe.payment", - condition: { - key: "storeLocation", - value: "context" - } - } - ], - sections: [ - { - key: "storageOption", - label: "Storage Option", - defaultCollapsed: true, - fields: [ - "storeLocation", - "inputKey", - "contextKey", - ] - } - ], - form: [ - { type: "field", key: "connection" }, - { type: "field", key: "orderId" }, - { type: "field", key: "paymentOption" }, - { type: "field", key: "customerId" }, - { type: "field", key: "source" }, - { type: "section", key: "storageOption" }, - ], - appearance: { - color: "#556cd6" - }, - dependencies: { - children: [ - "onSuccessPayOrder", - "onErrorPayOrder" - ] - }, - function: async ({ cognigy, config, childConfigs }: ICreateCardTokenParams) => { - const { api } = cognigy; - const { connection, orderId, source, paymentOption, customerId, storeLocation, inputKey, contextKey } = config; - const { secretKey } = connection; - - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); - - try { - - let order: Stripe.Response; - - if (paymentOption === "customer") { - order = await stripe.orders.pay( - orderId, - { - customer: customerId - } - ); - } else { - order = await stripe.orders.pay( - orderId, - { - source - } - ); - } - - const onSuccessChild = childConfigs.find(child => child.type === "onSuccessPayOrder"); - api.setNextNode(onSuccessChild.id); - - if (storeLocation === "context") { - api.addToContext(contextKey, order, "simple"); - } else { - // @ts-ignore - api.addToInput(inputKey, order); - } - } catch (error) { - - const onErrorChild = childConfigs.find(child => child.type === "onErrorPayOrder"); - api.setNextNode(onErrorChild.id); - - if (storeLocation === "context") { - api.addToContext(contextKey, error, "simple"); - } else { - // @ts-ignore - api.addToInput(inputKey, error); - } - } - } -}); - -export const onSuccessPayOrder = createNodeDescriptor({ - type: "onSuccessPayOrder", - parentType: "createCardToken", - defaultLabel: "Paid", - appearance: { - color: "#61d188", - textColor: "white", - variant: "mini" - } -}); - -export const onErrorPayOrder = createNodeDescriptor({ - type: "onErrorPayOrder", - parentType: "payOrder", - defaultLabel: "Failed", - appearance: { - color: "#61d188", - textColor: "white", - variant: "mini" - } -}); diff --git a/extensions/stripe/src/nodes/paymentIntents/createPaymentIntent.ts b/extensions/stripe/src/nodes/paymentIntents/createPaymentIntent.ts new file mode 100644 index 00000000..547fcab6 --- /dev/null +++ b/extensions/stripe/src/nodes/paymentIntents/createPaymentIntent.ts @@ -0,0 +1,186 @@ +import { createNodeDescriptor, INodeFunctionBaseParams } from "@cognigy/extension-tools"; +import Stripe from "stripe"; + +export interface ICreatePaymentIntentParams extends INodeFunctionBaseParams { + config: { + connection: { + secretKey: string; + }; + amount: number; + currency: string; + automaticPaymentMethods: boolean; + description: string; + customer: string; + storeLocation: string; + inputKey: string; + contextKey: string; + }; +} + +export const createPaymentIntentNode = createNodeDescriptor({ + type: "createPaymentIntent", + defaultLabel: "Create Payment Intent", + summary: "Creates a new payment intent in Stripe", + fields: [ + { + key: "connection", + label: "Stripe Connection", + type: "connection", + params: { + connectionType: "stripe", + required: true + } + }, + { + key: "amount", + label: "Amount", + type: "cognigyText", + description: "A positive integer representing how much to charge", + params: { + required: true + } + }, + { + key: "currency", + label: "Currency", + type: "cognigyText", + defaultValue: "eur", + description: "Three-letter ISO currency code in lowercase", + params: { + required: true + } + }, + { + key: "automaticPaymentMethods", + label: "Automatic Payment Methods", + type: "toggle", + defaultValue: true, + description: "When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters", + }, + { + key: "description", + label: "Description", + type: "cognigyText", + description: "An arbitrary string attached to the object. Often useful for displaying to users", + }, + { + key: "customer", + label: "Customer", + type: "cognigyText", + description: "ID of the Customer this PaymentIntent belongs to, if one exists", + }, + { + key: "storeLocation", + type: "select", + label: "Where to store the result", + params: { + options: [ + { + label: "Input", + value: "input" + }, + { + label: "Context", + value: "context" + } + ], + required: true + }, + defaultValue: "input" + }, + { + key: "inputKey", + type: "cognigyText", + label: "Input Key to store Result", + defaultValue: "stripe.paymentIntent", + condition: { + key: "storeLocation", + value: "input" + } + }, + { + key: "contextKey", + type: "cognigyText", + label: "Context Key to store Result", + defaultValue: "stripe.paymentIntent", + condition: { + key: "storeLocation", + value: "context" + } + } + ], + sections: [ + { + key: "storageOption", + label: "Storage Option", + defaultCollapsed: true, + fields: [ + "storeLocation", + "inputKey", + "contextKey", + ] + }, + { + key: "advanced", + label: "Advanced", + defaultCollapsed: true, + fields: [ + "automaticPaymentMethods", + "description", + "customer" + ] + } + ], + form: [ + { type: "field", key: "connection" }, + { type: "field", key: "coupon" }, + { type: "field", key: "code" }, + { type: "section", key: "advanced" }, + { type: "section", key: "storageOption" }, + ], + appearance: { + color: "#556cd6" + }, + tokens: [ + { + label: "Stripe Promotion Code", + script: "input.stripe.paymentIntent.client_secret", + type: "input" + } + ], + function: async ({ cognigy, config }: ICreatePaymentIntentParams) => { + const { api } = cognigy; + const { connection, amount, currency, customer, automaticPaymentMethods, description, storeLocation, inputKey, contextKey } = config; + const { secretKey } = connection; + + const stripe = new Stripe(secretKey); + + try { + const paymentIntent = await stripe.paymentIntents.create({ + amount, + currency, + automatic_payment_methods: { + enabled: automaticPaymentMethods, + }, + description, + customer + }); + + if (storeLocation === "context") { + api.addToContext(contextKey, paymentIntent, "simple"); + } else { + // @ts-ignore + api.addToInput(inputKey, paymentIntent); + } + + } catch (error) { + + if (storeLocation === "context") { + api.addToContext(contextKey, error, "simple"); + } else { + // @ts-ignore + api.addToInput(inputKey, error); + } + } + } +}); diff --git a/extensions/stripe/src/nodes/products/getProducts.ts b/extensions/stripe/src/nodes/products/getProducts.ts index f9d92a6f..1f9b8af4 100644 --- a/extensions/stripe/src/nodes/products/getProducts.ts +++ b/extensions/stripe/src/nodes/products/getProducts.ts @@ -114,9 +114,8 @@ export const getProductsNode = createNodeDescriptor({ const { connection, limit, retrievePrice, storeLocation, inputKey, contextKey } = config; const { secretKey } = connection; - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); + const stripe = new Stripe(secretKey); + try { diff --git a/extensions/stripe/src/nodes/promotion/createPromotionCode.ts b/extensions/stripe/src/nodes/promotion/createPromotionCode.ts index 8bb2a8af..65c5873e 100644 --- a/extensions/stripe/src/nodes/promotion/createPromotionCode.ts +++ b/extensions/stripe/src/nodes/promotion/createPromotionCode.ts @@ -190,9 +190,8 @@ export const createPromotionCodeNode = createNodeDescriptor({ const { connection, coupon, active, configureMaxRedemptions, maxRedemptions, code, assignToCustomer, customerId, storeLocation, inputKey, contextKey } = config; const { secretKey } = connection; - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); + const stripe = new Stripe(secretKey); + try { diff --git a/extensions/stripe/src/nodes/refunds/createRefund.ts b/extensions/stripe/src/nodes/refunds/createRefund.ts index 0be48ab9..885abda0 100644 --- a/extensions/stripe/src/nodes/refunds/createRefund.ts +++ b/extensions/stripe/src/nodes/refunds/createRefund.ts @@ -136,9 +136,8 @@ export const createRefundNode = createNodeDescriptor({ const { connection, chargeId, refundEntireCharge, amount, storeLocation, inputKey, contextKey } = config; const { secretKey } = connection; - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); + const stripe = new Stripe(secretKey); + try { diff --git a/extensions/stripe/src/nodes/refunds/getCharges.ts b/extensions/stripe/src/nodes/refunds/getCharges.ts index 4a2d7c71..3de5d1ba 100644 --- a/extensions/stripe/src/nodes/refunds/getCharges.ts +++ b/extensions/stripe/src/nodes/refunds/getCharges.ts @@ -120,9 +120,8 @@ export const getChargesNode = createNodeDescriptor({ const { connection, customerId, onlyReturnNotRefunded, storeLocation, inputKey, contextKey } = config; const { secretKey } = connection; - const stripe = new Stripe(secretKey, { - apiVersion: "2020-08-27" - }); + const stripe = new Stripe(secretKey); + try { From 2e7df6e72188f42ff061cd24ff174c7ff9ddfb28 Mon Sep 17 00:00:00 2001 From: Alex Teusz Date: Fri, 23 Feb 2024 14:18:38 +0100 Subject: [PATCH 2/3] added createPaymentIntent flow node --- extensions/stripe/package-lock.json | 4 +-- extensions/stripe/package.json | 2 +- extensions/stripe/src/module.ts | 1 - .../paymentIntents/createPaymentIntent.ts | 26 +++++++++++++++---- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/extensions/stripe/package-lock.json b/extensions/stripe/package-lock.json index 4f172bfd..9ec8ac95 100644 --- a/extensions/stripe/package-lock.json +++ b/extensions/stripe/package-lock.json @@ -1,12 +1,12 @@ { "name": "stripe", - "version": "4.0.0", + "version": "4.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "stripe", - "version": "4.0.0", + "version": "4.1.0", "license": "MIT", "dependencies": { "@cognigy/extension-tools": "^0.13.0", diff --git a/extensions/stripe/package.json b/extensions/stripe/package.json index 59be1a3e..4de999fa 100644 --- a/extensions/stripe/package.json +++ b/extensions/stripe/package.json @@ -1,6 +1,6 @@ { "name": "stripe", - "version": "4.0.0", + "version": "4.1.0", "description": "Integrates with Stripe and provices customer, order, invoice, product, and refund actions", "main": "build/module.js", "scripts": { diff --git a/extensions/stripe/src/module.ts b/extensions/stripe/src/module.ts index f6c091dd..b85bd582 100644 --- a/extensions/stripe/src/module.ts +++ b/extensions/stripe/src/module.ts @@ -6,7 +6,6 @@ import { getCustomerNode, onFoundCustomer, onNotFoundCustomer } from "./nodes/cu import { getCustomerPaymentMethodsNode, onFoundCustomerPaymentMethods, onNotFoundCustomerPaymentMethods } from "./nodes/customers/getCustomerPaymentMethods"; import { getCustomerInvoicesNode, onFoundInvoices, OnNotFoundInvoices } from "./nodes/invoices/getInvoices"; import { onErrorPayInvoice, onSuccessPayInvoice, payInvoiceNode } from "./nodes/invoices/payInvoice"; -// import { onErrorPayOrder, onSuccessPayOrder, payOrderNode } from "./nodes/orders/payOrder"; import { getProductsNode } from "./nodes/products/getProducts"; import { getChargesNode, onChargesFound, OnNoChargesFound } from "./nodes/refunds/getCharges"; import { createRefundNode, onErrorRefund, onSuccessRefund } from "./nodes/refunds/createRefund"; diff --git a/extensions/stripe/src/nodes/paymentIntents/createPaymentIntent.ts b/extensions/stripe/src/nodes/paymentIntents/createPaymentIntent.ts index 547fcab6..9c18f4db 100644 --- a/extensions/stripe/src/nodes/paymentIntents/createPaymentIntent.ts +++ b/extensions/stripe/src/nodes/paymentIntents/createPaymentIntent.ts @@ -133,8 +133,8 @@ export const createPaymentIntentNode = createNodeDescriptor({ ], form: [ { type: "field", key: "connection" }, - { type: "field", key: "coupon" }, - { type: "field", key: "code" }, + { type: "field", key: "amount" }, + { type: "field", key: "currency" }, { type: "section", key: "advanced" }, { type: "section", key: "storageOption" }, ], @@ -155,8 +155,11 @@ export const createPaymentIntentNode = createNodeDescriptor({ const stripe = new Stripe(secretKey); - try { - const paymentIntent = await stripe.paymentIntents.create({ + let paymentIntentObject: Stripe.PaymentIntentCreateParams; + + // Check if customer ID is given + if (customer) { + paymentIntentObject = { amount, currency, automatic_payment_methods: { @@ -164,7 +167,20 @@ export const createPaymentIntentNode = createNodeDescriptor({ }, description, customer - }); + } + } else { + paymentIntentObject = { + amount, + currency, + automatic_payment_methods: { + enabled: automaticPaymentMethods, + }, + description + } + } + + try { + const paymentIntent = await stripe.paymentIntents.create(paymentIntentObject); if (storeLocation === "context") { api.addToContext(contextKey, paymentIntent, "simple"); From 656d011551fe660b7dd8d8b3c2d9af589f64e3fc Mon Sep 17 00:00:00 2001 From: Alex Teusz Date: Fri, 23 Feb 2024 14:20:39 +0100 Subject: [PATCH 3/3] Updated README --- extensions/stripe/README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/extensions/stripe/README.md b/extensions/stripe/README.md index bd0a5acb..aa1d34f8 100644 --- a/extensions/stripe/README.md +++ b/extensions/stripe/README.md @@ -26,12 +26,8 @@ All exposed Flow Nodes of this Extension follow the [Stripe API](https://stripe. - *Invoices* - [Get Invoices](https://stripe.com/docs/api/invoices/list?lang=node) - [Pay Invoice](https://stripe.com/docs/api/invoices/pay) -- *Orders* - - [Create Order](https://stripe.com/docs/api/orders/create) - - [Create Card Token](https://stripe.com/docs/api/tokens/create_card) - - [Create SKU](https://stripe.com/docs/api/skus/create) - - [Pay Order](https://stripe.com/docs/api/orders/pay?lang=node) - +- *Payment Intent* + - [Create Payment Intent](https://docs.stripe.com/api/payment_intents/create) - *Products* - [Get Products](https://stripe.com/docs/api/products/list) - *Refunds*