From 3a8d1549e7281e32cd67c5605087b601f684ddee Mon Sep 17 00:00:00 2001 From: Ji Xun <20251077+jaechow@users.noreply.github.com> Date: Sun, 12 Jan 2025 14:34:31 -0800 Subject: [PATCH 1/5] Implemented randomization using FakerJS to avoid static, hard-coded transaction values (improving the Decision Manager experience with volume that more closely emulates distinct order data). Refactored processGet() in Samples/Authentication/SampleCodes/StandAloneJWT.js to dynamically calculate start/end times so the report more consistently returns results. --- .../SampleCodes/StandAloneJWT.js | 96 +- package-lock.json | 2533 +++++++++++++++++ package.json | 6 +- 3 files changed, 2597 insertions(+), 38 deletions(-) create mode 100644 package-lock.json diff --git a/Samples/Authentication/SampleCodes/StandAloneJWT.js b/Samples/Authentication/SampleCodes/StandAloneJWT.js index 3dd3712..01bd5e5 100644 --- a/Samples/Authentication/SampleCodes/StandAloneJWT.js +++ b/Samples/Authentication/SampleCodes/StandAloneJWT.js @@ -2,49 +2,71 @@ const superagent = require('superagent'); const crypto = require('crypto'); - +const { faker } = require('@faker-js/faker'); var fs = require('fs'); var forge = require('node-forge'); var Jwt = require('jwt-simple'); var path = require('path'); - +var dt = new Date(); +var curDate = dt.toGMTString(); +/* Create timestamp 8 hours back for report query */ +dt.setHours(dt.getHours() - 8); var requestHost = "apitest.cybersource.com"; var merchantId = "testrest"; var keyPass = "testrest"; -var payload = "{" + - " \"clientReferenceInformation\": {" + - " \"code\": \"TC50171_3\"" + - " }," + - " \"processingInformation\": {" + - " \"commerceIndicator\": \"internet\"" + - " }," + - " \"orderInformation\": {" + - " \"billTo\": {" + - " \"firstName\": \"john\"," + - " \"lastName\": \"doe\"," + - " \"address1\": \"201 S. Division St.\"," + - " \"postalCode\": \"48104-2201\"," + - " \"locality\": \"Ann Arbor\"," + - " \"administrativeArea\": \"MI\"," + - " \"country\": \"US\"," + - " \"phoneNumber\": \"999999999\"," + - " \"email\": \"test@cybs.com\"" + - " }," + - " \"amountDetails\": {" + - " \"totalAmount\": \"10\"," + - " \"currency\": \"USD\"" + - " }" + - " }," + - " \"paymentInformation\": {" + - " \"card\": {" + - " \"expirationYear\": \"2031\"," + - " \"number\": \"5555555555554444\"," + - " \"securityCode\": \"123\"," + - " \"expirationMonth\": \"12\"," + - " \"type\": \"002\"" + - " }" + - " }" + - "}"; +function personify(){ + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + var expYear = dt.getFullYear()+4; + var payload = JSON.stringify({ + "clientReferenceInformation" : { + "code" : faker.string.numeric(10) + }, + "processingInformation" : { + "capture" : true, + "commerceIndicator" : "internet" + }, + "orderInformation" : { + "billTo" : { + "firstName" : fName, + "lastName" : lName, + "address1" : faker.location.streetAddress(), + "postalCode" : faker.location.zipCode(), + "locality" : faker.location.city(), + "administrativeArea" : faker.location.state(), + "country" : "US", + "phoneNumber" : faker.phone.number(), + "email" : faker.internet.email({firstName:fName,lastName:lName}) + }, + "amountDetails" : { + "totalAmount" : faker.commerce.price({ min: 10, max: 500 }), + "currency" : "USD" + } + }, + "paymentInformation" : { + "card" : { + "expirationYear" : expYear, + "number" : faker.finance.creditCardNumber({issuer: '414720#########L'}), + "securityCode" : faker.finance.creditCardCVV(), + "expirationMonth" : "12", + "type" : "001" + } + }, + "merchantDefinedInformation" : [ + { + "key" : "1", + "value" : merchantId + } + ], + "deviceInformation" : { + "fingerprintSessionId" : "", + "ipAddress" : faker.internet.ipv4(), + "useragent" : faker.internet.userAgent() + } + }); + return payload; +} +var payload = personify(); function generateDigest(request) { var buffer = Buffer.from(payload, 'utf8'); @@ -213,7 +235,7 @@ function processPost(callback) { } function processGet(callback) { - var resource = "/reporting/v3/reports?startTime=2021-01-01T00:00:00.0Z&endTime=2021-01-02T23:59:59.0Z&timeQueryType=executedTime&reportMimeType=application/xml"; + var resource = "/reporting/v3/reports?startTime="+dt.toISOString()+"&endTime="+(new Date()).toISOString()+"&timeQueryType=executedTime&reportMimeType=application/xml"; var method = "get"; var statusCode = -1; var url = 'https://' + requestHost + resource; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..2b15187 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2533 @@ +{ + "name": "cybersource-rest-samples-node", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "cybersource-rest-samples-node", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "cybersource-rest-client": "0.0.61", + "eslint": "^5.9.0", + "jwk-to-pem": "^2.0.0", + "node-forge": "^1.2.1", + "superagent": "^10.1.1" + }, + "devDependencies": { + "@faker-js/faker": "^9.3.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.26.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", + "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.25.9", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@colors/colors": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", + "license": "MIT", + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/@dabh/diagnostics": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@dabh/diagnostics/-/diagnostics-2.0.3.tgz", + "integrity": "sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA==", + "license": "MIT", + "dependencies": { + "colorspace": "1.1.x", + "enabled": "2.0.x", + "kuler": "^2.0.0" + } + }, + "node_modules/@faker-js/faker": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-9.3.0.tgz", + "integrity": "sha512-r0tJ3ZOkMd9xsu3VRfqlFR6cz0V/jFYRswAIpC+m/DIfAUXq7g8N7wTAlhSANySXYGKzGryfDXwtwsY8TxEIDw==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/fakerjs" + } + ], + "license": "MIT", + "engines": { + "node": ">=18.0.0", + "npm": ">=9.0.0" + } + }, + "node_modules/@types/triple-beam": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==", + "license": "MIT" + }, + "node_modules/acorn": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz", + "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/agent-base": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", + "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "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==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/app-root-path": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", + "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "license": "MIT", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "license": "MIT" + }, + "node_modules/asn1.js": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz", + "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==", + "license": "MIT", + "dependencies": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", + "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/axios-cookiejar-support": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/axios-cookiejar-support/-/axios-cookiejar-support-4.0.7.tgz", + "integrity": "sha512-9vpE3y/a2l2Vs2XEJE4L2z0GWnlpJ4Xj+kDaoCtrpPfS1J3oikXBrxRJX6H62/ZcelOGe+519yW7mqXCIoPXuw==", + "license": "MIT", + "dependencies": { + "http-cookie-agent": "^5.0.4" + }, + "engines": { + "node": ">=14.18.0 <15.0.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/3846masa" + }, + "peerDependencies": { + "axios": ">=0.20.0", + "tough-cookie": ">=4.0.0" + } + }, + "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==", + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/base64url": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-3.0.1.tgz", + "integrity": "sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==", + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/bn.js": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", + "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", + "license": "MIT" + }, + "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==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "license": "MIT" + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz", + "integrity": "sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.3.tgz", + "integrity": "sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "get-intrinsic": "^1.2.6" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chai": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "license": "MIT", + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chai-as-promised": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.2.tgz", + "integrity": "sha512-aBDHZxRzYnUYuIAIPBH2s511DjlKPzXNlXSGFC8CwmroWQLfrW0LtE1nK3MAwwNhJPa9raEjNCmRoFpG0Hurdw==", + "license": "WTFPL", + "dependencies": { + "check-error": "^1.0.2" + }, + "peerDependencies": { + "chai": ">= 2.1.2 < 6" + } + }, + "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==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "license": "MIT" + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==", + "license": "MIT", + "dependencies": { + "restore-cursor": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "license": "ISC" + }, + "node_modules/color": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", + "integrity": "sha512-aBl7dZI9ENN6fUGC7mWpMTPNHmWUSNan9tuWN6ahh5ZLNk9baLJOnSMlrQkHcrfFgz2/RigjUVAjdx36VcemKA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.3", + "color-string": "^1.6.0" + } + }, + "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==", + "license": "MIT", + "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==", + "license": "MIT" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "license": "MIT", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/colorspace": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/colorspace/-/colorspace-1.1.4.tgz", + "integrity": "sha512-BgvKJiuVu1igBUF2kEjRCZXol6wiiGbY5ipL/oVPwm0BL9sIpMIzM8IK7vwuxIIzOXMV3Ey5w+vxhm0rR/TN8w==", + "license": "MIT", + "dependencies": { + "color": "^3.1.3", + "text-hex": "1.0.x" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" + }, + "node_modules/cookiejar": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.6.tgz", + "integrity": "sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==", + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/cybersource-rest-client": { + "version": "0.0.61", + "resolved": "https://registry.npmjs.org/cybersource-rest-client/-/cybersource-rest-client-0.0.61.tgz", + "integrity": "sha512-OJrKyWpH++4zzNLmIyaNd7SkiqqH5iP32pQZOI7pNFyvmu0M9VRvOZW7bJArcGWSJo+eR3ikJb8crN0gpQYlkg==", + "license": "CyberSource", + "dependencies": { + "app-root-path": "^3.1.0", + "axios": "1.7.4", + "axios-cookiejar-support": "4.0.7", + "chai": "^4.3.1", + "chai-as-promised": "^7.1.1", + "https-proxy-agent": "^7.0.0", + "jwk-to-pem": "^2.0.5", + "jwt-simple": "^0.5.6", + "memory-cache": "^0.2.0", + "node-forge": ">=1.0.0", + "node-jose": "^2.2.0", + "promise": "^8.3.0", + "tough-cookie": "4.1.3", + "winston": "^3.11.0", + "winston-daily-rotate-file": "^4.7.1" + } + }, + "node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-eql": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "license": "MIT", + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "license": "MIT" + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dezalgo": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "license": "ISC", + "dependencies": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/elliptic": { + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", + "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", + "license": "MIT", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "license": "MIT" + }, + "node_modules/enabled": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", + "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==", + "license": "MIT" + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "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==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", + "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "license": "MIT" + }, + "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==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz", + "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.3", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.13.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^6.14.0 || ^8.10.0 || >=9.10.0" + } + }, + "node_modules/eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=4" + } + }, + "node_modules/espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" + }, + "engines": { + "node": ">=6.0.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==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "license": "MIT", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "license": "MIT" + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "license": "MIT" + }, + "node_modules/fecha": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", + "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==", + "license": "MIT" + }, + "node_modules/figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==", + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "license": "MIT", + "dependencies": { + "flat-cache": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/file-stream-rotator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/file-stream-rotator/-/file-stream-rotator-0.6.1.tgz", + "integrity": "sha512-u+dBid4PvZw17PmDeRcNOtCP9CCK/9lRN2w+r1xIS7yOL9JFrIBKTvrYsxT4P0pGtThYTn++QS5ChHaUov3+zQ==", + "license": "MIT", + "dependencies": { + "moment": "^2.29.1" + } + }, + "node_modules/flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "license": "MIT", + "dependencies": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "license": "ISC" + }, + "node_modules/fn.name": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fn.name/-/fn.name-1.1.0.tgz", + "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", + "license": "MIT" + }, + "node_modules/follow-redirects": { + "version": "1.15.9", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.9.tgz", + "integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.1.tgz", + "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/formidable": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.2.tgz", + "integrity": "sha512-Jqc1btCy3QzRbJaICGwKcBfGWuLADRerLzDqi2NwSt/UkXLsHJw2TVResiaoBufHVHy9aSgClOHCeJsSsFLTbg==", + "license": "MIT", + "dependencies": { + "dezalgo": "^1.0.4", + "hexoid": "^2.0.0", + "once": "^1.4.0" + }, + "funding": { + "url": "https://ko-fi.com/tunnckoCore/commissions" + } + }, + "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==", + "license": "ISC" + }, + "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==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==", + "license": "MIT" + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.7.tgz", + "integrity": "sha512-VW6Pxhsrk0KAOqs3WEd0klDiF/+V7gQOpAvY1jVU/LHmaD/kQO4523aiJuikX/QAKYiW6x8Jh+RJej1almdtCA==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "function-bind": "^1.1.2", + "get-proto": "^1.0.0", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "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/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "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==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/hexoid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-2.0.0.tgz", + "integrity": "sha512-qlspKUK7IlSQv2o+5I7yhUd7TxlOG2Vr5LTa3ve2XSNVKAL/n/u/7KLvKmFNimomDIKvZFXWHv0T12mv7rT8Aw==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "license": "MIT", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/http-cookie-agent": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/http-cookie-agent/-/http-cookie-agent-5.0.4.tgz", + "integrity": "sha512-OtvikW69RvfyP6Lsequ0fN5R49S+8QcS9zwd58k6VSr6r57T8G29BkPdyrBcSwLq6ExLs9V+rBlfxu7gDstJag==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0" + }, + "engines": { + "node": ">=14.18.0 <15.0.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/3846masa" + }, + "peerDependencies": { + "deasync": "^0.1.26", + "tough-cookie": "^4.0.0", + "undici": "^5.11.0" + }, + "peerDependenciesMeta": { + "deasync": { + "optional": true + }, + "undici": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz", + "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "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==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "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==", + "license": "ISC" + }, + "node_modules/inquirer": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz", + "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==", + "license": "MIT", + "dependencies": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.12", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.1.0", + "through": "^2.3.6" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/inquirer/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "license": "MIT" + }, + "node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "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==", + "license": "MIT" + }, + "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==", + "license": "MIT", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "license": "MIT" + }, + "node_modules/jwk-to-pem": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/jwk-to-pem/-/jwk-to-pem-2.0.7.tgz", + "integrity": "sha512-cSVphrmWr6reVchuKQZdfSs4U9c5Y4hwZggPoz6cbVnTpAVgGRpEuQng86IyqLeGZlhTh+c4MAreB6KbdQDKHQ==", + "license": "Apache-2.0", + "dependencies": { + "asn1.js": "^5.3.0", + "elliptic": "^6.6.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jwt-simple": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/jwt-simple/-/jwt-simple-0.5.6.tgz", + "integrity": "sha512-40aUybvhH9t2h71ncA1/1SbtTNCVZHgsTsTgqPUxGWDmUDrXyDf2wMNQKEbdBjbf4AI+fQhbECNTV6lWxQKUzg==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/kuler": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", + "integrity": "sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==", + "license": "MIT" + }, + "node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "license": "MIT", + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/logform": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.7.0.tgz", + "integrity": "sha512-TFYA4jnP7PVbmlBIfhlSe+WKxs9dklXMTEGcBCIvLhE/Tn3H6Gk1norupVW7m5Cnd4bLcr08AytbyV/xj7f/kQ==", + "license": "MIT", + "dependencies": { + "@colors/colors": "1.6.0", + "@types/triple-beam": "^1.3.2", + "fecha": "^4.2.0", + "ms": "^2.1.1", + "safe-stable-stringify": "^2.3.1", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/long": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.4.tgz", + "integrity": "sha512-qtzLbJE8hq7VabR3mISmVGtoXP8KGc2Z/AT8OuqlYD7JTR3oqrgwdjnk07wpj1twXxYmgDXgoKVWUG/fReSzHg==", + "license": "Apache-2.0" + }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "license": "MIT", + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/memory-cache": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/memory-cache/-/memory-cache-0.2.0.tgz", + "integrity": "sha512-OcjA+jzjOYzKmKS6IQVALHLVz+rNTMPoJvCztFaZxwG14wtAW7VRZjwTQu06vKCYOxh4jVnik7ya0SXTB0W+xA==", + "license": "BSD-2-Clause" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "license": "ISC" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "license": "MIT" + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "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==", + "license": "MIT", + "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==", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==", + "license": "ISC" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "license": "MIT" + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "license": "MIT" + }, + "node_modules/node-forge": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", + "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "license": "(BSD-3-Clause OR GPL-2.0)", + "engines": { + "node": ">= 6.13.0" + } + }, + "node_modules/node-jose": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/node-jose/-/node-jose-2.2.0.tgz", + "integrity": "sha512-XPCvJRr94SjLrSIm4pbYHKLEaOsDvJCpyFw/6V/KK/IXmyZ6SFBzAUDO9HQf4DB/nTEFcRGH87mNciOP23kFjw==", + "license": "Apache-2.0", + "dependencies": { + "base64url": "^3.0.1", + "buffer": "^6.0.3", + "es6-promise": "^4.2.8", + "lodash": "^4.17.21", + "long": "^5.2.0", + "node-forge": "^1.2.1", + "pako": "^2.0.4", + "process": "^0.11.10", + "uuid": "^9.0.0" + } + }, + "node_modules/object-hash": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz", + "integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==", + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/object-inspect": { + "version": "1.13.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.3.tgz", + "integrity": "sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "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==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/one-time": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/one-time/-/one-time-1.0.0.tgz", + "integrity": "sha512-5DXOiRKwuSEcQ/l0kGCF6Q3jcADFv5tSmRaJck/OqkVFcOzutB134KRSfF0xDrL39MNnqxbHBbUUcjZIhTgb2g==", + "license": "MIT", + "dependencies": { + "fn.name": "1.x.x" + } + }, + "node_modules/onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==", + "license": "MIT", + "dependencies": { + "mimic-fn": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "license": "MIT", + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pako": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", + "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==", + "license": "(MIT AND Zlib)" + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "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==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==", + "license": "(WTFPL OR MIT)" + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/promise": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", + "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", + "license": "MIT", + "dependencies": { + "asap": "~2.0.6" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/psl": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.15.0.tgz", + "integrity": "sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==", + "license": "MIT", + "dependencies": { + "punycode": "^2.3.1" + }, + "funding": { + "url": "https://github.com/sponsors/lupomontero" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.1.tgz", + "integrity": "sha512-EJPeIn0CYrGu+hli1xilKAPXODtJ12T0sP63Ijx2/khC2JtuaN3JyNIpvmnkmaEtha9ocbG4A4cMcr+TvqvwQg==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/querystringify": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", + "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", + "license": "MIT" + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "license": "MIT", + "engines": { + "node": ">=6.5.0" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "license": "MIT" + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==", + "license": "MIT", + "dependencies": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC" + }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "license": "BSD-3-Clause" + }, + "node_modules/stack-trace": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz", + "integrity": "sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "license": "MIT", + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/superagent": { + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-10.1.1.tgz", + "integrity": "sha512-9pIwrHrOj3uAnqg9gDlW7EA2xv+N5au/dSM0kM22HTqmUu8jBxNT+8uA7tA3UoCnmiqzpSbu8rasIUZvbyamMQ==", + "license": "MIT", + "dependencies": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.4", + "debug": "^4.3.4", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.0", + "formidable": "^3.5.2", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.11.0" + }, + "engines": { + "node": ">=14.18.0" + } + }, + "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==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "license": "BSD-3-Clause", + "dependencies": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/table/node_modules/ansi-regex": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/table/node_modules/string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/table/node_modules/strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^4.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/text-hex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", + "integrity": "sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==", + "license": "MIT" + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "license": "MIT" + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "license": "MIT" + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/tough-cookie": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", + "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "license": "BSD-3-Clause", + "dependencies": { + "psl": "^1.1.33", + "punycode": "^2.1.1", + "universalify": "^0.2.0", + "url-parse": "^1.5.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/triple-beam": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", + "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", + "license": "MIT", + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "license": "0BSD" + }, + "node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "license": "MIT", + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/universalify": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", + "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/url-parse": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", + "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", + "license": "MIT", + "dependencies": { + "querystringify": "^2.1.1", + "requires-port": "^1.0.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/winston": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.17.0.tgz", + "integrity": "sha512-DLiFIXYC5fMPxaRg832S6F5mJYvePtmO5G9v9IgUFPhXm9/GkXarH/TUrBAVzhTCzAj9anE/+GjrgXp/54nOgw==", + "license": "MIT", + "dependencies": { + "@colors/colors": "^1.6.0", + "@dabh/diagnostics": "^2.0.2", + "async": "^3.2.3", + "is-stream": "^2.0.0", + "logform": "^2.7.0", + "one-time": "^1.0.0", + "readable-stream": "^3.4.0", + "safe-stable-stringify": "^2.3.1", + "stack-trace": "0.0.x", + "triple-beam": "^1.3.0", + "winston-transport": "^4.9.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/winston-daily-rotate-file": { + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/winston-daily-rotate-file/-/winston-daily-rotate-file-4.7.1.tgz", + "integrity": "sha512-7LGPiYGBPNyGHLn9z33i96zx/bd71pjBn9tqQzO3I4Tayv94WPmBNwKC7CO1wPHdP9uvu+Md/1nr6VSH9h0iaA==", + "license": "MIT", + "dependencies": { + "file-stream-rotator": "^0.6.1", + "object-hash": "^2.0.1", + "triple-beam": "^1.3.0", + "winston-transport": "^4.4.0" + }, + "engines": { + "node": ">=8" + }, + "peerDependencies": { + "winston": "^3" + } + }, + "node_modules/winston-transport": { + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.9.0.tgz", + "integrity": "sha512-8drMJ4rkgaPo1Me4zD/3WLfI/zPdA9o2IipKODunnGDcuqbHwjsbB79ylv04LCGGzU0xQ6vTznOMpQGaLhhm6A==", + "license": "MIT", + "dependencies": { + "logform": "^2.7.0", + "readable-stream": "^3.6.2", + "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 12.0.0" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "license": "MIT", + "engines": { + "node": ">=0.10.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==", + "license": "ISC" + }, + "node_modules/write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "license": "MIT", + "dependencies": { + "mkdirp": "^0.5.1" + }, + "engines": { + "node": ">=4" + } + } + } +} diff --git a/package.json b/package.json index 9246753..f73bf78 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,10 @@ "cybersource-rest-client": "0.0.61", "eslint": "^5.9.0", "jwk-to-pem": "^2.0.0", - "node-forge": "^1.2.1" + "node-forge": "^1.2.1", + "superagent": "^10.1.1" + }, + "devDependencies": { + "@faker-js/faker": "^9.3.0" } } From 01699f0d621664b79d72d461f2eff8355276687f Mon Sep 17 00:00:00 2001 From: Jason Chow <20251077+jaechow@users.noreply.github.com> Date: Tue, 14 Jan 2025 10:57:05 -0800 Subject: [PATCH 2/5] Added randomization of transactional data to all applicable files resulting in a more accurate reflection of unique data over time. --- .../SampleCodes/StandAloneHttpSignature.js | 96 ++++++++++++------- .../SampleCodes/StandAloneMetaKey.js | 31 +++--- .../SampleCodes/StandAloneOAuth.js | 29 +++--- ...uthorizationinternet-with-customheaders.js | 29 +++--- .../create-and-send-invoice-immediately.js | 22 +++-- .../Invoices/create-draft-invoice.js | 33 ++++--- ...e-and-assign-it-specific-invoice-number.js | 31 ++++-- .../create-invoice-without-sending-it.js | 31 ++++-- Samples/Invoicing/Invoices/update-invoice.js | 29 ++++-- Samples/MLEFeature/PaymentsWithMLE.js | 29 +++--- .../PaymentsWithMLEControlFromMAPConfig.js | 29 +++--- ...PaymentsWithMLEControlFromMapConfigOnly.js | 29 +++--- .../MerchantBoarding/create-registration.js | 21 ++-- .../merchant-boarding-amex-direct.js | 23 ++--- .../merchant-boarding-barclays.js | 19 ++-- .../merchant-boarding-bin-lookup.js | 20 ++-- .../MerchantBoarding/merchant-boarding-cup.js | 20 ++-- .../merchant-boarding-eftpos.js | 20 ++-- ...obal.js => merchant-boarding-fdiglobal.js} | 20 ++-- .../MerchantBoarding/merchant-boarding-gpx.js | 20 ++-- .../merchant-boarding-smartfdc.js | 20 ++-- .../merchant-boarding-tsys.js | 20 ++-- .../MerchantBoarding/merchant-boarding-vpc.js | 18 ++-- .../authentication-with-new-account.js | 28 +++--- .../authentication-with-no-redirect.js | 29 +++--- ...-with-customerid-as-payment-information.js | 25 ++--- .../enroll-with-pending-authentication.js | 29 +++--- .../enroll-with-transient-token.js | 26 ++--- .../enroll-with-travel-information.js | 41 ++++---- ...ending-authentication-with-unknown-path.js | 29 +++--- .../setup-completion-with-card-number.js | 7 +- ...up-completion-with-flex-transient-token.js | 3 +- ...h-fluid-data-value-and-payment-solution.js | 3 +- ...up-completion-with-secure-storage-token.js | 3 +- .../setup-completion-with-tms-token.js | 3 +- .../setup-completion-with-tokenized-card.js | 8 +- .../validate-authentication-results.js | 7 +- ...thorization-that-used-swiped-track-data.js | 3 +- .../Capture/capture-payment-service-fee.js | 1 + Samples/Payments/Capture/capture-payment.js | 1 + .../restaurant-capture-with-gratuity.js | 3 +- ...-p2pe-for-card-present-enabled-acquirer.js | 25 +++-- ...fin-pci-p2pe-with-visa-platform-connect.js | 26 +++-- ...nstrument-and-shipping-address-token-id.js | 5 +- .../Credit/credit-with-customer-token-id.js | 3 +- ...dit-with-instrument-identifier-token-id.js | 21 ++-- Samples/Payments/Credit/credit.js | 27 +++--- .../electronic-check-standalone-credits.js | 25 ++--- .../Payments/Credit/service-fees-credit.js | 27 +++--- ...an-express-direct-emv-with-contact-read.js | 3 +- ...orization-capture-for-timeout-void-flow.js | 27 +++--- ...tion-for-incremental-authorization-flow.js | 45 +++++---- ...authorization-for-timeout-reversal-flow.js | 28 +++--- ...-decisionmanager-for-single-transaction.js | 30 +++--- .../authorization-with-capturesale.js | 27 +++--- ...horization-with-customer-token-creation.js | 39 ++++---- ...nstrument-and-shipping-address-creation.js | 39 ++++---- .../authorization-with-customer-token-id.js | 3 +- ...with-decision-manager-buyer-information.js | 27 +++--- ...tion-with-decision-manager-custom-setup.js | 29 +++--- ...ith-decision-manager-device-information.js | 27 +++--- ...on-manager-merchant-defined-information.js | 31 +++--- ...h-decision-manager-shipping-information.js | 41 ++++---- ...ith-decision-manager-travel-information.js | 27 +++--- .../authorization-with-decision-manager.js | 29 +++--- .../authorization-with-dmaccept-pa-enroll.js | 27 +++--- .../authorization-with-dmreject-pa-enroll.js | 25 +++-- .../authorization-with-dmreview-pa-enroll.js | 25 +++-- ...th-instrument-identifier-token-creation.js | 40 ++++---- ...ion-with-instrument-identifier-token-id.js | 25 +++-- .../authorization-with-legacy-token.js | 21 ++-- ...on-with-pa-enroll-authentication-needed.js | 27 +++--- ...uthorization-with-payer-auth-validation.js | 26 ++--- ...-with-tms-token-bypassing-network-token.js | 17 +++- ...t-initiating-instalment-subscription-uk.js | 34 ++++--- .../cit-initiating-recurring-subscription.js | 32 ++++--- .../cit-placing-credential-on-file.js | 32 ++++--- .../Payments/digital-payment-googlepay.js | 27 +++--- .../Payments/digital-payments-applepay.js | 27 +++--- ...snap-account-with-visa-platform-connect.js | 11 ++- ...rom-cash-benefits-account-with-cashback.js | 3 +- ...snap-account-with-visa-platform-connect.js | 3 +- ...ectronic-check-debits-with-legacy-token.js | 20 ++-- .../Payments/electronic-check-debits.js | 22 +++-- .../Payments/incremental-authorization.js | 5 +- Samples/Payments/Payments/level-ii-data.js | 33 ++++--- Samples/Payments/Payments/level-iii-data.js | 33 ++++--- ...dustry-practice-delayed-charge-3ri-visa.js | 34 ++++--- .../mit-industry-practice-resubmission.js | 31 +++--- Samples/Payments/Payments/mit-instalment.js | 29 +++--- Samples/Payments/Payments/mit-recurring.js | 27 +++--- .../mit-unscheduled-credential-on-file.js | 30 +++--- .../Payments/partial-authorization.js | 28 +++--- .../Payments/payment-network-tokenization.js | 29 +++--- ...h-flex-token-create-permanent-tms-token.js | 33 ++++--- .../Payments/payment-with-flex-token.js | 23 ++--- ...actless-read-with-visa-platform-connect.js | 3 +- ...d-track-data-with-visa-platform-connect.js | 3 +- .../Payments/restaurant-authorization.js | 5 +- ...-data-for-card-present-enabled-acquirer.js | 11 ++- ...e-using-keyed-data-with-balance-inquiry.js | 11 ++- ...g-keyed-data-with-visa-platform-connect.js | 11 ++- ...rvice-fees-with-credit-card-transaction.js | 29 +++--- .../Payments/simple-authorizationinternet.js | 29 +++--- .../Payments/zero-dollar-authorization.js | 27 +++--- .../DecisionManager/add-data-to-list.js | 19 ++-- .../add-duplicate-information.js | 19 ++-- .../DecisionManager/basic-dm-transaction.js | 27 +++--- .../dm-with-buyer-information.js | 29 +++--- .../dm-with-decisionprofilereject-response.js | 29 +++--- .../dm-with-device-information.js | 31 +++--- .../dm-with-merchant-defined-information.js | 33 ++++--- .../dm-with-scoreexceedsthreshold-response.js | 52 +++++----- .../dm-with-shipping-information.js | 52 +++++----- .../dm-with-travel-information.js | 34 ++++--- .../DecisionManager/mark-as-suspect.js | 1 + .../DecisionManager/remove-from-history.js | 1 + .../Customer/create-customer.js | 9 +- ...ustomer-default-payment-instrument-card.js | 23 +++-- ...mer-non-default-payment-instrument-card.js | 23 +++-- ...ustomer-payment-instrument-bank-account.js | 19 ++-- ...stomer-payment-instrument-pinless-debit.js | 23 +++-- ...reate-customer-default-shipping-address.js | 19 ++-- ...e-customer-non-default-shipping-address.js | 19 ++-- ...eate-instrument-identifier-bank-account.js | 5 +- ...dentifier-card-enroll-for-network-token.js | 14 ++- .../create-instrument-identifier-card.js | 3 +- ...ent-identifier-for-network-tokenization.js | 4 +- .../create-payment-instrument-card.js | 23 +++-- ...create-payment-instrument-pinless-debit.js | 23 +++-- ...nerate-unified-checkout-capture-context.js | 3 +- .../basic-tax-calculation-request.js | 43 +++++---- .../committed-tax-call-request.js | 59 ++++++------ .../committed-tax-refund-call-request.js | 58 ++++++----- .../ValueAddedService/tax-refund-request.js | 59 ++++++------ .../void-committed-tax-call.js | 4 +- ...c6af1b0d67ab0e4918966dae7ee1ee9-audit.json | 25 +++++ ...6b8c94130b5eae2bd6063284e95d74e-audit.json | 15 +++ 138 files changed, 1900 insertions(+), 1307 deletions(-) rename Samples/MerchantBoarding/{merchant-boardin-fdiglobal.js => merchant-boarding-fdiglobal.js} (93%) create mode 100644 log/.908b0ba45c6af1b0d67ab0e4918966dae7ee1ee9-audit.json create mode 100644 log/.b2cd0d48a6b8c94130b5eae2bd6063284e95d74e-audit.json diff --git a/Samples/Authentication/SampleCodes/StandAloneHttpSignature.js b/Samples/Authentication/SampleCodes/StandAloneHttpSignature.js index 884e270..17c8c1b 100644 --- a/Samples/Authentication/SampleCodes/StandAloneHttpSignature.js +++ b/Samples/Authentication/SampleCodes/StandAloneHttpSignature.js @@ -3,46 +3,70 @@ const superagent = require('superagent'); var path = require('path'); const crypto = require('crypto'); +const { faker } = require('@faker-js/faker'); const { write } = require('fs'); - +var dt = new Date(); +var curDate = dt.toGMTString(); +/* Create timestamp 8 hours back for report query */ +dt.setHours(dt.getHours() - 8); var requestHost = 'apitest.cybersource.com'; var merchantId = 'testrest'; var merchantKeyId = '08c94330-f618-42a3-b09d-e1e43be5efda'; var merchantSecretKey = 'yBJxy6LjM2TmcPGu+GaJrHtkke25fPpUX+UY6/L/1tE='; -var payload = '{' + - ' \"clientReferenceInformation\": {' + - ' \"code\": \"TC50171_3\"' + - ' },' + - ' \"processingInformation\": {' + - ' \"commerceIndicator\": \"internet\"' + - ' },' + - ' \"orderInformation\": {' + - ' \"billTo\": {' + - ' \"firstName\": \"john\",' + - ' \"lastName\": \"doe\",' + - ' \"address1\": \"201 S. Division St.\",' + - ' \"postalCode\": \"48104-2201\",' + - ' \"locality\": \"Ann Arbor\",' + - ' \"administrativeArea\": \"MI\",' + - ' \"country\": \"US\",' + - ' \"phoneNumber\": \"999999999\",' + - ' \"email\": \"test@cybs.com\"' + - ' },' + - ' \"amountDetails\": {' + - ' \"totalAmount\": \"10\",' + - ' \"currency\": \"USD\"' + - ' }' + - ' },' + - ' \"paymentInformation\": {' + - ' \"card\": {' + - ' \"expirationYear\": \"2031\",' + - ' \"number\": \"5555555555554444\",' + - ' \"securityCode\": \"123\",' + - ' \"expirationMonth\": \"12\",' + - ' \"type\": \"002\"' + - ' }' + - ' }' + - '}'; + +function personify(){ + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + var expYear = dt.getFullYear()+4; + var payload = JSON.stringify({ + "clientReferenceInformation" : { + "code" : faker.string.numeric(10) + }, + "processingInformation" : { + "capture" : true, + "commerceIndicator" : "internet" + }, + "orderInformation" : { + "billTo" : { + "firstName" : fName, + "lastName" : lName, + "address1" : faker.location.streetAddress(), + "postalCode" : faker.location.zipCode(), + "locality" : faker.location.city(), + "administrativeArea" : faker.location.state(), + "country" : "US", + "phoneNumber" : faker.phone.number(), + "email" : faker.internet.email({firstName:fName,lastName:lName}) + }, + "amountDetails" : { + "totalAmount" : faker.commerce.price({ min: 10, max: 500 }), + "currency" : "USD" + } + }, + "paymentInformation" : { + "card" : { + "expirationYear" : expYear, + "number" : faker.finance.creditCardNumber({issuer: '414720#########L'}), + "securityCode" : faker.finance.creditCardCVV(), + "expirationMonth" : "12", + "type" : "001" + } + }, + "merchantDefinedInformation" : [ + { + "key" : "1", + "value" : merchantId + } + ], + "deviceInformation" : { + "fingerprintSessionId" : "", + "ipAddress" : faker.internet.ipv4(), + "useragent" : faker.internet.userAgent() + } + }); + return payload; +} +var payload = personify(); function paramToString(param) { if (param == undefined || param == null) { @@ -218,7 +242,7 @@ function processPost(callback) { } function processGet(callback) { - var resource = "/reporting/v3/reports?startTime=2021-02-01T00:00:00.0Z&endTime=2021-02-02T23:59:59.0Z&timeQueryType=executedTime&reportMimeType=application/xml"; + var resource = "/reporting/v3/reports?startTime="+dt.toISOString()+"&endTime="+(new Date()).toISOString()+"&timeQueryType=executedTime&reportMimeType=application/xml"; var method = "get"; var statusCode = -1; var url = 'https://' + requestHost + resource; diff --git a/Samples/Authentication/SampleCodes/StandAloneMetaKey.js b/Samples/Authentication/SampleCodes/StandAloneMetaKey.js index 4a5973e..4a576bd 100644 --- a/Samples/Authentication/SampleCodes/StandAloneMetaKey.js +++ b/Samples/Authentication/SampleCodes/StandAloneMetaKey.js @@ -2,6 +2,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); +const { faker } = require('@faker-js/faker'); // common parameters const AuthenticationType = 'http_signature'; @@ -23,6 +24,12 @@ const LogDirectory = 'log'; const LogfileMaxSize = '5242880'; //10 MB In Bytes const EnableMasking = true; +// persona parameters +var dt = new Date(); +var expYear = dt.getFullYear()+4; +var fName = faker.person.firstName(); +var lName = faker.person.lastName(); + function write_log_audit(status) { var filename = path.basename(__filename).split(".")[0]; console.log(`[Sample Code Testing] [${filename}] ${status}`); @@ -65,7 +72,7 @@ function simple_payments_using_meta_key(callback, enable_capture) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -78,29 +85,29 @@ function simple_payments_using_meta_key(callback, enable_capture) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '50.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.phone.number(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Authentication/SampleCodes/StandAloneOAuth.js b/Samples/Authentication/SampleCodes/StandAloneOAuth.js index 168039f..8837057 100644 --- a/Samples/Authentication/SampleCodes/StandAloneOAuth.js +++ b/Samples/Authentication/SampleCodes/StandAloneOAuth.js @@ -2,6 +2,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); +const { faker } = require('@faker-js/faker'); function getConfiguration() { @@ -37,7 +38,11 @@ function simple_authorization_internet(callback, accessToken, refreshToken) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -48,29 +53,29 @@ function simple_authorization_internet(callback, accessToken, refreshToken) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '50.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.phone.number(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/IntermediateHost/Payments/Payments/simple-authorizationinternet-with-customheaders.js b/Samples/IntermediateHost/Payments/Payments/simple-authorizationinternet-with-customheaders.js index 25c948b..df7aab6 100644 --- a/Samples/IntermediateHost/Payments/Payments/simple-authorizationinternet-with-customheaders.js +++ b/Samples/IntermediateHost/Payments/Payments/simple-authorizationinternet-with-customheaders.js @@ -2,6 +2,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); +const { faker } = require('@faker-js/faker'); var filePath = path.resolve('Data/ConfigurationWithIntermediateHost.js'); var configuration = require(filePath); @@ -12,7 +13,11 @@ function simple_authorization_internet_custom_headers(callback, enable_capture) var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -25,29 +30,29 @@ function simple_authorization_internet_custom_headers(callback, enable_capture) var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '50.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.phone.number(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Invoicing/Invoices/create-and-send-invoice-immediately.js b/Samples/Invoicing/Invoices/create-and-send-invoice-immediately.js index d8b3f1c..baa097f 100644 --- a/Samples/Invoicing/Invoices/create-and-send-invoice-immediately.js +++ b/Samples/Invoicing/Invoices/create-and-send-invoice-immediately.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function create_and_send_invoice_immediately(callback) { try { @@ -12,8 +13,10 @@ function create_and_send_invoice_immediately(callback) { var requestObj = new cybersourceRestApi.CreateInvoiceRequest(); var customerInformation = new cybersourceRestApi.Invoicingv2invoicesCustomerInformation(); - customerInformation.name = 'Tanya Lee'; - customerInformation.email = 'tanya.lee@my-email.world'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + customerInformation.name = fName + ' ' + lName; + customerInformation.email = faker.internet.email({firstName:fName,lastName:lName}); requestObj.customerInformation = customerInformation; var invoiceInformation = new cybersourceRestApi.Invoicingv2invoicesInvoiceInformation(); @@ -26,11 +29,14 @@ function create_and_send_invoice_immediately(callback) { var orderInformation = new cybersourceRestApi.Invoicingv2invoicesOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Invoicingv2invoicesOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '2623.64'; + var totalAmount = faker.commerce.price({ min: 10, max: 500 }); + orderInformationAmountDetails.totalAmount = totalAmount; orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.discountAmount = '126.08'; - orderInformationAmountDetails.discountPercent = 5.0; - orderInformationAmountDetails.subAmount = 2749.72; + var discount = Math.round((25/100)*totalAmount); + var discountAmount = discount.toFixed(2); + orderInformationAmountDetails.discountAmount = discountAmount; + orderInformationAmountDetails.discountPercent = .25; + orderInformationAmountDetails.subAmount = (totalAmount - discountAmount).toFixed(2); orderInformationAmountDetails.minimumPartialAmount = 20.00; var orderInformationAmountDetailsTaxDetails = new cybersourceRestApi.Invoicingv2invoicesOrderInformationAmountDetailsTaxDetails(); orderInformationAmountDetailsTaxDetails.type = 'State Tax'; @@ -48,8 +54,8 @@ function create_and_send_invoice_immediately(callback) { var lineItems = new Array(); var lineItems1 = new cybersourceRestApi.Invoicingv2invoicesOrderInformationLineItems(); - lineItems1.productSku = 'P653727383'; - lineItems1.productName = 'First line item\'s name'; + lineItems1.productSku = faker.commerce.isbn(13); + lineItems1.productName = faker.commerce.productName(); lineItems1.quantity = 21; lineItems1.unitPrice = '120.08'; lineItems.push(lineItems1); diff --git a/Samples/Invoicing/Invoices/create-draft-invoice.js b/Samples/Invoicing/Invoices/create-draft-invoice.js index 2523cef..1e4da37 100644 --- a/Samples/Invoicing/Invoices/create-draft-invoice.js +++ b/Samples/Invoicing/Invoices/create-draft-invoice.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function create_draft_invoice(callback) { try { @@ -12,13 +13,20 @@ function create_draft_invoice(callback) { var requestObj = new cybersourceRestApi.CreateInvoiceRequest(); var customerInformation = new cybersourceRestApi.Invoicingv2invoicesCustomerInformation(); - customerInformation.name = 'Tanya Lee'; - customerInformation.email = 'tanya.lee@my-email.world'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + customerInformation.name = fName + ' ' + lName; + customerInformation.email = faker.internet.email({firstName:fName,lastName:lName}); requestObj.customerInformation = customerInformation; - + var invoiceInformation = new cybersourceRestApi.Invoicingv2invoicesInvoiceInformation(); - invoiceInformation.description = 'This is a test invoice'; - invoiceInformation.dueDate = '2019-07-11'; + invoiceInformation.description = faker.lorem.sentence(5); + var date = new Date(); + var year = date.getFullYear(); + var month = (date.getMonth() + 1).toString().padStart(2, '0'); + var day = date.getDate().toString().padStart(2, '0'); + var formattedDate = `${year}-${month}-${day}`; + invoiceInformation.dueDate = formattedDate; invoiceInformation.sendImmediately = false; invoiceInformation.allowPartialPayments = true; invoiceInformation.deliveryMode = 'none'; @@ -26,11 +34,14 @@ function create_draft_invoice(callback) { var orderInformation = new cybersourceRestApi.Invoicingv2invoicesOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Invoicingv2invoicesOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '2623.64'; + var totalAmount = faker.commerce.price({ min: 10, max: 500 }); + orderInformationAmountDetails.totalAmount = totalAmount; orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.discountAmount = '126.08'; - orderInformationAmountDetails.discountPercent = 5.0; - orderInformationAmountDetails.subAmount = 2749.72; + var discount = Math.round((25/100)*totalAmount); + var discountAmount = discount.toFixed(2); + orderInformationAmountDetails.discountAmount = discountAmount; + orderInformationAmountDetails.discountPercent = .25; + orderInformationAmountDetails.subAmount = totalAmount - discountAmount; orderInformationAmountDetails.minimumPartialAmount = 20.00; var orderInformationAmountDetailsTaxDetails = new cybersourceRestApi.Invoicingv2invoicesOrderInformationAmountDetailsTaxDetails(); orderInformationAmountDetailsTaxDetails.type = 'State Tax'; @@ -48,8 +59,8 @@ function create_draft_invoice(callback) { var lineItems = new Array(); var lineItems1 = new cybersourceRestApi.Invoicingv2invoicesOrderInformationLineItems(); - lineItems1.productSku = 'P653727383'; - lineItems1.productName = 'First line item\'s name'; + lineItems1.productSku = faker.commerce.isbn(13); + lineItems1.productName = faker.commerce.productName(); lineItems1.quantity = 21; lineItems1.unitPrice = '120.08'; lineItems.push(lineItems1); diff --git a/Samples/Invoicing/Invoices/create-invoice-and-assign-it-specific-invoice-number.js b/Samples/Invoicing/Invoices/create-invoice-and-assign-it-specific-invoice-number.js index 22b5178..5258a62 100644 --- a/Samples/Invoicing/Invoices/create-invoice-and-assign-it-specific-invoice-number.js +++ b/Samples/Invoicing/Invoices/create-invoice-and-assign-it-specific-invoice-number.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function create_invoice_and_assign_it_specific_invoice_number(callback) { try { @@ -12,14 +13,21 @@ function create_invoice_and_assign_it_specific_invoice_number(callback) { var requestObj = new cybersourceRestApi.CreateInvoiceRequest(); var customerInformation = new cybersourceRestApi.Invoicingv2invoicesCustomerInformation(); - customerInformation.name = 'Tanya Lee'; - customerInformation.email = 'tanya.lee@my-email.world'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + customerInformation.name = fName + ' ' + lName; + customerInformation.email = faker.internet.email({firstName:fName,lastName:lName}); requestObj.customerInformation = customerInformation; var invoiceInformation = new cybersourceRestApi.Invoicingv2invoicesInvoiceInformation(); - invoiceInformation.invoiceNumber = 'A123'; + invoiceInformation.invoiceNumber = faker.string.alphanumeric(5); invoiceInformation.description = 'This is a test invoice'; - invoiceInformation.dueDate = '2019-07-11'; + var date = new Date(); + var year = date.getFullYear(); + var month = (date.getMonth() + 1).toString().padStart(2, '0'); + var day = date.getDate().toString().padStart(2, '0'); + var formattedDate = `${year}-${month}-${day}`; + invoiceInformation.dueDate = formattedDate; invoiceInformation.sendImmediately = true; invoiceInformation.allowPartialPayments = true; invoiceInformation.deliveryMode = 'email'; @@ -27,11 +35,14 @@ function create_invoice_and_assign_it_specific_invoice_number(callback) { var orderInformation = new cybersourceRestApi.Invoicingv2invoicesOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Invoicingv2invoicesOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '2623.64'; + var totalAmount = faker.commerce.price({ min: 10, max: 500 }); + orderInformationAmountDetails.totalAmount = totalAmount; orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.discountAmount = '126.08'; - orderInformationAmountDetails.discountPercent = 5.0; - orderInformationAmountDetails.subAmount = 2749.72; + var discount = Math.round((25/100)*totalAmount); + var discountAmount = discount.toFixed(2); + orderInformationAmountDetails.discountAmount = discountAmount; + orderInformationAmountDetails.discountPercent = .25; + orderInformationAmountDetails.subAmount = (totalAmount - discountAmount).toFixed(2); orderInformationAmountDetails.minimumPartialAmount = 20.00; var orderInformationAmountDetailsTaxDetails = new cybersourceRestApi.Invoicingv2invoicesOrderInformationAmountDetailsTaxDetails(); orderInformationAmountDetailsTaxDetails.type = 'State Tax'; @@ -49,8 +60,8 @@ function create_invoice_and_assign_it_specific_invoice_number(callback) { var lineItems = new Array(); var lineItems1 = new cybersourceRestApi.Invoicingv2invoicesOrderInformationLineItems(); - lineItems1.productSku = 'P653727383'; - lineItems1.productName = 'First line item\'s name'; + lineItems1.productSku = faker.commerce.isbn(13); + lineItems1.productName = faker.commerce.productName(); lineItems1.quantity = 21; lineItems1.unitPrice = '120.08'; lineItems.push(lineItems1); diff --git a/Samples/Invoicing/Invoices/create-invoice-without-sending-it.js b/Samples/Invoicing/Invoices/create-invoice-without-sending-it.js index 734f76b..bc23cf7 100644 --- a/Samples/Invoicing/Invoices/create-invoice-without-sending-it.js +++ b/Samples/Invoicing/Invoices/create-invoice-without-sending-it.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function create_invoice_without_sending_it(callback) { try { @@ -12,14 +13,21 @@ function create_invoice_without_sending_it(callback) { var requestObj = new cybersourceRestApi.CreateInvoiceRequest(); var customerInformation = new cybersourceRestApi.Invoicingv2invoicesCustomerInformation(); - customerInformation.name = 'Tanya Lee'; - customerInformation.email = 'tanya.lee@my-email.world'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + customerInformation.name = fName + ' ' + lName; + customerInformation.email = faker.internet.email({firstName:fName,lastName:lName}); requestObj.customerInformation = customerInformation; var invoiceInformation = new cybersourceRestApi.Invoicingv2invoicesInvoiceInformation(); - invoiceInformation.invoiceNumber = 'A123'; + invoiceInformation.invoiceNumber = faker.string.alphanumeric(5); invoiceInformation.description = 'This is a test invoice'; - invoiceInformation.dueDate = '2019-07-11'; + var date = new Date(); + var year = date.getFullYear(); + var month = (date.getMonth() + 1).toString().padStart(2, '0'); + var day = date.getDate().toString().padStart(2, '0'); + var formattedDate = `${year}-${month}-${day}`; + invoiceInformation.dueDate = formattedDate; invoiceInformation.sendImmediately = true; invoiceInformation.allowPartialPayments = true; invoiceInformation.deliveryMode = 'none'; @@ -27,11 +35,14 @@ function create_invoice_without_sending_it(callback) { var orderInformation = new cybersourceRestApi.Invoicingv2invoicesOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Invoicingv2invoicesOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '2623.64'; + var totalAmount = faker.commerce.price({ min: 10, max: 500 }); + orderInformationAmountDetails.totalAmount = totalAmount; orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.discountAmount = '126.08'; - orderInformationAmountDetails.discountPercent = 5.0; - orderInformationAmountDetails.subAmount = 2749.72; + var discount = Math.round((25/100)*totalAmount); + var discountAmount = discount.toFixed(2); + orderInformationAmountDetails.discountAmount = discountAmount; + orderInformationAmountDetails.discountPercent = .25; + orderInformationAmountDetails.subAmount = (totalAmount - discountAmount).toFixed(2); orderInformationAmountDetails.minimumPartialAmount = 20.00; var orderInformationAmountDetailsTaxDetails = new cybersourceRestApi.Invoicingv2invoicesOrderInformationAmountDetailsTaxDetails(); orderInformationAmountDetailsTaxDetails.type = 'State Tax'; @@ -49,8 +60,8 @@ function create_invoice_without_sending_it(callback) { var lineItems = new Array(); var lineItems1 = new cybersourceRestApi.Invoicingv2invoicesOrderInformationLineItems(); - lineItems1.productSku = 'P653727383'; - lineItems1.productName = 'First line item\'s name'; + lineItems1.productSku = faker.commerce.isbn(13); + lineItems1.productName = faker.commerce.productName(); lineItems1.quantity = 21; lineItems1.unitPrice = '120.08'; lineItems.push(lineItems1); diff --git a/Samples/Invoicing/Invoices/update-invoice.js b/Samples/Invoicing/Invoices/update-invoice.js index 3e3f8aa..56dd846 100644 --- a/Samples/Invoicing/Invoices/update-invoice.js +++ b/Samples/Invoicing/Invoices/update-invoice.js @@ -5,6 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); const create_draft_invoice = require('./create-draft-invoice'); +const { faker } = require('@faker-js/faker'); function update_invoice(callback) { try { @@ -13,24 +14,34 @@ function update_invoice(callback) { var requestObj = new cybersourceRestApi.UpdateInvoiceRequest(); var customerInformation = new cybersourceRestApi.Invoicingv2invoicesCustomerInformation(); - customerInformation.name = 'New Customer Name'; - customerInformation.email = 'new_email@my-email.world'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + customerInformation.name = fName + ' ' + lName; + customerInformation.email = faker.internet.email({firstName:fName,lastName:lName}); requestObj.customerInformation = customerInformation; var invoiceInformation = new cybersourceRestApi.Invoicingv2invoicesInvoiceInformation(); invoiceInformation.description = 'This is after updating invoice'; - invoiceInformation.dueDate = '2019-07-11'; + var date = new Date(); + var year = date.getFullYear(); + var month = (date.getMonth() + 1).toString().padStart(2, '0'); + var day = date.getDate().toString().padStart(2, '0'); + var formattedDate = `${year}-${month}-${day}`; + invoiceInformation.dueDate = formattedDate; invoiceInformation.allowPartialPayments = true; invoiceInformation.deliveryMode = 'none'; requestObj.invoiceInformation = invoiceInformation; var orderInformation = new cybersourceRestApi.Invoicingv2invoicesOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Invoicingv2invoicesOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '2623.64'; + var totalAmount = faker.commerce.price({ min: 10, max: 500 }); + orderInformationAmountDetails.totalAmount = totalAmount; orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.discountAmount = '126.08'; - orderInformationAmountDetails.discountPercent = 5.0; - orderInformationAmountDetails.subAmount = 2749.72; + var discount = Math.round((25/100)*totalAmount); + var discountAmount = discount.toFixed(2); + orderInformationAmountDetails.discountAmount = discountAmount; + orderInformationAmountDetails.discountPercent = .25; + orderInformationAmountDetails.subAmount = (totalAmount - discountAmount).toFixed(2); orderInformationAmountDetails.minimumPartialAmount = 20.00; var orderInformationAmountDetailsTaxDetails = new cybersourceRestApi.Invoicingv2invoicesOrderInformationAmountDetailsTaxDetails(); orderInformationAmountDetailsTaxDetails.type = 'State Tax'; @@ -48,8 +59,8 @@ function update_invoice(callback) { var lineItems = new Array(); var lineItems1 = new cybersourceRestApi.Invoicingv2invoicesOrderInformationLineItems(); - lineItems1.productSku = 'P653727383'; - lineItems1.productName = 'First line item\'s name'; + lineItems1.productSku = faker.commerce.isbn(13); + lineItems1.productName = faker.commerce.productName(); lineItems1.quantity = 21; lineItems1.unitPrice = '120.08'; lineItems.push(lineItems1); diff --git a/Samples/MLEFeature/PaymentsWithMLE.js b/Samples/MLEFeature/PaymentsWithMLE.js index d8e8c46..53ba7f3 100644 --- a/Samples/MLEFeature/PaymentsWithMLE.js +++ b/Samples/MLEFeature/PaymentsWithMLE.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/ConfigurationWithMLE.js'); var {MLEConfiguration1} = require(filePath); +const { faker } = require('@faker-js/faker'); function simple_authorization_internet_with_MLE(callback, enable_capture) { try { @@ -14,7 +15,11 @@ function simple_authorization_internet_with_MLE(callback, enable_capture) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + clientReferenceInformation.code = faker.string.numeric(10); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -27,29 +32,29 @@ function simple_authorization_internet_with_MLE(callback, enable_capture) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '50.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.phone.number(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/MLEFeature/PaymentsWithMLEControlFromMAPConfig.js b/Samples/MLEFeature/PaymentsWithMLEControlFromMAPConfig.js index 5c09f06..af6cb14 100644 --- a/Samples/MLEFeature/PaymentsWithMLEControlFromMAPConfig.js +++ b/Samples/MLEFeature/PaymentsWithMLEControlFromMAPConfig.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/ConfigurationWithMLE.js'); var {MLEConfiguration2} = require(filePath); +const { faker } = require('@faker-js/faker'); function simple_authorization_internet_with_Map_Control_MLE(callback, enable_capture) { try { @@ -14,7 +15,11 @@ function simple_authorization_internet_with_Map_Control_MLE(callback, enable_cap var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + clientReferenceInformation.code = faker.string.numeric(10); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -27,29 +32,29 @@ function simple_authorization_internet_with_Map_Control_MLE(callback, enable_cap var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '50.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.phone.number(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/MLEFeature/PaymentsWithMLEControlFromMapConfigOnly.js b/Samples/MLEFeature/PaymentsWithMLEControlFromMapConfigOnly.js index 7e7ddfe..a97b75f 100644 --- a/Samples/MLEFeature/PaymentsWithMLEControlFromMapConfigOnly.js +++ b/Samples/MLEFeature/PaymentsWithMLEControlFromMapConfigOnly.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/ConfigurationWithMLE.js'); var {MLEConfiguration3} = require(filePath); +const { faker } = require('@faker-js/faker'); function simple_authorization_internet_with_Map_Control_MLE_True(callback, enable_capture) { try { @@ -14,7 +15,11 @@ function simple_authorization_internet_with_Map_Control_MLE_True(callback, enabl var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + clientReferenceInformation.code = faker.string.numeric(10); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -27,29 +32,29 @@ function simple_authorization_internet_with_Map_Control_MLE_True(callback, enabl var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '50.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.phone.number(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/MerchantBoarding/create-registration.js b/Samples/MerchantBoarding/create-registration.js index bdc80e3..cbccdac 100644 --- a/Samples/MerchantBoarding/create-registration.js +++ b/Samples/MerchantBoarding/create-registration.js @@ -5,6 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/MerchantBoardingConfiguration.js'); var configuration = require(filePath); const UUID = require('uuid'); +const { faker } = require('@faker-js/faker'); const { PostRegistrationBody, @@ -54,22 +55,22 @@ function create_registration(callback) { organizationInformation.configurable = true; const businessInformation = new Boardingv1registrationsOrganizationInformationBusinessInformation(); - businessInformation.name = "StuartWickedFastEatz"; + businessInformation.name = faker.word.adjective()+faker.word.noun(); const address = new Boardingv1registrationsOrganizationInformationBusinessInformationAddress(); address.country = "US"; - address.address1 = "123456 SandMarket"; - address.locality = "ORMOND BEACH"; - address.administrativeArea = "FL"; - address.postalCode = "32176"; + address.address1 = faker.location.streetAddress(); + address.locality = faker.location.city(); + address.administrativeArea = "CA"; + address.postalCode = faker.helpers.fake('{{helpers.fromRegExp("[9][0-6][0-1][0-6][0-9]")}}'); businessInformation.address = address; - businessInformation.websiteUrl = "https://www.StuartWickedEats.com"; - businessInformation.phoneNumber = "6574567813"; + businessInformation.websiteUrl = faker.internet.url({ protocol: 'https', appendSlash: false }); + businessInformation.phoneNumber = faker.string.numeric({ length: { min: 10, max: 10 } }); const businessContact = new Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact(); - businessContact.firstName = "Stuart"; - businessContact.lastName = "Stuart"; - businessContact.phoneNumber = "6574567813"; + businessContact.firstName = faker.person.firstName(); + businessContact.lastName = faker.person.lastName(); + businessContact.phoneNumber = faker.string.numeric({ length: { min: 10, max: 10 } }); businessContact.email = "svc_email_bt@corpdev.visa.com"; businessInformation.businessContact = businessContact; businessInformation.merchantCategoryCode = "5999"; diff --git a/Samples/MerchantBoarding/merchant-boarding-amex-direct.js b/Samples/MerchantBoarding/merchant-boarding-amex-direct.js index d171fe5..7d07f8d 100644 --- a/Samples/MerchantBoarding/merchant-boarding-amex-direct.js +++ b/Samples/MerchantBoarding/merchant-boarding-amex-direct.js @@ -5,6 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/MerchantBoardingConfiguration.js'); var configuration = require(filePath); const UUID = require('uuid'); +const { faker } = require('@faker-js/faker'); const { v4: uuidv4 } = require('uuid'); @@ -67,23 +68,23 @@ function merchant_boarding_amex_direct(callback) { // Create and set business information const businessInformation = new Boardingv1registrationsOrganizationInformationBusinessInformation(); - businessInformation.name = "StuartWickedFastEatz"; + businessInformation.name = faker.word.adjective()+faker.word.noun(); const address = new Boardingv1registrationsOrganizationInformationBusinessInformationAddress(); address.country = "US"; - address.address1 = "123456 SandMarket"; - address.locality = "ORMOND BEACH"; + address.address1 = faker.location.streetAddress(); + address.locality = faker.location.city(); address.administrativeArea = "FL"; - address.postalCode = "32176"; + address.postalCode = faker.helpers.fake('{{helpers.fromRegExp("[9][0-6][0-1][0-6][0-9]")}}'); businessInformation.address = address; - businessInformation.websiteUrl = "https://www.StuartWickedEats.com"; - businessInformation.phoneNumber = "6574567813"; + businessInformation.websiteUrl = faker.internet.url({ protocol: 'https', appendSlash: false }); + businessInformation.phoneNumber = faker.string.numeric(10); const businessContact = new Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact(); - businessContact.firstName = "Stuart"; - businessContact.lastName = "Stuart"; - businessContact.phoneNumber = "6574567813"; + businessContact.firstName = faker.person.firstName(); + businessContact.firstName = faker.person.lastName(); + businessContact.phoneNumber = faker.string.numeric(10); businessContact.email = "svc_email_bt@corpdev.visa.com"; businessInformation.businessContact = businessContact; @@ -125,8 +126,8 @@ function merchant_boarding_amex_direct(callback) { const merchantDescriptorInformation = new CardProcessingConfigCommonMerchantDescriptorInformation(); merchantDescriptorInformation.city = "Cupertino"; merchantDescriptorInformation.country = "USA"; - merchantDescriptorInformation.name = "Mer name"; - merchantDescriptorInformation.phone = "8885554444"; + merchantDescriptorInformation.name = faker.company.name(); + merchantDescriptorInformation.phone = faker.string.numeric(10); merchantDescriptorInformation.zip = "94043"; merchantDescriptorInformation.state = "CA"; merchantDescriptorInformation.street = "mer street"; diff --git a/Samples/MerchantBoarding/merchant-boarding-barclays.js b/Samples/MerchantBoarding/merchant-boarding-barclays.js index 99457f3..f08504a 100644 --- a/Samples/MerchantBoarding/merchant-boarding-barclays.js +++ b/Samples/MerchantBoarding/merchant-boarding-barclays.js @@ -5,6 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/MerchantBoardingConfiguration.js'); var configuration = require(filePath); const UUID = require('uuid'); +const { faker } = require('@faker-js/faker'); const { v4: uuidv4 } = require('uuid'); @@ -56,22 +57,22 @@ function merchant_boarding_barclays(callback) { organizationInformation.configurable = true; const businessInformation = new Boardingv1registrationsOrganizationInformationBusinessInformation(); - businessInformation.name = "StuartWickedFastEatz"; + businessInformation.name = faker.word.adjective()+faker.word.noun(); const address = new Boardingv1registrationsOrganizationInformationBusinessInformationAddress(); address.country = "US"; - address.address1 = "123456 SandMarket"; - address.locality = "ORMOND BEACH"; + address.address1 = faker.location.streetAddress(); + address.locality = faker.location.city(); address.administrativeArea = "FL"; - address.postalCode = "32176"; + address.postalCode = faker.helpers.fake('{{helpers.fromRegExp("[9][0-6][0-1][0-6][0-9]")}}'); businessInformation.address = address; - businessInformation.websiteUrl = "https://www.StuartWickedEats.com"; - businessInformation.phoneNumber = "6574567813"; + businessInformation.websiteUrl = faker.internet.url({ protocol: 'https', appendSlash: false }); + businessInformation.phoneNumber = faker.string.numeric(10); const businessContact = new Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact(); - businessContact.firstName = "Stuart"; - businessContact.lastName = "Stuart"; - businessContact.phoneNumber = "6574567813"; + businessContact.firstName = faker.person.firstName(); + businessContact.firstName = faker.person.lastName(); + businessContact.phoneNumber = faker.string.numeric(10); businessContact.email = "svc_email_bt@corpdev.visa.com"; businessInformation.businessContact = businessContact; businessInformation.merchantCategoryCode = "5999"; diff --git a/Samples/MerchantBoarding/merchant-boarding-bin-lookup.js b/Samples/MerchantBoarding/merchant-boarding-bin-lookup.js index f726a4b..b5c5dd6 100644 --- a/Samples/MerchantBoarding/merchant-boarding-bin-lookup.js +++ b/Samples/MerchantBoarding/merchant-boarding-bin-lookup.js @@ -5,7 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/MerchantBoardingConfiguration.js'); var configuration = require(filePath); const UUID = require('uuid'); - +const { faker } = require('@faker-js/faker'); const { v4: uuidv4 } = require('uuid'); const { @@ -71,23 +71,23 @@ function merchant_boarding_bin_lookup(callback) { // Business Information const businessInformation = new Boardingv1registrationsOrganizationInformationBusinessInformation(); - businessInformation.name = "StuartWickedFastEatz"; + businessInformation.name = faker.word.adjective()+faker.word.noun(); const address = new Boardingv1registrationsOrganizationInformationBusinessInformationAddress(); address.country = "US"; - address.address1 = "123456 SandMarket"; - address.locality = "ORMOND BEACH"; + address.address1 = faker.location.streetAddress(); + address.locality = faker.location.city(); address.administrativeArea = "FL"; - address.postalCode = "32176"; + address.postalCode = faker.helpers.fake('{{helpers.fromRegExp("[9][0-6][0-1][0-6][0-9]")}}'); businessInformation.address = address; - businessInformation.websiteUrl = "https://www.StuartWickedEats.com"; - businessInformation.phoneNumber = "6574567813"; + businessInformation.websiteUrl = faker.internet.url({ protocol: 'https', appendSlash: false }); + businessInformation.phoneNumber = faker.string.numeric(10); const businessContact = new Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact(); - businessContact.firstName = "Stuart"; - businessContact.lastName = "Stuart"; - businessContact.phoneNumber = "6574567813"; + businessContact.firstName = faker.person.firstName(); + businessContact.firstName = faker.person.lastName(); + businessContact.phoneNumber = faker.string.numeric(10); businessContact.email = "svc_email_bt@corpdev.visa.com"; businessInformation.businessContact = businessContact; diff --git a/Samples/MerchantBoarding/merchant-boarding-cup.js b/Samples/MerchantBoarding/merchant-boarding-cup.js index 9342209..115668c 100644 --- a/Samples/MerchantBoarding/merchant-boarding-cup.js +++ b/Samples/MerchantBoarding/merchant-boarding-cup.js @@ -5,7 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/MerchantBoardingConfiguration.js'); var configuration = require(filePath); const UUID = require('uuid'); - +const { faker } = require('@faker-js/faker'); const { v4: uuidv4 } = require('uuid'); const { @@ -71,23 +71,23 @@ function merchant_boarding_cup(callback) { // Business Information const businessInformation = new Boardingv1registrationsOrganizationInformationBusinessInformation(); - businessInformation.name = "StuartWickedFastEatz"; + businessInformation.name = faker.word.adjective()+faker.word.noun(); const address = new Boardingv1registrationsOrganizationInformationBusinessInformationAddress(); address.country = "US"; - address.address1 = "123456 SandMarket"; - address.locality = "ORMOND BEACH"; + address.address1 = faker.location.streetAddress(); + address.locality = faker.location.city(); address.administrativeArea = "FL"; - address.postalCode = "32176"; + address.postalCode = faker.helpers.fake('{{helpers.fromRegExp("[9][0-6][0-1][0-6][0-9]")}}'); businessInformation.address = address; - businessInformation.websiteUrl = "https://www.StuartWickedEats.com"; - businessInformation.phoneNumber = "6574567813"; + businessInformation.websiteUrl = faker.internet.url({ protocol: 'https', appendSlash: false }); + businessInformation.phoneNumber = faker.string.numeric(10); const businessContact = new Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact(); - businessContact.firstName = "Stuart"; - businessContact.lastName = "Stuart"; - businessContact.phoneNumber = "6574567813"; + businessContact.firstName = faker.person.firstName(); + businessContact.firstName = faker.person.lastName(); + businessContact.phoneNumber = faker.string.numeric(10); businessContact.email = "svc_email_bt@corpdev.visa.com"; businessInformation.businessContact = businessContact; diff --git a/Samples/MerchantBoarding/merchant-boarding-eftpos.js b/Samples/MerchantBoarding/merchant-boarding-eftpos.js index bcd176c..45a41e8 100644 --- a/Samples/MerchantBoarding/merchant-boarding-eftpos.js +++ b/Samples/MerchantBoarding/merchant-boarding-eftpos.js @@ -5,7 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/MerchantBoardingConfiguration.js'); var configuration = require(filePath); const UUID = require('uuid'); - +const { faker } = require('@faker-js/faker'); const { v4: uuidv4 } = require('uuid'); const { @@ -67,23 +67,23 @@ function merchant_boarding_eftpos(callback) { organizationInformation.configurable = true; const businessInformation = new Boardingv1registrationsOrganizationInformationBusinessInformation(); - businessInformation.name = "StuartWickedFastEatz"; + businessInformation.name = faker.word.adjective()+faker.word.noun(); const address = new Boardingv1registrationsOrganizationInformationBusinessInformationAddress(); address.country = "US"; - address.address1 = "123456 SandMarket"; - address.locality = "ORMOND BEACH"; + address.address1 = faker.location.streetAddress(); + address.locality = faker.location.city(); address.administrativeArea = "FL"; - address.postalCode = "32176"; + address.postalCode = faker.helpers.fake('{{helpers.fromRegExp("[9][0-6][0-1][0-6][0-9]")}}'); businessInformation.address = address; - businessInformation.websiteUrl = "https://www.StuartWickedEats.com"; - businessInformation.phoneNumber = "6574567813"; + businessInformation.websiteUrl = faker.internet.url({ protocol: 'https', appendSlash: false }); + businessInformation.phoneNumber = faker.string.numeric(10); const businessContact = new Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact(); - businessContact.firstName = "Stuart"; - businessContact.lastName = "Stuart"; - businessContact.phoneNumber = "6574567813"; + businessContact.firstName = faker.person.firstName(); + businessContact.firstName = faker.person.lastName(); + businessContact.phoneNumber = faker.string.numeric(10); businessContact.email = "svc_email_bt@corpdev.visa.com"; businessInformation.businessContact = businessContact; diff --git a/Samples/MerchantBoarding/merchant-boardin-fdiglobal.js b/Samples/MerchantBoarding/merchant-boarding-fdiglobal.js similarity index 93% rename from Samples/MerchantBoarding/merchant-boardin-fdiglobal.js rename to Samples/MerchantBoarding/merchant-boarding-fdiglobal.js index 5794b98..0c81995 100644 --- a/Samples/MerchantBoarding/merchant-boardin-fdiglobal.js +++ b/Samples/MerchantBoarding/merchant-boarding-fdiglobal.js @@ -5,7 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/MerchantBoardingConfiguration.js'); var configuration = require(filePath); const UUID = require('uuid'); - +const { faker } = require('@faker-js/faker'); const { v4: uuidv4 } = require('uuid'); const { @@ -68,23 +68,23 @@ function merchant_boarding_fdiglobal(callback) { organizationInformation.configurable = true; const businessInformation = new Boardingv1registrationsOrganizationInformationBusinessInformation(); - businessInformation.name = "StuartWickedFastEatz"; + businessInformation.name = faker.word.adjective()+faker.word.noun(); const address = new Boardingv1registrationsOrganizationInformationBusinessInformationAddress(); address.country = "US"; - address.address1 = "123456 SandMarket"; - address.locality = "ORMOND BEACH"; + address.address1 = faker.location.streetAddress(); + address.locality = faker.location.city(); address.administrativeArea = "FL"; - address.postalCode = "32176"; + address.postalCode = faker.helpers.fake('{{helpers.fromRegExp("[9][0-6][0-1][0-6][0-9]")}}'); businessInformation.address = address; - businessInformation.websiteUrl = "https://www.StuartWickedEats.com"; - businessInformation.phoneNumber = "6574567813"; + businessInformation.websiteUrl = faker.internet.url({ protocol: 'https', appendSlash: false }); + businessInformation.phoneNumber = faker.string.numeric(10); const businessContact = new Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact(); - businessContact.firstName = "Stuart"; - businessContact.lastName = "Stuart"; - businessContact.phoneNumber = "6574567813"; + businessContact.firstName = faker.person.firstName(); + businessContact.firstName = faker.person.lastName(); + businessContact.phoneNumber = faker.string.numeric(10); businessContact.email = "svc_email_bt@corpdev.visa.com"; businessInformation.businessContact = businessContact; diff --git a/Samples/MerchantBoarding/merchant-boarding-gpx.js b/Samples/MerchantBoarding/merchant-boarding-gpx.js index 50fc706..f589bb1 100644 --- a/Samples/MerchantBoarding/merchant-boarding-gpx.js +++ b/Samples/MerchantBoarding/merchant-boarding-gpx.js @@ -5,7 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/MerchantBoardingConfiguration.js'); var configuration = require(filePath); const UUID = require('uuid'); - +const { faker } = require('@faker-js/faker'); const { v4: uuidv4 } = require('uuid'); const { @@ -69,23 +69,23 @@ function merchant_boarding_gpx(callback) { organizationInformation.configurable = true; const businessInformation = new Boardingv1registrationsOrganizationInformationBusinessInformation(); - businessInformation.name = "StuartWickedFastEatz"; + businessInformation.name = faker.word.adjective()+faker.word.noun(); const address = new Boardingv1registrationsOrganizationInformationBusinessInformationAddress(); address.country = "US"; - address.address1 = "123456 SandMarket"; - address.locality = "ORMOND BEACH"; + address.address1 = faker.location.streetAddress(); + address.locality = faker.location.city(); address.administrativeArea = "FL"; - address.postalCode = "32176"; + address.postalCode = faker.helpers.fake('{{helpers.fromRegExp("[9][0-6][0-1][0-6][0-9]")}}'); businessInformation.address = address; - businessInformation.websiteUrl = "https://www.StuartWickedEats.com"; - businessInformation.phoneNumber = "6574567813"; + businessInformation.websiteUrl = faker.internet.url({ protocol: 'https', appendSlash: false }); + businessInformation.phoneNumber = faker.string.numeric(10); const businessContact = new Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact(); - businessContact.firstName = "Stuart"; - businessContact.lastName = "Stuart"; - businessContact.phoneNumber = "6574567813"; + businessContact.firstName = faker.person.firstName(); + businessContact.firstName = faker.person.lastName(); + businessContact.phoneNumber = faker.string.numeric(10); businessContact.email = "svc_email_bt@corpdev.visa.com"; businessInformation.businessContact = businessContact; diff --git a/Samples/MerchantBoarding/merchant-boarding-smartfdc.js b/Samples/MerchantBoarding/merchant-boarding-smartfdc.js index b283c8f..c381410 100644 --- a/Samples/MerchantBoarding/merchant-boarding-smartfdc.js +++ b/Samples/MerchantBoarding/merchant-boarding-smartfdc.js @@ -5,7 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/MerchantBoardingConfiguration.js'); var configuration = require(filePath); const UUID = require('uuid'); - +const { faker } = require('@faker-js/faker'); const { v4: uuidv4 } = require('uuid'); const { @@ -70,23 +70,23 @@ function merchant_boarding_smartfdc(callback) { organizationInformation.configurable = true; const businessInformation = new Boardingv1registrationsOrganizationInformationBusinessInformation(); - businessInformation.name = "StuartWickedFastEatz"; + businessInformation.name = faker.word.adjective()+faker.word.noun(); const address = new Boardingv1registrationsOrganizationInformationBusinessInformationAddress(); address.country = "US"; - address.address1 = "123456 SandMarket"; - address.locality = "ORMOND BEACH"; + address.address1 = faker.location.streetAddress(); + address.locality = faker.location.city(); address.administrativeArea = "FL"; - address.postalCode = "32176"; + address.postalCode = faker.helpers.fake('{{helpers.fromRegExp("[9][0-6][0-1][0-6][0-9]")}}'); businessInformation.address = address; - businessInformation.websiteUrl = "https://www.StuartWickedEats.com"; - businessInformation.phoneNumber = "6574567813"; + businessInformation.websiteUrl = faker.internet.url({ protocol: 'https', appendSlash: false }); + businessInformation.phoneNumber = faker.string.numeric(10); const businessContact = new Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact(); - businessContact.firstName = "Stuart"; - businessContact.lastName = "Stuart"; - businessContact.phoneNumber = "6574567813"; + businessContact.firstName = faker.person.firstName(); + businessContact.firstName = faker.person.lastName(); + businessContact.phoneNumber = faker.string.numeric(10); businessContact.email = "svc_email_bt@corpdev.visa.com"; businessInformation.businessContact = businessContact; diff --git a/Samples/MerchantBoarding/merchant-boarding-tsys.js b/Samples/MerchantBoarding/merchant-boarding-tsys.js index 58a4357..2e0e679 100644 --- a/Samples/MerchantBoarding/merchant-boarding-tsys.js +++ b/Samples/MerchantBoarding/merchant-boarding-tsys.js @@ -5,7 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/MerchantBoardingConfiguration.js'); var configuration = require(filePath); const UUID = require('uuid'); - +const { faker } = require('@faker-js/faker'); const { v4: uuidv4 } = require('uuid'); const { @@ -70,23 +70,23 @@ function merchant_boarding_tsys(callback) { organizationInformation.configurable = true; const businessInformation = new Boardingv1registrationsOrganizationInformationBusinessInformation(); - businessInformation.name = "StuartWickedFastEatz"; + businessInformation.name = faker.word.adjective()+faker.word.noun(); const address = new Boardingv1registrationsOrganizationInformationBusinessInformationAddress(); address.country = "US"; - address.address1 = "123456 SandMarket"; - address.locality = "ORMOND BEACH"; + address.address1 = faker.location.streetAddress(); + address.locality = faker.location.city(); address.administrativeArea = "FL"; - address.postalCode = "32176"; + address.postalCode = faker.helpers.fake('{{helpers.fromRegExp("[9][0-6][0-1][0-6][0-9]")}}'); businessInformation.address = address; - businessInformation.websiteUrl = "https://www.StuartWickedEats.com"; - businessInformation.phoneNumber = "6574567813"; + businessInformation.websiteUrl = faker.internet.url({ protocol: 'https', appendSlash: false }); + businessInformation.phoneNumber = faker.string.numeric(10); const businessContact = new Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact(); - businessContact.firstName = "Stuart"; - businessContact.lastName = "Stuart"; - businessContact.phoneNumber = "6574567813"; + businessContact.firstName = faker.person.firstName(); + businessContact.firstName = faker.person.lastName(); + businessContact.phoneNumber = faker.string.numeric(10); businessContact.email = "svc_email_bt@corpdev.visa.com"; businessInformation.businessContact = businessContact; diff --git a/Samples/MerchantBoarding/merchant-boarding-vpc.js b/Samples/MerchantBoarding/merchant-boarding-vpc.js index 4fc2978..afe7470 100644 --- a/Samples/MerchantBoarding/merchant-boarding-vpc.js +++ b/Samples/MerchantBoarding/merchant-boarding-vpc.js @@ -70,23 +70,23 @@ function merchant_boarding_vpc(callback) { organizationInformation.configurable = true; const businessInformation = new Boardingv1registrationsOrganizationInformationBusinessInformation(); - businessInformation.name = "StuartWickedFastEatz"; + businessInformation.name = faker.word.adjective()+faker.word.noun(); const address = new Boardingv1registrationsOrganizationInformationBusinessInformationAddress(); address.country = "US"; - address.address1 = "123456 SandMarket"; - address.locality = "ORMOND BEACH"; + address.address1 = faker.location.streetAddress(); + address.locality = faker.location.city(); address.administrativeArea = "FL"; - address.postalCode = "32176"; + address.postalCode = faker.helpers.fake('{{helpers.fromRegExp("[9][0-6][0-1][0-6][0-9]")}}'); businessInformation.address = address; - businessInformation.websiteUrl = "https://www.StuartWickedEats.com"; - businessInformation.phoneNumber = "6574567813"; + businessInformation.websiteUrl = faker.internet.url({ protocol: 'https', appendSlash: false }); + businessInformation.phoneNumber = faker.string.numeric(10); const businessContact = new Boardingv1registrationsOrganizationInformationBusinessInformationBusinessContact(); - businessContact.firstName = "Stuart"; - businessContact.lastName = "Stuart"; - businessContact.phoneNumber = "6574567813"; + businessContact.firstName = faker.person.firstName(); + businessContact.firstName = faker.person.lastName(); + businessContact.phoneNumber = faker.string.numeric(10); businessContact.email = "svc_email_bt@corpdev.visa.com"; businessInformation.businessContact = businessContact; diff --git a/Samples/PayerAuthentication/authentication-with-new-account.js b/Samples/PayerAuthentication/authentication-with-new-account.js index d5f2b21..e415e06 100644 --- a/Samples/PayerAuthentication/authentication-with-new-account.js +++ b/Samples/PayerAuthentication/authentication-with-new-account.js @@ -4,6 +4,8 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); +const exp = require('constants'); function authentication_with_new_account(callback) { try { @@ -18,29 +20,33 @@ function authentication_with_new_account(callback) { var orderInformation = new cybersourceRestApi.Riskv1authenticationsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1authenticationsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '10.99'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Riskv1authenticationsOrderInformationBillTo(); - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.address2 = 'Address 2'; - orderInformationBillTo.administrativeArea = 'CA'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.address2 = faker.location.secondaryAddress(); + orderInformationBillTo.administrativeArea = faker.location.state(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.phoneNumber = '4158880000'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.phoneNumber = faker.phone.number(); + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var paymentInformation = new cybersourceRestApi.Riskv1authenticationsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1authenticationsetupsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; paymentInformationCard.type = '001'; paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2025'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.number = '4000990000000004'; paymentInformation.card = paymentInformationCard; diff --git a/Samples/PayerAuthentication/authentication-with-no-redirect.js b/Samples/PayerAuthentication/authentication-with-no-redirect.js index d04b794..b283cdb 100644 --- a/Samples/PayerAuthentication/authentication-with-no-redirect.js +++ b/Samples/PayerAuthentication/authentication-with-no-redirect.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authentication_with_no_redirect(callback) { try { @@ -12,7 +13,7 @@ function authentication_with_no_redirect(callback) { var requestObj = new cybersourceRestApi.CheckPayerAuthEnrollmentRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'cybs_test'; + clientReferenceInformation.code = faker.string.uuid(); var clientReferenceInformationPartner = new cybersourceRestApi.Riskv1decisionsClientReferenceInformationPartner(); clientReferenceInformationPartner.developerId = '7891234'; clientReferenceInformationPartner.solutionId = '89012345'; @@ -23,29 +24,33 @@ function authentication_with_no_redirect(callback) { var orderInformation = new cybersourceRestApi.Riskv1authenticationsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1authenticationsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '10.99'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Riskv1authenticationsOrderInformationBillTo(); - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.address2 = 'Address 2'; - orderInformationBillTo.administrativeArea = 'CA'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.address2 = faker.location.secondaryAddress(); + orderInformationBillTo.administrativeArea = faker.location.state(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.phoneNumber = '4158880000'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.phoneNumber = faker.phone.number(); + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var paymentInformation = new cybersourceRestApi.Riskv1authenticationsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1authenticationsetupsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; paymentInformationCard.type = '001'; paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2025'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.number = '4000990000000004'; paymentInformation.card = paymentInformationCard; diff --git a/Samples/PayerAuthentication/enroll-with-customerid-as-payment-information.js b/Samples/PayerAuthentication/enroll-with-customerid-as-payment-information.js index aaf12f8..da0dddc 100644 --- a/Samples/PayerAuthentication/enroll-with-customerid-as-payment-information.js +++ b/Samples/PayerAuthentication/enroll-with-customerid-as-payment-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function enroll_with_customerid_as_payment_information(callback) { try { @@ -12,26 +13,28 @@ function enroll_with_customerid_as_payment_information(callback) { var requestObj = new cybersourceRestApi.CheckPayerAuthEnrollmentRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'UNKNOWN'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var orderInformation = new cybersourceRestApi.Riskv1authenticationsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1authenticationsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '10.99'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Riskv1authenticationsOrderInformationBillTo(); - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.address2 = 'Address 2'; - orderInformationBillTo.administrativeArea = 'CA'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.address2 = faker.location.secondaryAddress(); + orderInformationBillTo.administrativeArea = faker.location.state(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.phoneNumber = '4158880000'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.phoneNumber = faker.phone.number(); + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/PayerAuthentication/enroll-with-pending-authentication.js b/Samples/PayerAuthentication/enroll-with-pending-authentication.js index aa88613..f3cc54e 100644 --- a/Samples/PayerAuthentication/enroll-with-pending-authentication.js +++ b/Samples/PayerAuthentication/enroll-with-pending-authentication.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function enroll_with_pending_authentication(callback) { try { @@ -12,35 +13,39 @@ function enroll_with_pending_authentication(callback) { var requestObj = new cybersourceRestApi.CheckPayerAuthEnrollmentRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'cybs_test'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var orderInformation = new cybersourceRestApi.Riskv1authenticationsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1authenticationsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '10.99'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Riskv1authenticationsOrderInformationBillTo(); - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.address2 = 'Address 2'; - orderInformationBillTo.administrativeArea = 'CA'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.address2 = faker.location.secondaryAddress(); + orderInformationBillTo.administrativeArea = faker.location.state(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.phoneNumber = '4158880000'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.phoneNumber = faker.phone.number(); + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var paymentInformation = new cybersourceRestApi.Riskv1authenticationsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1authenticationsetupsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; paymentInformationCard.type = '001'; paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2025'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.number = '4000000000000101'; paymentInformation.card = paymentInformationCard; diff --git a/Samples/PayerAuthentication/enroll-with-transient-token.js b/Samples/PayerAuthentication/enroll-with-transient-token.js index 8e4d300..fb3fb0c 100644 --- a/Samples/PayerAuthentication/enroll-with-transient-token.js +++ b/Samples/PayerAuthentication/enroll-with-transient-token.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function enroll_with_transient_token(callback) { try { @@ -12,26 +13,27 @@ function enroll_with_transient_token(callback) { var requestObj = new cybersourceRestApi.CheckPayerAuthEnrollmentRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'UNKNOWN'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var orderInformation = new cybersourceRestApi.Riskv1authenticationsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1authenticationsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '10.99'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; - var orderInformationBillTo = new cybersourceRestApi.Riskv1authenticationsOrderInformationBillTo(); - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.address2 = 'Address 2'; - orderInformationBillTo.administrativeArea = 'CA'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.address2 = faker.location.secondaryAddress(); + orderInformationBillTo.administrativeArea = faker.location.state(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.phoneNumber = '4158880000'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.phoneNumber = faker.phone.number(); + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/PayerAuthentication/enroll-with-travel-information.js b/Samples/PayerAuthentication/enroll-with-travel-information.js index 347cafa..a9118c0 100644 --- a/Samples/PayerAuthentication/enroll-with-travel-information.js +++ b/Samples/PayerAuthentication/enroll-with-travel-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function enroll_with_travel_information(callback) { try { @@ -12,35 +13,39 @@ function enroll_with_travel_information(callback) { var requestObj = new cybersourceRestApi.CheckPayerAuthEnrollmentRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'cybs_test'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var orderInformation = new cybersourceRestApi.Riskv1authenticationsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1authenticationsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '10.99'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Riskv1authenticationsOrderInformationBillTo(); - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.address2 = 'Address 2'; - orderInformationBillTo.administrativeArea = 'CA'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.address2 = faker.location.secondaryAddress(); + orderInformationBillTo.administrativeArea = faker.location.state(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.phoneNumber = '4158880000'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.phoneNumber = faker.string.numeric(10); + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var paymentInformation = new cybersourceRestApi.Riskv1authenticationsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1authenticationsetupsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; paymentInformationCard.type = '002'; paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2025'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.number = '5200340000000015'; paymentInformation.card = paymentInformationCard; @@ -60,13 +65,13 @@ function enroll_with_travel_information(callback) { var legs1 = new cybersourceRestApi.Riskv1decisionsTravelInformationLegs(); legs1.destination = 'DEF'; legs1.carrierCode = 'UA'; - legs1.departureDate = '2019-01-01'; + legs1.departureDate = expYear+'-01-01'; legs.push(legs1); var legs2 = new cybersourceRestApi.Riskv1decisionsTravelInformationLegs(); legs2.destination = 'RES'; legs2.carrierCode = 'AS'; - legs2.departureDate = '2019-02-21'; + legs2.departureDate = expYear+'-02-21'; legs.push(legs2); travelInformation.legs = legs; @@ -75,13 +80,13 @@ function enroll_with_travel_information(callback) { var passengers = new Array(); var passengers1 = new cybersourceRestApi.Riskv1decisionsTravelInformationPassengers(); - passengers1.firstName = 'Raj'; - passengers1.lastName = 'Charles'; + passengers1.firstName = faker.person.firstName(); + passengers1.lastName = faker.person.lastName(); passengers.push(passengers1); var passengers2 = new cybersourceRestApi.Riskv1decisionsTravelInformationPassengers(); - passengers2.firstName = 'Potter'; - passengers2.lastName = 'Suhember'; + passengers2.firstName = faker.person.firstName(); + passengers2.lastName = faker.person.lastName(); passengers.push(passengers2); travelInformation.passengers = passengers; diff --git a/Samples/PayerAuthentication/pending-authentication-with-unknown-path.js b/Samples/PayerAuthentication/pending-authentication-with-unknown-path.js index 2dcaea0..e8fcc0d 100644 --- a/Samples/PayerAuthentication/pending-authentication-with-unknown-path.js +++ b/Samples/PayerAuthentication/pending-authentication-with-unknown-path.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function pending_authentication_with_unknown_path(callback) { try { @@ -12,35 +13,39 @@ function pending_authentication_with_unknown_path(callback) { var requestObj = new cybersourceRestApi.CheckPayerAuthEnrollmentRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'UNKNOWN'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var orderInformation = new cybersourceRestApi.Riskv1authenticationsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1authenticationsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '10.99'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 10, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Riskv1authenticationsOrderInformationBillTo(); - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.address2 = 'Address 2'; - orderInformationBillTo.administrativeArea = 'CA'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.address2 = faker.location.secondaryAddress(); + orderInformationBillTo.administrativeArea = faker.location.state(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.phoneNumber = '4158880000'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.postalCode = '94105'; + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.phoneNumber = faker.string.numeric(10); + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var paymentInformation = new cybersourceRestApi.Riskv1authenticationsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1authenticationsetupsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; paymentInformationCard.type = '001'; paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2025'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.number = '4012001037490014'; paymentInformation.card = paymentInformationCard; diff --git a/Samples/PayerAuthentication/setup-completion-with-card-number.js b/Samples/PayerAuthentication/setup-completion-with-card-number.js index a4a9bb7..731eb91 100644 --- a/Samples/PayerAuthentication/setup-completion-with-card-number.js +++ b/Samples/PayerAuthentication/setup-completion-with-card-number.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function setup_completion_with_card_number(callback) { try { @@ -12,7 +13,7 @@ function setup_completion_with_card_number(callback) { var requestObj = new cybersourceRestApi.PayerAuthSetupRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'cybs_test'; + clientReferenceInformation.code = faker.string.uuid(); var clientReferenceInformationPartner = new cybersourceRestApi.Riskv1decisionsClientReferenceInformationPartner(); clientReferenceInformationPartner.developerId = '7891234'; clientReferenceInformationPartner.solutionId = '89012345'; @@ -22,9 +23,11 @@ function setup_completion_with_card_number(callback) { var paymentInformation = new cybersourceRestApi.Riskv1authenticationsetupsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1authenticationsetupsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; paymentInformationCard.type = '002'; paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2025'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.number = '5200000000001005'; paymentInformation.card = paymentInformationCard; diff --git a/Samples/PayerAuthentication/setup-completion-with-flex-transient-token.js b/Samples/PayerAuthentication/setup-completion-with-flex-transient-token.js index 376b4e2..99d1c68 100644 --- a/Samples/PayerAuthentication/setup-completion-with-flex-transient-token.js +++ b/Samples/PayerAuthentication/setup-completion-with-flex-transient-token.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function setup_completion_with_flex_transient_token(callback) { try { @@ -12,7 +13,7 @@ function setup_completion_with_flex_transient_token(callback) { var requestObj = new cybersourceRestApi.PayerAuthSetupRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'cybs_test'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var tokenInformation = new cybersourceRestApi.Riskv1authenticationsetupsTokenInformation(); diff --git a/Samples/PayerAuthentication/setup-completion-with-fluid-data-value-and-payment-solution.js b/Samples/PayerAuthentication/setup-completion-with-fluid-data-value-and-payment-solution.js index e315d74..ba8c2ba 100644 --- a/Samples/PayerAuthentication/setup-completion-with-fluid-data-value-and-payment-solution.js +++ b/Samples/PayerAuthentication/setup-completion-with-fluid-data-value-and-payment-solution.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function setup_completion_with_fluid_data_value_and_payment_solution(callback) { try { @@ -12,7 +13,7 @@ function setup_completion_with_fluid_data_value_and_payment_solution(callback) { var requestObj = new cybersourceRestApi.PayerAuthSetupRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'cybs_test'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Riskv1authenticationsetupsPaymentInformation(); diff --git a/Samples/PayerAuthentication/setup-completion-with-secure-storage-token.js b/Samples/PayerAuthentication/setup-completion-with-secure-storage-token.js index 3c839d7..1520248 100644 --- a/Samples/PayerAuthentication/setup-completion-with-secure-storage-token.js +++ b/Samples/PayerAuthentication/setup-completion-with-secure-storage-token.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function setup_completion_with_secure_storage_token(callback) { try { @@ -12,7 +13,7 @@ function setup_completion_with_secure_storage_token(callback) { var requestObj = new cybersourceRestApi.PayerAuthSetupRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'cybs_test'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Riskv1authenticationsetupsPaymentInformation(); diff --git a/Samples/PayerAuthentication/setup-completion-with-tms-token.js b/Samples/PayerAuthentication/setup-completion-with-tms-token.js index d21d1ec..6e44f1d 100644 --- a/Samples/PayerAuthentication/setup-completion-with-tms-token.js +++ b/Samples/PayerAuthentication/setup-completion-with-tms-token.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function setup_completion_with_tms_token(callback) { try { @@ -12,7 +13,7 @@ function setup_completion_with_tms_token(callback) { var requestObj = new cybersourceRestApi.PayerAuthSetupRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'cybs_test'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Riskv1authenticationsetupsPaymentInformation(); diff --git a/Samples/PayerAuthentication/setup-completion-with-tokenized-card.js b/Samples/PayerAuthentication/setup-completion-with-tokenized-card.js index 4a7e631..5c24cb3 100644 --- a/Samples/PayerAuthentication/setup-completion-with-tokenized-card.js +++ b/Samples/PayerAuthentication/setup-completion-with-tokenized-card.js @@ -4,6 +4,8 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); +const exp = require('constants'); function setup_completion_with_tokenized_card(callback) { try { @@ -12,15 +14,17 @@ function setup_completion_with_tokenized_card(callback) { var requestObj = new cybersourceRestApi.PayerAuthSetupRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'cybs_test'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Riskv1authenticationsetupsPaymentInformation(); var paymentInformationTokenizedCard = new cybersourceRestApi.Riskv1authenticationsetupsPaymentInformationTokenizedCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; paymentInformationTokenizedCard.transactionType = '1'; paymentInformationTokenizedCard.type = '001'; paymentInformationTokenizedCard.expirationMonth = '11'; - paymentInformationTokenizedCard.expirationYear = '2025'; + paymentInformationTokenizedCard.expirationYear = expYear; paymentInformationTokenizedCard.number = '4111111111111111'; paymentInformation.tokenizedCard = paymentInformationTokenizedCard; diff --git a/Samples/PayerAuthentication/validate-authentication-results.js b/Samples/PayerAuthentication/validate-authentication-results.js index 23df4c8..e713639 100644 --- a/Samples/PayerAuthentication/validate-authentication-results.js +++ b/Samples/PayerAuthentication/validate-authentication-results.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function validate_authentication_results(callback) { try { @@ -12,7 +13,7 @@ function validate_authentication_results(callback) { var requestObj = new cybersourceRestApi.ValidateRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1authenticationsetupsClientReferenceInformation(); - clientReferenceInformation.code = 'pavalidatecheck'; + clientReferenceInformation.code = faker.string.uuid(); var clientReferenceInformationPartner = new cybersourceRestApi.Riskv1decisionsClientReferenceInformationPartner(); clientReferenceInformationPartner.developerId = '7891234'; clientReferenceInformationPartner.solutionId = '89012345'; @@ -30,9 +31,11 @@ function validate_authentication_results(callback) { var paymentInformation = new cybersourceRestApi.Riskv1authenticationresultsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1authenticationresultsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; paymentInformationCard.type = '002'; paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2025'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.number = '5200000000000007'; paymentInformation.card = paymentInformationCard; diff --git a/Samples/Payments/Capture/capture-of-authorization-that-used-swiped-track-data.js b/Samples/Payments/Capture/capture-of-authorization-that-used-swiped-track-data.js index bfaa79d..1bd1d99 100644 --- a/Samples/Payments/Capture/capture-of-authorization-that-used-swiped-track-data.js +++ b/Samples/Payments/Capture/capture-of-authorization-that-used-swiped-track-data.js @@ -5,6 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); var processPayment = require('../Payments/authorization-using-swiped-track-data'); +const { faker, fa } = require('@faker-js/faker'); function capture_of_authorization_that_used_swiped_track_data(callback) { try { @@ -13,7 +14,7 @@ function capture_of_authorization_that_used_swiped_track_data(callback) { var requestObj = new cybersourceRestApi.CapturePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '1234567890'; + clientReferenceInformation.code = faker.string.uuid(); var clientReferenceInformationPartner = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformationPartner(); clientReferenceInformationPartner.thirdPartyCertificationNumber = '123456789012'; clientReferenceInformation.partner = clientReferenceInformationPartner; diff --git a/Samples/Payments/Capture/capture-payment-service-fee.js b/Samples/Payments/Capture/capture-payment-service-fee.js index 8e1dd93..4764427 100644 --- a/Samples/Payments/Capture/capture-payment-service-fee.js +++ b/Samples/Payments/Capture/capture-payment-service-fee.js @@ -5,6 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); var processPayment = require('../Payments/service-fees-with-credit-card-transaction'); +const { faker, fa } = require('@faker-js/faker'); function capture_payment_service_fee(callback) { try { diff --git a/Samples/Payments/Capture/capture-payment.js b/Samples/Payments/Capture/capture-payment.js index 5a6d54a..696395b 100644 --- a/Samples/Payments/Capture/capture-payment.js +++ b/Samples/Payments/Capture/capture-payment.js @@ -5,6 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); var simple_authorization_internet = require('../Payments/simple-authorizationinternet'); +const { faker, fa } = require('@faker-js/faker'); function capture_payment(callback) { try { diff --git a/Samples/Payments/Capture/restaurant-capture-with-gratuity.js b/Samples/Payments/Capture/restaurant-capture-with-gratuity.js index cca4420..25f76fc 100644 --- a/Samples/Payments/Capture/restaurant-capture-with-gratuity.js +++ b/Samples/Payments/Capture/restaurant-capture-with-gratuity.js @@ -5,6 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); var processPayment = require('../Payments/restaurant-authorization'); +const { faker, fa } = require('@faker-js/faker'); function restaurant_capture_with_gratuity(callback) { try { @@ -13,7 +14,7 @@ function restaurant_capture_with_gratuity(callback) { var requestObj = new cybersourceRestApi.CapturePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '1234567890'; + clientReferenceInformation.code = faker.string.uuid(); var clientReferenceInformationPartner = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformationPartner(); clientReferenceInformationPartner.thirdPartyCertificationNumber = '123456789012'; clientReferenceInformation.partner = clientReferenceInformationPartner; diff --git a/Samples/Payments/Credit/credit-using-bluefin-pci-p2pe-for-card-present-enabled-acquirer.js b/Samples/Payments/Credit/credit-using-bluefin-pci-p2pe-for-card-present-enabled-acquirer.js index ff43539..fc0d55c 100644 --- a/Samples/Payments/Credit/credit-using-bluefin-pci-p2pe-for-card-present-enabled-acquirer.js +++ b/Samples/Payments/Credit/credit-using-bluefin-pci-p2pe-for-card-present-enabled-acquirer.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function credit_using_bluefin_pci_p2pe_for_card_present_enabled_acquirer(callback) { try { @@ -12,7 +13,7 @@ function credit_using_bluefin_pci_p2pe_for_card_present_enabled_acquirer(callbac var requestObj = new cybersourceRestApi.CreateCreditRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'demomerchant'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2creditsProcessingInformation(); @@ -21,8 +22,10 @@ function credit_using_bluefin_pci_p2pe_for_card_present_enabled_acquirer(callbac var paymentInformation = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2050'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; var paymentInformationFluidData = new cybersourceRestApi.Ptsv2paymentsPaymentInformationFluidData(); @@ -39,15 +42,17 @@ function credit_using_bluefin_pci_p2pe_for_card_present_enabled_acquirer(callbac orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsidcapturesOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Deo'; - orderInformationBillTo.address1 = '201 S. Division St.'; - orderInformationBillTo.locality = 'Ann Arbor'; - orderInformationBillTo.administrativeArea = 'MI'; - orderInformationBillTo.postalCode = '48104-2201'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '999999999'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Credit/credit-using-bluefin-pci-p2pe-with-visa-platform-connect.js b/Samples/Payments/Credit/credit-using-bluefin-pci-p2pe-with-visa-platform-connect.js index 657c1d8..2d3f3c9 100644 --- a/Samples/Payments/Credit/credit-using-bluefin-pci-p2pe-with-visa-platform-connect.js +++ b/Samples/Payments/Credit/credit-using-bluefin-pci-p2pe-with-visa-platform-connect.js @@ -4,6 +4,8 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); +const exp = require('constants'); function credit_using_bluefin_pci_p2pe_with_visa_platform_connect(callback) { try { @@ -12,7 +14,7 @@ function credit_using_bluefin_pci_p2pe_with_visa_platform_connect(callback) { var requestObj = new cybersourceRestApi.CreateCreditRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'demomerchant'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2creditsProcessingInformation(); @@ -21,8 +23,10 @@ function credit_using_bluefin_pci_p2pe_with_visa_platform_connect(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2050'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; var paymentInformationFluidData = new cybersourceRestApi.Ptsv2paymentsPaymentInformationFluidData(); @@ -39,15 +43,17 @@ function credit_using_bluefin_pci_p2pe_with_visa_platform_connect(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsidcapturesOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Deo'; - orderInformationBillTo.address1 = '201 S. Division St.'; - orderInformationBillTo.locality = 'Ann Arbor'; - orderInformationBillTo.administrativeArea = 'MI'; - orderInformationBillTo.postalCode = '48104-2201'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '999999999'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Credit/credit-with-customer-payment-instrument-and-shipping-address-token-id.js b/Samples/Payments/Credit/credit-with-customer-payment-instrument-and-shipping-address-token-id.js index ea5c417..47e018c 100644 --- a/Samples/Payments/Credit/credit-with-customer-payment-instrument-and-shipping-address-token-id.js +++ b/Samples/Payments/Credit/credit-with-customer-payment-instrument-and-shipping-address-token-id.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function credit_with_customer_payment_instrument_and_shipping_address_token_id(callback) { try { @@ -12,7 +13,7 @@ function credit_with_customer_payment_instrument_and_shipping_address_token_id(c var requestObj = new cybersourceRestApi.CreateCreditRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '12345678'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformation(); @@ -33,7 +34,7 @@ function credit_with_customer_payment_instrument_and_shipping_address_token_id(c var orderInformation = new cybersourceRestApi.Ptsv2paymentsidrefundsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsidcapturesOrderInformationAmountDetails(); orderInformationAmountDetails.totalAmount = '200'; - orderInformationAmountDetails.currency = 'usd'; + orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Credit/credit-with-customer-token-id.js b/Samples/Payments/Credit/credit-with-customer-token-id.js index 3192c03..68597a4 100644 --- a/Samples/Payments/Credit/credit-with-customer-token-id.js +++ b/Samples/Payments/Credit/credit-with-customer-token-id.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function credit_with_customer_token_id(callback) { try { @@ -12,7 +13,7 @@ function credit_with_customer_token_id(callback) { var requestObj = new cybersourceRestApi.CreateCreditRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '12345678'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformation(); diff --git a/Samples/Payments/Credit/credit-with-instrument-identifier-token-id.js b/Samples/Payments/Credit/credit-with-instrument-identifier-token-id.js index 9374284..787a6e1 100644 --- a/Samples/Payments/Credit/credit-with-instrument-identifier-token-id.js +++ b/Samples/Payments/Credit/credit-with-instrument-identifier-token-id.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function credit_with_instrument_identifier_token_id(callback) { try { @@ -12,7 +13,7 @@ function credit_with_instrument_identifier_token_id(callback) { var requestObj = new cybersourceRestApi.CreateCreditRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '12345678'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformation(); @@ -35,15 +36,17 @@ function credit_with_instrument_identifier_token_id(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsidcapturesOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Deo'; - orderInformationBillTo.address1 = '900 Metro Center Blvd'; - orderInformationBillTo.locality = 'Foster City'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '48104-2201'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '9321499232'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Credit/credit.js b/Samples/Payments/Credit/credit.js index 4f048ec..44ee3cc 100644 --- a/Samples/Payments/Credit/credit.js +++ b/Samples/Payments/Credit/credit.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function credit(callback) { try { @@ -12,14 +13,16 @@ function credit(callback) { var requestObj = new cybersourceRestApi.CreateCreditRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '12345678'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '03'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.type = '001'; paymentInformation.card = paymentInformationCard; @@ -32,15 +35,17 @@ function credit(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsidcapturesOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Deo'; - orderInformationBillTo.address1 = '900 Metro Center Blvd'; - orderInformationBillTo.locality = 'Foster City'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '48104-2201'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '9321499232'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Credit/electronic-check-standalone-credits.js b/Samples/Payments/Credit/electronic-check-standalone-credits.js index 42b34dc..6a0cad9 100644 --- a/Samples/Payments/Credit/electronic-check-standalone-credits.js +++ b/Samples/Payments/Credit/electronic-check-standalone-credits.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function electronic_check_standalone_credits(callback) { try { @@ -12,18 +13,18 @@ function electronic_check_standalone_credits(callback) { var requestObj = new cybersourceRestApi.CreateCreditRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC46125-1'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformation(); var paymentInformationBank = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformationBank(); var paymentInformationBankAccount = new cybersourceRestApi.Ptsv2paymentsPaymentInformationBankAccount(); paymentInformationBankAccount.type = 'C'; - paymentInformationBankAccount.number = '4100'; + paymentInformationBankAccount.number = faker.finance.accountNumber(9); paymentInformationBankAccount.checkNumber = '123456'; paymentInformationBank.account = paymentInformationBankAccount; - paymentInformationBank.routingNumber = '071923284'; + paymentInformationBank.routingNumber = faker.finance.routingNumber(); paymentInformation.bank = paymentInformationBank; var paymentInformationPaymentType = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformationPaymentType(); @@ -39,15 +40,17 @@ function electronic_check_standalone_credits(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsidcapturesOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Credit/service-fees-credit.js b/Samples/Payments/Credit/service-fees-credit.js index 523573d..87ac89a 100644 --- a/Samples/Payments/Credit/service-fees-credit.js +++ b/Samples/Payments/Credit/service-fees-credit.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function service_fees_credit(callback) { try { @@ -12,14 +13,16 @@ function service_fees_credit(callback) { var requestObj = new cybersourceRestApi.CreateCreditRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '12345678'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsidrefundsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '03'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -32,15 +35,17 @@ function service_fees_credit(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsidcapturesOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/american-express-direct-emv-with-contact-read.js b/Samples/Payments/Payments/american-express-direct-emv-with-contact-read.js index e3d1f4c..b4dbed7 100644 --- a/Samples/Payments/Payments/american-express-direct-emv-with-contact-read.js +++ b/Samples/Payments/Payments/american-express-direct-emv-with-contact-read.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function american_express_direct_emv_with_contact_read(callback) { try { @@ -12,7 +13,7 @@ function american_express_direct_emv_with_contact_read(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '123456'; + clientReferenceInformation.code = faker.string.uuid(); var clientReferenceInformationPartner = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformationPartner(); clientReferenceInformationPartner.originalTransactionId = '510be4aef90711e6acbc7d88388d803d'; clientReferenceInformation.partner = clientReferenceInformationPartner; diff --git a/Samples/Payments/Payments/authorization-capture-for-timeout-void-flow.js b/Samples/Payments/Payments/authorization-capture-for-timeout-void-flow.js index dc0d97c..b7a59ff 100644 --- a/Samples/Payments/Payments/authorization-capture-for-timeout-void-flow.js +++ b/Samples/Payments/Payments/authorization-capture-for-timeout-void-flow.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_capture_for_timeout_void_flow(callback) { var timeoutVoidTransactionId = Math.floor(Math.random() * (1000000000 - 1000 + 1) + 1000); @@ -13,7 +14,7 @@ function authorization_capture_for_timeout_void_flow(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); clientReferenceInformation.transactionId = timeoutVoidTransactionId; requestObj.clientReferenceInformation = clientReferenceInformation; @@ -23,9 +24,11 @@ function authorization_capture_for_timeout_void_flow(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -37,15 +40,17 @@ function authorization_capture_for_timeout_void_flow(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-for-incremental-authorization-flow.js b/Samples/Payments/Payments/authorization-for-incremental-authorization-flow.js index cbc3472..395d93f 100644 --- a/Samples/Payments/Payments/authorization-for-incremental-authorization-flow.js +++ b/Samples/Payments/Payments/authorization-for-incremental-authorization-flow.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/AlternativeConfiguration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_for_incremental_authorization_flow(callback) { try { @@ -18,9 +19,11 @@ function authorization_for_incremental_authorization_flow(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.type = '001'; paymentInformation.card = paymentInformationCard; @@ -37,28 +40,30 @@ function authorization_for_incremental_authorization_flow(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.address1 = '201 S. Division St.'; - orderInformationBillTo.address2 = 'Suite 500'; - orderInformationBillTo.locality = 'Ann Arbor'; - orderInformationBillTo.administrativeArea = 'MI'; - orderInformationBillTo.postalCode = '12345'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.address2 = faker.location.secondaryAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'null@cybersource.com'; - orderInformationBillTo.phoneNumber = '514-670-8700'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; var orderInformationShipTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationShipTo(); - orderInformationShipTo.firstName = 'Olivia'; - orderInformationShipTo.lastName = 'White'; - orderInformationShipTo.address1 = '1295 Charleston Rd'; - orderInformationShipTo.address2 = 'Cube 2386'; - orderInformationShipTo.locality = 'Mountain View'; - orderInformationShipTo.administrativeArea = 'CA'; - orderInformationShipTo.postalCode = '94041'; + orderInformationShipTo.firstName = faker.person.firstName(); + orderInformationShipTo.lastName = faker.person.lastName(); + orderInformationShipTo.address1 = faker.location.streetAddress(); + orderInformationShipTo.address2 = faker.location.secondaryAddress(); + orderInformationShipTo.locality = faker.location.city(); + orderInformationShipTo.administrativeArea = faker.location.state(); + orderInformationShipTo.postalCode = faker.location.zipCode(); orderInformationShipTo.country = 'AE'; - orderInformationShipTo.phoneNumber = '650-965-6000'; + orderInformationShipTo.phoneNumber = faker.string.numeric(10); orderInformation.shipTo = orderInformationShipTo; requestObj.orderInformation = orderInformation; @@ -108,7 +113,7 @@ function authorization_for_incremental_authorization_flow(callback) { travelInformationLodging.roomBedType = 'king'; travelInformationLodging.roomTaxType = 'tourist'; travelInformationLodging.roomRateType = 'sr citizen'; - travelInformationLodging.guestName = 'Tulasi'; + travelInformationLodging.guestName = faker.person.firstName()+' '+faker.person.lastName(); travelInformationLodging.customerServicePhoneNumber = '+13304026334'; travelInformationLodging.corporateClientCode = 'HDGGASJDGSUY'; travelInformationLodging.additionalDiscountAmount = '99.123456781'; diff --git a/Samples/Payments/Payments/authorization-for-timeout-reversal-flow.js b/Samples/Payments/Payments/authorization-for-timeout-reversal-flow.js index 4c07f40..0d8f649 100644 --- a/Samples/Payments/Payments/authorization-for-timeout-reversal-flow.js +++ b/Samples/Payments/Payments/authorization-for-timeout-reversal-flow.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_for_timeout_reversal_flow(callback) { var timeoutReversalTransactionId = Math.floor(Math.random() * (1000000000 - 1000 + 1) + 1000); @@ -13,15 +14,17 @@ function authorization_for_timeout_reversal_flow(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); clientReferenceInformation.transactionId = timeoutReversalTransactionId; requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -33,15 +36,18 @@ function authorization_for_timeout_reversal_flow(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.address2 = faker.location.secondaryAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-skip-decisionmanager-for-single-transaction.js b/Samples/Payments/Payments/authorization-skip-decisionmanager-for-single-transaction.js index cd453de..3e99170 100644 --- a/Samples/Payments/Payments/authorization-skip-decisionmanager-for-single-transaction.js +++ b/Samples/Payments/Payments/authorization-skip-decisionmanager-for-single-transaction.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function authorization_skip_decisionmanager_for_single_transaction(callback) { try { @@ -12,7 +13,7 @@ function authorization_skip_decisionmanager_for_single_transaction(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_16'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -26,9 +27,11 @@ function authorization_skip_decisionmanager_for_single_transaction(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; - paymentInformationCard.expirationMonth = '11'; - paymentInformationCard.expirationYear = '2025'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); + paymentInformationCard.expirationMonth = '12'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -40,15 +43,18 @@ function authorization_skip_decisionmanager_for_single_transaction(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.address2 = faker.location.secondaryAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-capturesale.js b/Samples/Payments/Payments/authorization-with-capturesale.js index 424d95e..7e761ed 100644 --- a/Samples/Payments/Payments/authorization-with-capturesale.js +++ b/Samples/Payments/Payments/authorization-with-capturesale.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_capturesale(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_capturesale(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -21,9 +22,11 @@ function authorization_with_capturesale(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -35,15 +38,17 @@ function authorization_with_capturesale(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-customer-token-creation.js b/Samples/Payments/Payments/authorization-with-customer-token-creation.js index 78bcbf7..ff951be 100644 --- a/Samples/Payments/Payments/authorization-with-customer-token-creation.js +++ b/Samples/Payments/Payments/authorization-with-customer-token-creation.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_customer_token_creation(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_customer_token_creation(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -33,9 +34,11 @@ function authorization_with_customer_token_creation(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.securityCode = '123'; paymentInformation.card = paymentInformationCard; @@ -48,24 +51,26 @@ function authorization_with_customer_token_creation(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; var orderInformationShipTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationShipTo(); - orderInformationShipTo.firstName = 'John'; - orderInformationShipTo.lastName = 'Doe'; - orderInformationShipTo.address1 = '1 Market St'; - orderInformationShipTo.locality = 'san francisco'; - orderInformationShipTo.administrativeArea = 'CA'; - orderInformationShipTo.postalCode = '94105'; + orderInformationShipTo.firstName = fName; + orderInformationShipTo.lastName = lName; + orderInformationShipTo.address1 = faker.location.streetAddress(); + orderInformationShipTo.locality = faker.location.city(); + orderInformationShipTo.administrativeArea = faker.location.state(); + orderInformationShipTo.postalCode = faker.location.zipCode(); orderInformationShipTo.country = 'US'; orderInformation.shipTo = orderInformationShipTo; diff --git a/Samples/Payments/Payments/authorization-with-customer-token-default-payment-instrument-and-shipping-address-creation.js b/Samples/Payments/Payments/authorization-with-customer-token-default-payment-instrument-and-shipping-address-creation.js index fc50306..d30df02 100644 --- a/Samples/Payments/Payments/authorization-with-customer-token-default-payment-instrument-and-shipping-address-creation.js +++ b/Samples/Payments/Payments/authorization-with-customer-token-default-payment-instrument-and-shipping-address-creation.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_customer_token_default_payment_instrument_and_shipping_address_creation(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_customer_token_default_payment_instrument_and_shippi var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -32,9 +33,11 @@ function authorization_with_customer_token_default_payment_instrument_and_shippi var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.securityCode = '123'; paymentInformation.card = paymentInformationCard; @@ -51,24 +54,26 @@ function authorization_with_customer_token_default_payment_instrument_and_shippi orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; var orderInformationShipTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationShipTo(); - orderInformationShipTo.firstName = 'John'; - orderInformationShipTo.lastName = 'Doe'; - orderInformationShipTo.address1 = '1 Market St'; - orderInformationShipTo.locality = 'san francisco'; - orderInformationShipTo.administrativeArea = 'CA'; - orderInformationShipTo.postalCode = '94105'; + orderInformationShipTo.firstName = fName; + orderInformationShipTo.lastName = lName; + orderInformationShipTo.address1 = faker.location.streetAddress(); + orderInformationShipTo.locality = faker.location.city(); + orderInformationShipTo.administrativeArea = faker.location.state(); + orderInformationShipTo.postalCode = faker.location.zipCode(); orderInformationShipTo.country = 'US'; orderInformation.shipTo = orderInformationShipTo; diff --git a/Samples/Payments/Payments/authorization-with-customer-token-id.js b/Samples/Payments/Payments/authorization-with-customer-token-id.js index fbdd7cf..b5b3955 100644 --- a/Samples/Payments/Payments/authorization-with-customer-token-id.js +++ b/Samples/Payments/Payments/authorization-with-customer-token-id.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_customer_token_id(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_customer_token_id(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); diff --git a/Samples/Payments/Payments/authorization-with-decision-manager-buyer-information.js b/Samples/Payments/Payments/authorization-with-decision-manager-buyer-information.js index 5162971..3725d2c 100644 --- a/Samples/Payments/Payments/authorization-with-decision-manager-buyer-information.js +++ b/Samples/Payments/Payments/authorization-with-decision-manager-buyer-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_decision_manager_buyer_information(callback) { try { @@ -12,14 +13,16 @@ function authorization_with_decision_manager_buyer_information(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '54323007'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4444444444444448'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -31,15 +34,17 @@ function authorization_with_decision_manager_buyer_information(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.administrativeArea = 'NH'; - orderInformationBillTo.postalCode = '03055'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.phoneNumber = '7606160717'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-decision-manager-custom-setup.js b/Samples/Payments/Payments/authorization-with-decision-manager-custom-setup.js index cd57e72..b0022a8 100644 --- a/Samples/Payments/Payments/authorization-with-decision-manager-custom-setup.js +++ b/Samples/Payments/Payments/authorization-with-decision-manager-custom-setup.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_decision_manager_custom_setup(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_decision_manager_custom_setup(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_16'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -26,9 +27,11 @@ function authorization_with_decision_manager_custom_setup(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; - paymentInformationCard.expirationMonth = '11'; - paymentInformationCard.expirationYear = '2025'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); + paymentInformationCard.expirationMonth = '12'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -40,15 +43,17 @@ function authorization_with_decision_manager_custom_setup(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-decision-manager-device-information.js b/Samples/Payments/Payments/authorization-with-decision-manager-device-information.js index d0f4050..efde071 100644 --- a/Samples/Payments/Payments/authorization-with-decision-manager-device-information.js +++ b/Samples/Payments/Payments/authorization-with-decision-manager-device-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_decision_manager_device_information(callback) { try { @@ -17,9 +18,11 @@ function authorization_with_decision_manager_device_information(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4444444444444448'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -31,22 +34,24 @@ function authorization_with_decision_manager_device_information(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.administrativeArea = 'NH'; - orderInformationBillTo.postalCode = '03055'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.phoneNumber = '7606160717'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var deviceInformation = new cybersourceRestApi.Ptsv2paymentsDeviceInformation(); deviceInformation.hostName = 'host.com'; - deviceInformation.ipAddress = '64.124.61.215'; + deviceInformation.ipAddress = faker.internet.ipv4(); deviceInformation.userAgent = 'Chrome'; deviceInformation.httpBrowserEmail = 'xyz@gmail.com'; requestObj.deviceInformation = deviceInformation; diff --git a/Samples/Payments/Payments/authorization-with-decision-manager-merchant-defined-information.js b/Samples/Payments/Payments/authorization-with-decision-manager-merchant-defined-information.js index 356d0d7..b1dd167 100644 --- a/Samples/Payments/Payments/authorization-with-decision-manager-merchant-defined-information.js +++ b/Samples/Payments/Payments/authorization-with-decision-manager-merchant-defined-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_decision_manager_merchant_defined_information(callback) { try { @@ -12,14 +13,16 @@ function authorization_with_decision_manager_merchant_defined_information(callba var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '54323007'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4444444444444448'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -31,15 +34,17 @@ function authorization_with_decision_manager_merchant_defined_information(callba orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.administrativeArea = 'NH'; - orderInformationBillTo.postalCode = '03055'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.phoneNumber = '7606160717'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; @@ -48,12 +53,12 @@ function authorization_with_decision_manager_merchant_defined_information(callba var merchantDefinedInformation = new Array(); var merchantDefinedInformation1 = new cybersourceRestApi.Ptsv2paymentsMerchantDefinedInformation(); merchantDefinedInformation1.key = '1'; - merchantDefinedInformation1.value = 'Test'; + merchantDefinedInformation1.value = faker.word.noun(); merchantDefinedInformation.push(merchantDefinedInformation1); var merchantDefinedInformation2 = new cybersourceRestApi.Ptsv2paymentsMerchantDefinedInformation(); merchantDefinedInformation2.key = '2'; - merchantDefinedInformation2.value = 'Test2'; + merchantDefinedInformation2.value = faker.word.verb(); merchantDefinedInformation.push(merchantDefinedInformation2); requestObj.merchantDefinedInformation = merchantDefinedInformation; diff --git a/Samples/Payments/Payments/authorization-with-decision-manager-shipping-information.js b/Samples/Payments/Payments/authorization-with-decision-manager-shipping-information.js index e6c8521..7de656f 100644 --- a/Samples/Payments/Payments/authorization-with-decision-manager-shipping-information.js +++ b/Samples/Payments/Payments/authorization-with-decision-manager-shipping-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_decision_manager_shipping_information(callback) { try { @@ -12,14 +13,16 @@ function authorization_with_decision_manager_shipping_information(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '54323007'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4444444444444448'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -31,26 +34,28 @@ function authorization_with_decision_manager_shipping_information(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.administrativeArea = 'NH'; - orderInformationBillTo.postalCode = '03055'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.phoneNumber = '7606160717'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; var orderInformationShipTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationShipTo(); - orderInformationShipTo.firstName = 'James'; - orderInformationShipTo.lastName = 'Smith'; - orderInformationShipTo.address1 = '96, powers street'; - orderInformationShipTo.locality = 'Clearwater milford'; - orderInformationShipTo.administrativeArea = 'KA'; - orderInformationShipTo.postalCode = '560056'; + orderInformationShipTo.firstName = fName; + orderInformationShipTo.lastName = lName; + orderInformationShipTo.address1 = faker.location.streetAddress(); + orderInformationShipTo.locality = faker.location.city(); + orderInformationShipTo.administrativeArea = faker.location.state(); + orderInformationShipTo.postalCode = faker.location.zipCode(); orderInformationShipTo.country = 'IN'; - orderInformationShipTo.phoneNumber = '7606160717'; + orderInformationShipTo.phoneNumber = faker.string.numeric(10); orderInformation.shipTo = orderInformationShipTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-decision-manager-travel-information.js b/Samples/Payments/Payments/authorization-with-decision-manager-travel-information.js index 9915325..78e1b27 100644 --- a/Samples/Payments/Payments/authorization-with-decision-manager-travel-information.js +++ b/Samples/Payments/Payments/authorization-with-decision-manager-travel-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_decision_manager_travel_information(callback) { try { @@ -12,14 +13,16 @@ function authorization_with_decision_manager_travel_information(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '54323007'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4444444444444448'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -31,15 +34,17 @@ function authorization_with_decision_manager_travel_information(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.administrativeArea = 'NH'; - orderInformationBillTo.postalCode = '03055'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.phoneNumber = '7606160717'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-decision-manager.js b/Samples/Payments/Payments/authorization-with-decision-manager.js index b556a2e..6f57c2c 100644 --- a/Samples/Payments/Payments/authorization-with-decision-manager.js +++ b/Samples/Payments/Payments/authorization-with-decision-manager.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_decision_manager(callback) { try { @@ -12,14 +13,16 @@ function authorization_with_decision_manager(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TSYS_Eh_FE_01'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; - paymentInformationCard.expirationMonth = '11'; - paymentInformationCard.expirationYear = '2025'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); + paymentInformationCard.expirationMonth = '12'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -31,15 +34,17 @@ function authorization_with_decision_manager(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'JSON'; - orderInformationBillTo.lastName = 'RTS'; - orderInformationBillTo.address1 = '201 S. Division St._1'; - orderInformationBillTo.locality = 'Foster City'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94404'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'beforeauth@cybersource.com'; - orderInformationBillTo.phoneNumber = '6504327113'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-dmaccept-pa-enroll.js b/Samples/Payments/Payments/authorization-with-dmaccept-pa-enroll.js index 1463e0f..a7f258b 100644 --- a/Samples/Payments/Payments/authorization-with-dmaccept-pa-enroll.js +++ b/Samples/Payments/Payments/authorization-with-dmaccept-pa-enroll.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_dmaccept_pa_enroll(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_dmaccept_pa_enroll(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'cbys_test'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -26,9 +27,11 @@ function authorization_with_dmaccept_pa_enroll(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '340000000001007'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.securityCode = '1234'; paymentInformation.card = paymentInformationCard; @@ -41,15 +44,17 @@ function authorization_with_dmaccept_pa_enroll(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'accept@cybersource.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-dmreject-pa-enroll.js b/Samples/Payments/Payments/authorization-with-dmreject-pa-enroll.js index 15a7907..1cfbd2d 100644 --- a/Samples/Payments/Payments/authorization-with-dmreject-pa-enroll.js +++ b/Samples/Payments/Payments/authorization-with-dmreject-pa-enroll.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_dmreject_pa_enroll(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_dmreject_pa_enroll(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -26,9 +27,11 @@ function authorization_with_dmreject_pa_enroll(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '372425119311008'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.securityCode = '1234'; paymentInformation.card = paymentInformationCard; @@ -41,15 +44,17 @@ function authorization_with_dmreject_pa_enroll(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; orderInformationBillTo.email = 'reject@domain.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-dmreview-pa-enroll.js b/Samples/Payments/Payments/authorization-with-dmreview-pa-enroll.js index 0879314..cbab231 100644 --- a/Samples/Payments/Payments/authorization-with-dmreview-pa-enroll.js +++ b/Samples/Payments/Payments/authorization-with-dmreview-pa-enroll.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_dmreview_pa_enroll(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_dmreview_pa_enroll(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -26,9 +27,11 @@ function authorization_with_dmreview_pa_enroll(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '372425119311008'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.securityCode = '1234'; paymentInformation.card = paymentInformationCard; @@ -41,15 +44,17 @@ function authorization_with_dmreview_pa_enroll(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; orderInformationBillTo.email = 'review@domain.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-instrument-identifier-token-creation.js b/Samples/Payments/Payments/authorization-with-instrument-identifier-token-creation.js index 2beedc5..1cffcda 100644 --- a/Samples/Payments/Payments/authorization-with-instrument-identifier-token-creation.js +++ b/Samples/Payments/Payments/authorization-with-instrument-identifier-token-creation.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_instrument_identifier_token_creation(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_instrument_identifier_token_creation(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -32,9 +33,11 @@ function authorization_with_instrument_identifier_token_creation(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.securityCode = '123'; paymentInformation.card = paymentInformationCard; @@ -47,25 +50,28 @@ function authorization_with_instrument_identifier_token_creation(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; var orderInformationShipTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationShipTo(); - orderInformationShipTo.firstName = 'John'; - orderInformationShipTo.lastName = 'Doe'; - orderInformationShipTo.address1 = '1 Market St'; - orderInformationShipTo.locality = 'san francisco'; - orderInformationShipTo.administrativeArea = 'CA'; - orderInformationShipTo.postalCode = '94105'; + orderInformationShipTo.firstName = fName; + orderInformationShipTo.lastName = lName; + orderInformationShipTo.address1 = faker.location.streetAddress(); + orderInformationShipTo.locality = faker.location.city(); + orderInformationShipTo.administrativeArea = faker.location.state(); + orderInformationShipTo.postalCode = faker.location.zipCode(); orderInformationShipTo.country = 'US'; + orderInformationShipTo.phoneNumber = faker.string.numeric(10); orderInformation.shipTo = orderInformationShipTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-instrument-identifier-token-id.js b/Samples/Payments/Payments/authorization-with-instrument-identifier-token-id.js index 18abf50..e0f5e09 100644 --- a/Samples/Payments/Payments/authorization-with-instrument-identifier-token-id.js +++ b/Samples/Payments/Payments/authorization-with-instrument-identifier-token-id.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_instrument_identifier_token_id(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_instrument_identifier_token_id(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -22,8 +23,10 @@ function authorization_with_instrument_identifier_token_id(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; paymentInformationCard.expirationMonth = '03'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.type = '001'; paymentInformation.card = paymentInformationCard; @@ -40,15 +43,17 @@ function authorization_with_instrument_identifier_token_id(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Deo'; - orderInformationBillTo.address1 = '900 Metro Center Blvd'; - orderInformationBillTo.locality = 'Foster City'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '48104-2201'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '9321499232'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-legacy-token.js b/Samples/Payments/Payments/authorization-with-legacy-token.js index 58fb766..3de5460 100644 --- a/Samples/Payments/Payments/authorization-with-legacy-token.js +++ b/Samples/Payments/Payments/authorization-with-legacy-token.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_legacy_token(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_legacy_token(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); @@ -29,15 +30,17 @@ function authorization_with_legacy_token(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-pa-enroll-authentication-needed.js b/Samples/Payments/Payments/authorization-with-pa-enroll-authentication-needed.js index 9968b86..d935939 100644 --- a/Samples/Payments/Payments/authorization-with-pa-enroll-authentication-needed.js +++ b/Samples/Payments/Payments/authorization-with-pa-enroll-authentication-needed.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_pa_enroll_authentication_needed(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_pa_enroll_authentication_needed(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -26,9 +27,12 @@ function authorization_with_pa_enroll_authentication_needed(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; + // Card below is specific to pa_enroll_authentication_needed paymentInformationCard.number = '4000000000001091'; paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2023'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -40,16 +44,17 @@ function authorization_with_pa_enroll_authentication_needed(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.address1 = '201 S. Division St._1'; - orderInformationBillTo.address2 = 'Suite 500'; - orderInformationBillTo.locality = 'Foster City'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94404'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'accept@cybersource.com'; - orderInformationBillTo.phoneNumber = '6504327113'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-payer-auth-validation.js b/Samples/Payments/Payments/authorization-with-payer-auth-validation.js index dd242c7..3611f7b 100644 --- a/Samples/Payments/Payments/authorization-with-payer-auth-validation.js +++ b/Samples/Payments/Payments/authorization-with-payer-auth-validation.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_payer_auth_validation(callback) { try { @@ -12,7 +13,7 @@ function authorization_with_payer_auth_validation(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -26,25 +27,28 @@ function authorization_with_payer_auth_validation(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; paymentInformationCard.number = '4000000000001091'; paymentInformationCard.expirationMonth = '01'; - paymentInformationCard.expirationYear = '2023'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.address1 = '201 S. Division St._1'; - orderInformationBillTo.address2 = 'Suite 500'; - orderInformationBillTo.locality = 'Foster City'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94404'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'accept@cybs.com'; - orderInformationBillTo.phoneNumber = '6504327113'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/authorization-with-tms-token-bypassing-network-token.js b/Samples/Payments/Payments/authorization-with-tms-token-bypassing-network-token.js index 9215370..e7f0a07 100644 --- a/Samples/Payments/Payments/authorization-with-tms-token-bypassing-network-token.js +++ b/Samples/Payments/Payments/authorization-with-tms-token-bypassing-network-token.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function authorization_with_tms_token_bypassing_network_token(callback) { try { @@ -27,7 +28,21 @@ function authorization_with_tms_token_bypassing_network_token(callback) { orderInformationAmountDetails.totalAmount = '102.21'; orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; - + + var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); + orderInformationBillTo.country = 'US'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); + orderInformation.billTo = orderInformationBillTo; + requestObj.orderInformation = orderInformation; var tokenInformation = new cybersourceRestApi.Ptsv2paymentsTokenInformation(); diff --git a/Samples/Payments/Payments/cit-initiating-instalment-subscription-uk.js b/Samples/Payments/Payments/cit-initiating-instalment-subscription-uk.js index 760a04c..d2ef5e5 100644 --- a/Samples/Payments/Payments/cit-initiating-instalment-subscription-uk.js +++ b/Samples/Payments/Payments/cit-initiating-instalment-subscription-uk.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function cit_initiating_instalment_subscription_uk(callback) { try { @@ -12,7 +13,7 @@ function cit_initiating_instalment_subscription_uk(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -36,9 +37,11 @@ function cit_initiating_instalment_subscription_uk(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; - paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); + paymentInformationCard.expirationMonth = '03'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -46,25 +49,28 @@ function cit_initiating_instalment_subscription_uk(callback) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); orderInformationAmountDetails.totalAmount = '102.21'; - orderInformationAmountDetails.currency = 'GBP'; + orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var consumerAuthenticationInformation = new cybersourceRestApi.Ptsv2paymentsConsumerAuthenticationInformation(); - consumerAuthenticationInformation.cavv = 'EHuWW9PiBkWvqE5juRwDzAUFBAk='; + consumerAuthenticationInformation.cavv = faker.string.alphanumeric(27)+'='; + consumerAuthenticationInformation.xid = faker.string.alphanumeric(27)+'='; requestObj.consumerAuthenticationInformation = consumerAuthenticationInformation; diff --git a/Samples/Payments/Payments/cit-initiating-recurring-subscription.js b/Samples/Payments/Payments/cit-initiating-recurring-subscription.js index 0db9249..54ae930 100644 --- a/Samples/Payments/Payments/cit-initiating-recurring-subscription.js +++ b/Samples/Payments/Payments/cit-initiating-recurring-subscription.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function cit_initiating_recurring_subscription(callback) { try { @@ -12,7 +13,7 @@ function cit_initiating_recurring_subscription(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -36,9 +37,11 @@ function cit_initiating_recurring_subscription(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -46,25 +49,28 @@ function cit_initiating_recurring_subscription(callback) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); orderInformationAmountDetails.totalAmount = '102.21'; - orderInformationAmountDetails.currency = 'GBP'; + orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var consumerAuthenticationInformation = new cybersourceRestApi.Ptsv2paymentsConsumerAuthenticationInformation(); - consumerAuthenticationInformation.cavv = 'EHuWW9PiBkWvqE5juRwDzAUFBAk='; + consumerAuthenticationInformation.cavv = faker.string.alphanumeric(27)+'='; + consumerAuthenticationInformation.xid = faker.string.alphanumeric(27)+'='; requestObj.consumerAuthenticationInformation = consumerAuthenticationInformation; diff --git a/Samples/Payments/Payments/cit-placing-credential-on-file.js b/Samples/Payments/Payments/cit-placing-credential-on-file.js index c11e2d4..817b0b5 100644 --- a/Samples/Payments/Payments/cit-placing-credential-on-file.js +++ b/Samples/Payments/Payments/cit-placing-credential-on-file.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function cit_placing_credential_on_file(callback) { try { @@ -12,7 +13,7 @@ function cit_placing_credential_on_file(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -31,9 +32,11 @@ function cit_placing_credential_on_file(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -41,25 +44,28 @@ function cit_placing_credential_on_file(callback) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); orderInformationAmountDetails.totalAmount = '102.21'; - orderInformationAmountDetails.currency = 'GBP'; + orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var consumerAuthenticationInformation = new cybersourceRestApi.Ptsv2paymentsConsumerAuthenticationInformation(); - consumerAuthenticationInformation.cavv = 'EHuWW9PiBkWvqE5juRwDzAUFBAk='; + consumerAuthenticationInformation.cavv = faker.string.alphanumeric(27)+'='; + consumerAuthenticationInformation.xid = faker.string.alphanumeric(27)+'='; requestObj.consumerAuthenticationInformation = consumerAuthenticationInformation; diff --git a/Samples/Payments/Payments/digital-payment-googlepay.js b/Samples/Payments/Payments/digital-payment-googlepay.js index 12cd357..0155339 100644 --- a/Samples/Payments/Payments/digital-payment-googlepay.js +++ b/Samples/Payments/Payments/digital-payment-googlepay.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function digital_payment_googlepay(callback, enable_capture) { try { @@ -12,7 +13,7 @@ function digital_payment_googlepay(callback, enable_capture) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC_1231223'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -26,9 +27,11 @@ function digital_payment_googlepay(callback, enable_capture) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationTokenizedCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationTokenizedCard(); - paymentInformationTokenizedCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationTokenizedCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationTokenizedCard.expirationMonth = '12'; - paymentInformationTokenizedCard.expirationYear = '2020'; + paymentInformationTokenizedCard.expirationYear = expYear; paymentInformationTokenizedCard.cryptogram = 'EHuWW9PiBkWvqE5juRwDzAUFBAk='; paymentInformationTokenizedCard.transactionType = '1'; paymentInformation.tokenizedCard = paymentInformationTokenizedCard; @@ -42,15 +45,17 @@ function digital_payment_googlepay(callback, enable_capture) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Deo'; - orderInformationBillTo.address1 = '901 Metro Center Blvd'; - orderInformationBillTo.locality = 'Foster City'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94404'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '6504327113'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/digital-payments-applepay.js b/Samples/Payments/Payments/digital-payments-applepay.js index ae411ee..50b1787 100644 --- a/Samples/Payments/Payments/digital-payments-applepay.js +++ b/Samples/Payments/Payments/digital-payments-applepay.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function digital_payments_applepay(callback, enable_capture) { try { @@ -12,7 +13,7 @@ function digital_payments_applepay(callback, enable_capture) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC_1231223'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -26,9 +27,11 @@ function digital_payments_applepay(callback, enable_capture) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationTokenizedCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationTokenizedCard(); - paymentInformationTokenizedCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationTokenizedCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationTokenizedCard.expirationMonth = '12'; - paymentInformationTokenizedCard.expirationYear = '2031'; + paymentInformationTokenizedCard.expirationYear = expYear; paymentInformationTokenizedCard.cryptogram = 'AceY+igABPs3jdwNaDg3MAACAAA='; paymentInformationTokenizedCard.transactionType = '1'; paymentInformation.tokenizedCard = paymentInformationTokenizedCard; @@ -42,15 +45,17 @@ function digital_payments_applepay(callback, enable_capture) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Deo'; - orderInformationBillTo.address1 = '901 Metro Center Blvd'; - orderInformationBillTo.locality = 'Foster City'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94404'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '6504327113'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/ebt-electronic-voucher-purchase-from-snap-account-with-visa-platform-connect.js b/Samples/Payments/Payments/ebt-electronic-voucher-purchase-from-snap-account-with-visa-platform-connect.js index a279d17..0a7173f 100644 --- a/Samples/Payments/Payments/ebt-electronic-voucher-purchase-from-snap-account-with-visa-platform-connect.js +++ b/Samples/Payments/Payments/ebt-electronic-voucher-purchase-from-snap-account-with-visa-platform-connect.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/AlternativeConfiguration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function ebt_electronic_voucher_purchase_from_snap_account_with_visa_platform_connect(callback) { try { @@ -12,7 +13,7 @@ function ebt_electronic_voucher_purchase_from_snap_account_with_visa_platform_co var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'EBT - Voucher Purchase From SNAP Account'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -31,9 +32,11 @@ function ebt_electronic_voucher_purchase_from_snap_account_with_visa_platform_co var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4012002000013007'; - paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '25'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); + paymentInformationCard.expirationMonth = '03'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; var paymentInformationPaymentType = new cybersourceRestApi.Ptsv2paymentsPaymentInformationPaymentType(); diff --git a/Samples/Payments/Payments/ebt-purchase-from-cash-benefits-account-with-cashback.js b/Samples/Payments/Payments/ebt-purchase-from-cash-benefits-account-with-cashback.js index 1294456..3cccf85 100644 --- a/Samples/Payments/Payments/ebt-purchase-from-cash-benefits-account-with-cashback.js +++ b/Samples/Payments/Payments/ebt-purchase-from-cash-benefits-account-with-cashback.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/AlternativeConfiguration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function ebt_purchase_from_cash_benefits_account_with_cashback(callback) { try { @@ -12,7 +13,7 @@ function ebt_purchase_from_cash_benefits_account_with_cashback(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'EBT - Purchase from Cash Benefits Account with CB'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); diff --git a/Samples/Payments/Payments/ebt-purchase-from-snap-account-with-visa-platform-connect.js b/Samples/Payments/Payments/ebt-purchase-from-snap-account-with-visa-platform-connect.js index 35e2061..c9ed5a9 100644 --- a/Samples/Payments/Payments/ebt-purchase-from-snap-account-with-visa-platform-connect.js +++ b/Samples/Payments/Payments/ebt-purchase-from-snap-account-with-visa-platform-connect.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/AlternativeConfiguration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function ebt_purchase_from_snap_account_with_visa_platform_connect(callback) { try { @@ -12,7 +13,7 @@ function ebt_purchase_from_snap_account_with_visa_platform_connect(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'EBT - Purchase From SNAP Account'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); diff --git a/Samples/Payments/Payments/electronic-check-debits-with-legacy-token.js b/Samples/Payments/Payments/electronic-check-debits-with-legacy-token.js index 7d43098..2db24f1 100644 --- a/Samples/Payments/Payments/electronic-check-debits-with-legacy-token.js +++ b/Samples/Payments/Payments/electronic-check-debits-with-legacy-token.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function electronic_check_debits_with_legacy_token(callback) { try { @@ -12,7 +13,7 @@ function electronic_check_debits_with_legacy_token(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); @@ -33,14 +34,17 @@ function electronic_check_debits_with_legacy_token(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/electronic-check-debits.js b/Samples/Payments/Payments/electronic-check-debits.js index e279899..f4219fb 100644 --- a/Samples/Payments/Payments/electronic-check-debits.js +++ b/Samples/Payments/Payments/electronic-check-debits.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function electronic_check_debits(callback, enable_capture) { try { @@ -12,7 +13,7 @@ function electronic_check_debits(callback, enable_capture) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -27,7 +28,7 @@ function electronic_check_debits(callback, enable_capture) { var paymentInformationBank = new cybersourceRestApi.Ptsv2paymentsPaymentInformationBank(); var paymentInformationBankAccount = new cybersourceRestApi.Ptsv2paymentsPaymentInformationBankAccount(); paymentInformationBankAccount.type = 'C'; - paymentInformationBankAccount.number = '4100'; + paymentInformationBankAccount.number = faker.finance.accountNumber(9); paymentInformationBank.account = paymentInformationBankAccount; paymentInformationBank.routingNumber = '071923284'; @@ -46,14 +47,17 @@ function electronic_check_debits(callback, enable_capture) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/incremental-authorization.js b/Samples/Payments/Payments/incremental-authorization.js index eeceec1..cce72c5 100644 --- a/Samples/Payments/Payments/incremental-authorization.js +++ b/Samples/Payments/Payments/incremental-authorization.js @@ -5,6 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/AlternativeConfiguration.js'); var configuration = require(filePath); var authorization_flow = require('./authorization-for-incremental-authorization-flow'); +const { faker } = require('@faker-js/faker'); function incremental_authorization(callback, id) { try { @@ -13,7 +14,7 @@ function incremental_authorization(callback, id) { var requestObj = new cybersourceRestApi.IncrementAuthRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsidClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; @@ -49,7 +50,7 @@ function incremental_authorization(callback, id) { authorization_flow.authorization_for_incremental_authorization_flow(function (error, data) { if (data) { var id = data['id']; - console.log('\n*************** Incremental Authorization *********************'); + console.log('\n********************* Incremental Authorization *********************'); console.log('Payment ID : ' + id); instance.incrementAuth( id, requestObj, function (error, data, response) { diff --git a/Samples/Payments/Payments/level-ii-data.js b/Samples/Payments/Payments/level-ii-data.js index 1fc019d..bc9c3f7 100644 --- a/Samples/Payments/Payments/level-ii-data.js +++ b/Samples/Payments/Payments/level-ii-data.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function level_ii_data(callback, enable_capture) { try { @@ -12,7 +13,7 @@ function level_ii_data(callback, enable_capture) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_12'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -24,9 +25,11 @@ function level_ii_data(callback, enable_capture) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; - paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); + paymentInformationCard.expirationMonth = '03'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.type = '001'; paymentInformationCard.securityCode = '123'; paymentInformation.card = paymentInformationCard; @@ -35,24 +38,26 @@ function level_ii_data(callback, enable_capture) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '112.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 200 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; var orderInformationInvoiceDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationInvoiceDetails(); - orderInformationInvoiceDetails.purchaseOrderNumber = 'LevelII Auth Po'; + orderInformationInvoiceDetails.purchaseOrderNumber = 'LevelII-'+faker.string.alphanumeric(7); orderInformation.invoiceDetails = orderInformationInvoiceDetails; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/level-iii-data.js b/Samples/Payments/Payments/level-iii-data.js index d9581dd..9ed0c09 100644 --- a/Samples/Payments/Payments/level-iii-data.js +++ b/Samples/Payments/Payments/level-iii-data.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function level_iii_data(callback, enable_capture) { try { @@ -12,7 +13,7 @@ function level_iii_data(callback, enable_capture) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_14'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -26,9 +27,11 @@ function level_iii_data(callback, enable_capture) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; - paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); + paymentInformationCard.expirationMonth = '03'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.type = '001'; paymentInformationCard.securityCode = '123'; paymentInformation.card = paymentInformationCard; @@ -37,20 +40,22 @@ function level_iii_data(callback, enable_capture) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '100.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 200 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; @@ -67,7 +72,7 @@ function level_iii_data(callback, enable_capture) { orderInformation.lineItems = lineItems; var orderInformationInvoiceDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationInvoiceDetails(); - orderInformationInvoiceDetails.purchaseOrderNumber = 'LevelIII Auth Po'; + orderInformationInvoiceDetails.purchaseOrderNumber = 'LevelIII-'+faker.string.alphanumeric(7); orderInformation.invoiceDetails = orderInformationInvoiceDetails; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/mit-industry-practice-delayed-charge-3ri-visa.js b/Samples/Payments/Payments/mit-industry-practice-delayed-charge-3ri-visa.js index 32408f9..b27e23d 100644 --- a/Samples/Payments/Payments/mit-industry-practice-delayed-charge-3ri-visa.js +++ b/Samples/Payments/Payments/mit-industry-practice-delayed-charge-3ri-visa.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function mit_industry_practice_delayed_charge_3ri_visa(callback) { try { @@ -12,7 +13,7 @@ function mit_industry_practice_delayed_charge_3ri_visa(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -37,9 +38,11 @@ function mit_industry_practice_delayed_charge_3ri_visa(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; - paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); + paymentInformationCard.expirationMonth = '03'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.type = '001'; paymentInformation.card = paymentInformationCard; @@ -48,25 +51,28 @@ function mit_industry_practice_delayed_charge_3ri_visa(callback) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); orderInformationAmountDetails.totalAmount = '102.21'; - orderInformationAmountDetails.currency = 'GBP'; + orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var consumerAuthenticationInformation = new cybersourceRestApi.Ptsv2paymentsConsumerAuthenticationInformation(); - consumerAuthenticationInformation.cavv = 'EHuWW9PiBkWvqE5juRwDzAUFBAk='; + consumerAuthenticationInformation.cavv = faker.string.alphanumeric(27)+'='; + consumerAuthenticationInformation.xid = faker.string.alphanumeric(27)+'='; consumerAuthenticationInformation.paresStatus = 'Y'; requestObj.consumerAuthenticationInformation = consumerAuthenticationInformation; diff --git a/Samples/Payments/Payments/mit-industry-practice-resubmission.js b/Samples/Payments/Payments/mit-industry-practice-resubmission.js index b724ef3..1eb77bf 100644 --- a/Samples/Payments/Payments/mit-industry-practice-resubmission.js +++ b/Samples/Payments/Payments/mit-industry-practice-resubmission.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function mit_industry_practice_resubmission(callback) { try { @@ -12,7 +13,7 @@ function mit_industry_practice_resubmission(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -37,9 +38,11 @@ function mit_industry_practice_resubmission(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; - paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); + paymentInformationCard.expirationMonth = '03'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.type = '001'; paymentInformation.card = paymentInformationCard; @@ -48,19 +51,21 @@ function mit_industry_practice_resubmission(callback) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); orderInformationAmountDetails.totalAmount = '102.21'; - orderInformationAmountDetails.currency = 'GBP'; + orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/mit-instalment.js b/Samples/Payments/Payments/mit-instalment.js index ca9b850..25d50e3 100644 --- a/Samples/Payments/Payments/mit-instalment.js +++ b/Samples/Payments/Payments/mit-instalment.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function mit_instalment(callback) { try { @@ -12,7 +13,7 @@ function mit_instalment(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -36,9 +37,11 @@ function mit_instalment(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.type = '001'; paymentInformation.card = paymentInformationCard; @@ -47,19 +50,21 @@ function mit_instalment(callback) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); orderInformationAmountDetails.totalAmount = '102.21'; - orderInformationAmountDetails.currency = 'GBP'; + orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/mit-recurring.js b/Samples/Payments/Payments/mit-recurring.js index eebac53..9f9c476 100644 --- a/Samples/Payments/Payments/mit-recurring.js +++ b/Samples/Payments/Payments/mit-recurring.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function mit_recurring(callback) { try { @@ -36,9 +37,11 @@ function mit_recurring(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.type = '001'; paymentInformation.card = paymentInformationCard; @@ -47,19 +50,21 @@ function mit_recurring(callback) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); orderInformationAmountDetails.totalAmount = '102.21'; - orderInformationAmountDetails.currency = 'GBP'; + orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/mit-unscheduled-credential-on-file.js b/Samples/Payments/Payments/mit-unscheduled-credential-on-file.js index af512cc..41bc87c 100644 --- a/Samples/Payments/Payments/mit-unscheduled-credential-on-file.js +++ b/Samples/Payments/Payments/mit-unscheduled-credential-on-file.js @@ -1,9 +1,11 @@ 'use strict'; +const exp = require('constants'); var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function mit_unscheduled_credential_on_file(callback) { try { @@ -12,7 +14,7 @@ function mit_unscheduled_credential_on_file(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -36,9 +38,11 @@ function mit_unscheduled_credential_on_file(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.type = '001'; paymentInformation.card = paymentInformationCard; @@ -47,19 +51,21 @@ function mit_unscheduled_credential_on_file(callback) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); orderInformationAmountDetails.totalAmount = '102.21'; - orderInformationAmountDetails.currency = 'GBP'; + orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/partial-authorization.js b/Samples/Payments/Payments/partial-authorization.js index 0f7a321..b894135 100644 --- a/Samples/Payments/Payments/partial-authorization.js +++ b/Samples/Payments/Payments/partial-authorization.js @@ -4,6 +4,8 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); + function partial_authorization(callback) { try { @@ -12,14 +14,16 @@ function partial_authorization(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '1234567890'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.securityCode = '123'; paymentInformation.card = paymentInformationCard; @@ -32,15 +36,17 @@ function partial_authorization(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/payment-network-tokenization.js b/Samples/Payments/Payments/payment-network-tokenization.js index 7940884..637927e 100644 --- a/Samples/Payments/Payments/payment-network-tokenization.js +++ b/Samples/Payments/Payments/payment-network-tokenization.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function payment_network_tokenization(callback, enable_capture) { try { @@ -26,9 +27,11 @@ function payment_network_tokenization(callback, enable_capture) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationTokenizedCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationTokenizedCard(); - paymentInformationTokenizedCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationTokenizedCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationTokenizedCard.expirationMonth = '12'; - paymentInformationTokenizedCard.expirationYear = '2031'; + paymentInformationTokenizedCard.expirationYear = expYear; paymentInformationTokenizedCard.transactionType = '1'; paymentInformation.tokenizedCard = paymentInformationTokenizedCard; @@ -41,22 +44,24 @@ function payment_network_tokenization(callback, enable_capture) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var consumerAuthenticationInformation = new cybersourceRestApi.Ptsv2paymentsConsumerAuthenticationInformation(); - consumerAuthenticationInformation.cavv = 'AAABCSIIAAAAAAACcwgAEMCoNh+='; - consumerAuthenticationInformation.xid = 'T1Y0OVcxMVJJdkI0WFlBcXptUzE='; + consumerAuthenticationInformation.cavv = faker.string.alphanumeric(27)+'='; + consumerAuthenticationInformation.xid = faker.string.alphanumeric(27)+'='; requestObj.consumerAuthenticationInformation = consumerAuthenticationInformation; diff --git a/Samples/Payments/Payments/payment-with-flex-token-create-permanent-tms-token.js b/Samples/Payments/Payments/payment-with-flex-token-create-permanent-tms-token.js index 346ce12..6387da6 100644 --- a/Samples/Payments/Payments/payment-with-flex-token-create-permanent-tms-token.js +++ b/Samples/Payments/Payments/payment-with-flex-token-create-permanent-tms-token.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function payment_with_flex_token_create_permanent_tms_token(callback) { try { @@ -12,7 +13,7 @@ function payment_with_flex_token_create_permanent_tms_token(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -38,24 +39,26 @@ function payment_with_flex_token_create_permanent_tms_token(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; var orderInformationShipTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationShipTo(); - orderInformationShipTo.firstName = 'John'; - orderInformationShipTo.lastName = 'Doe'; - orderInformationShipTo.address1 = '1 Market St'; - orderInformationShipTo.locality = 'san francisco'; - orderInformationShipTo.administrativeArea = 'CA'; - orderInformationShipTo.postalCode = '94105'; + orderInformationShipTo.firstName = fName; + orderInformationShipTo.lastName = lName; + orderInformationShipTo.address1 = faker.location.streetAddress(); + orderInformationShipTo.locality = faker.location.city(); + orderInformationShipTo.administrativeArea = faker.location.state(); + orderInformationShipTo.postalCode = faker.location.zipCode(); orderInformationShipTo.country = 'US'; orderInformation.shipTo = orderInformationShipTo; diff --git a/Samples/Payments/Payments/payment-with-flex-token.js b/Samples/Payments/Payments/payment-with-flex-token.js index 14994a4..29e3986 100644 --- a/Samples/Payments/Payments/payment-with-flex-token.js +++ b/Samples/Payments/Payments/payment-with-flex-token.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function payment_with_flex_token(callback) { try { @@ -12,7 +13,7 @@ function payment_with_flex_token(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); @@ -22,17 +23,17 @@ function payment_with_flex_token(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'RTS'; - orderInformationBillTo.lastName = 'VDP'; - orderInformationBillTo.address1 = '201 S. Division St.'; - orderInformationBillTo.locality = 'Ann Arbor'; - orderInformationBillTo.administrativeArea = 'MI'; - orderInformationBillTo.postalCode = '48104-2201'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.district = 'MI'; - orderInformationBillTo.buildingNumber = '123'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '999999999'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/pin-debit-purchase-using-emv-technology-with-contactless-read-with-visa-platform-connect.js b/Samples/Payments/Payments/pin-debit-purchase-using-emv-technology-with-contactless-read-with-visa-platform-connect.js index 33d53d9..c71edc6 100644 --- a/Samples/Payments/Payments/pin-debit-purchase-using-emv-technology-with-contactless-read-with-visa-platform-connect.js +++ b/Samples/Payments/Payments/pin-debit-purchase-using-emv-technology-with-contactless-read-with-visa-platform-connect.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/AlternativeConfiguration.js'); var configuration = require(filePath); +const { faker } = require('@faker-js/faker'); function pin_debit_purchase_using_emv_technology_with_contactless_read_with_visa_platform_connect(callback) { try { @@ -12,7 +13,7 @@ function pin_debit_purchase_using_emv_technology_with_contactless_read_with_visa var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '2.2 Purchase'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); diff --git a/Samples/Payments/Payments/pin-debit-purchase-using-swiped-track-data-with-visa-platform-connect.js b/Samples/Payments/Payments/pin-debit-purchase-using-swiped-track-data-with-visa-platform-connect.js index 128d27f..13a422a 100644 --- a/Samples/Payments/Payments/pin-debit-purchase-using-swiped-track-data-with-visa-platform-connect.js +++ b/Samples/Payments/Payments/pin-debit-purchase-using-swiped-track-data-with-visa-platform-connect.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/AlternativeConfiguration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function pin_debit_purchase_using_swiped_track_data_with_visa_platform_connect(callback) { try { @@ -12,7 +13,7 @@ function pin_debit_purchase_using_swiped_track_data_with_visa_platform_connect(c var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '2.2 Purchase'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); diff --git a/Samples/Payments/Payments/restaurant-authorization.js b/Samples/Payments/Payments/restaurant-authorization.js index 3edf704..be638e6 100644 --- a/Samples/Payments/Payments/restaurant-authorization.js +++ b/Samples/Payments/Payments/restaurant-authorization.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function restaurant_authorization(callback) { try { @@ -12,7 +13,7 @@ function restaurant_authorization(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'demomerchant'; + clientReferenceInformation.code = faker.string.uuid(); var clientReferenceInformationPartner = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformationPartner(); clientReferenceInformationPartner.thirdPartyCertificationNumber = '123456789012'; clientReferenceInformation.partner = clientReferenceInformationPartner; @@ -32,7 +33,7 @@ function restaurant_authorization(callback) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '100.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 200 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; diff --git a/Samples/Payments/Payments/sale-using-keyed-data-for-card-present-enabled-acquirer.js b/Samples/Payments/Payments/sale-using-keyed-data-for-card-present-enabled-acquirer.js index 778c65f..6bee534 100644 --- a/Samples/Payments/Payments/sale-using-keyed-data-for-card-present-enabled-acquirer.js +++ b/Samples/Payments/Payments/sale-using-keyed-data-for-card-present-enabled-acquirer.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function sale_using_keyed_data_for_card_present_enabled_acquirer(callback) { try { @@ -12,7 +13,7 @@ function sale_using_keyed_data_for_card_present_enabled_acquirer(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '123456'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -22,9 +23,11 @@ function sale_using_keyed_data_for_card_present_enabled_acquirer(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.securityCode = '123'; paymentInformation.card = paymentInformationCard; @@ -32,7 +35,7 @@ function sale_using_keyed_data_for_card_present_enabled_acquirer(callback) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '100.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 200 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; diff --git a/Samples/Payments/Payments/sale-using-keyed-data-with-balance-inquiry.js b/Samples/Payments/Payments/sale-using-keyed-data-with-balance-inquiry.js index 45bd1fc..dea2797 100644 --- a/Samples/Payments/Payments/sale-using-keyed-data-with-balance-inquiry.js +++ b/Samples/Payments/Payments/sale-using-keyed-data-with-balance-inquiry.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function sale_using_keyed_data_with_balance_inquiry(callback) { try { @@ -12,7 +13,7 @@ function sale_using_keyed_data_with_balance_inquiry(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '123456'; + clientReferenceInformation.code = faker.string.uuid(); var clientReferenceInformationPartner = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformationPartner(); clientReferenceInformationPartner.thirdPartyCertificationNumber = '123456789012'; clientReferenceInformation.partner = clientReferenceInformationPartner; @@ -32,9 +33,11 @@ function sale_using_keyed_data_with_balance_inquiry(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.securityCode = '123'; paymentInformation.card = paymentInformationCard; @@ -42,7 +45,7 @@ function sale_using_keyed_data_with_balance_inquiry(callback) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '100.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 200 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; diff --git a/Samples/Payments/Payments/sale-using-keyed-data-with-visa-platform-connect.js b/Samples/Payments/Payments/sale-using-keyed-data-with-visa-platform-connect.js index 4cd75a2..88baf05 100644 --- a/Samples/Payments/Payments/sale-using-keyed-data-with-visa-platform-connect.js +++ b/Samples/Payments/Payments/sale-using-keyed-data-with-visa-platform-connect.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function sale_using_keyed_data_with_visa_platform_connect(callback) { try { @@ -12,7 +13,7 @@ function sale_using_keyed_data_with_visa_platform_connect(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '123456'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -28,9 +29,11 @@ function sale_using_keyed_data_with_visa_platform_connect(callback) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.securityCode = '123'; paymentInformation.card = paymentInformationCard; @@ -38,7 +41,7 @@ function sale_using_keyed_data_with_visa_platform_connect(callback) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '100.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 200 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; diff --git a/Samples/Payments/Payments/service-fees-with-credit-card-transaction.js b/Samples/Payments/Payments/service-fees-with-credit-card-transaction.js index 95fa4f1..e03953f 100644 --- a/Samples/Payments/Payments/service-fees-with-credit-card-transaction.js +++ b/Samples/Payments/Payments/service-fees-with-credit-card-transaction.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function service_fees_with_credit_card_transaction(callback, enable_capture) { try { @@ -12,7 +13,7 @@ function service_fees_with_credit_card_transaction(callback, enable_capture) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -25,9 +26,11 @@ function service_fees_with_credit_card_transaction(callback, enable_capture) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.securityCode = '123'; paymentInformation.card = paymentInformationCard; @@ -35,21 +38,23 @@ function service_fees_with_credit_card_transaction(callback, enable_capture) { var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '2325.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 200 }); orderInformationAmountDetails.currency = 'USD'; orderInformationAmountDetails.serviceFeeAmount = '30.0'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/simple-authorizationinternet.js b/Samples/Payments/Payments/simple-authorizationinternet.js index 2088da9..1df76d2 100644 --- a/Samples/Payments/Payments/simple-authorizationinternet.js +++ b/Samples/Payments/Payments/simple-authorizationinternet.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function simple_authorization_internet(callback, enable_capture) { try { @@ -12,7 +13,7 @@ function simple_authorization_internet(callback, enable_capture) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var processingInformation = new cybersourceRestApi.Ptsv2paymentsProcessingInformation(); @@ -25,29 +26,33 @@ function simple_authorization_internet(callback, enable_capture) { var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; var orderInformation = new cybersourceRestApi.Ptsv2paymentsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Ptsv2paymentsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '50.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 200 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/Payments/Payments/zero-dollar-authorization.js b/Samples/Payments/Payments/zero-dollar-authorization.js index 97a0c23..09244cf 100644 --- a/Samples/Payments/Payments/zero-dollar-authorization.js +++ b/Samples/Payments/Payments/zero-dollar-authorization.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function zero_dollar_authorization(callback) { try { @@ -12,14 +13,16 @@ function zero_dollar_authorization(callback) { var requestObj = new cybersourceRestApi.CreatePaymentRequest(); var clientReferenceInformation = new cybersourceRestApi.Ptsv2paymentsClientReferenceInformation(); - clientReferenceInformation.code = '1234567890'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Ptsv2paymentsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Ptsv2paymentsPaymentInformationCard(); - paymentInformationCard.number = '5555555555554444'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2031'; + paymentInformationCard.expirationYear = expYear; paymentInformationCard.securityCode = '123'; paymentInformation.card = paymentInformationCard; @@ -32,15 +35,17 @@ function zero_dollar_authorization(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Ptsv2paymentsOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'san francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.email = 'test@cybs.com'; - orderInformationBillTo.phoneNumber = '4158880000'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/RiskManagement/DecisionManager/add-data-to-list.js b/Samples/RiskManagement/DecisionManager/add-data-to-list.js index b27cd98..f816e72 100644 --- a/Samples/RiskManagement/DecisionManager/add-data-to-list.js +++ b/Samples/RiskManagement/DecisionManager/add-data-to-list.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function add_data_to_list(callback) { var type = 'negative'; @@ -15,18 +16,20 @@ function add_data_to_list(callback) { var orderInformation = new cybersourceRestApi.Riskv1liststypeentriesOrderInformation(); var orderInformationAddress = new cybersourceRestApi.Riskv1liststypeentriesOrderInformationAddress(); - orderInformationAddress.address1 = '1234 Sample St.'; - orderInformationAddress.address2 = 'Mountain View'; - orderInformationAddress.locality = 'California'; + orderInformationAddress.address1 = faker.location.streetAddress(); + orderInformationAddress.address2 = faker.location.secondaryAddress(); + orderInformationAddress.locality = faker.location.city(); orderInformationAddress.country = 'US'; - orderInformationAddress.administrativeArea = 'CA'; - orderInformationAddress.postalCode = '94043'; + orderInformationAddress.administrativeArea = faker.location.state(); + orderInformationAddress.postalCode = faker.location.zipCode(); orderInformation.address = orderInformationAddress; var orderInformationBillTo = new cybersourceRestApi.Riskv1liststypeentriesOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.email = 'test@example.com'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/RiskManagement/DecisionManager/add-duplicate-information.js b/Samples/RiskManagement/DecisionManager/add-duplicate-information.js index cabd2ad..7f5fbae 100644 --- a/Samples/RiskManagement/DecisionManager/add-duplicate-information.js +++ b/Samples/RiskManagement/DecisionManager/add-duplicate-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function add_duplicate_information(callback) { var type = 'positive'; @@ -15,18 +16,20 @@ function add_duplicate_information(callback) { var orderInformation = new cybersourceRestApi.Riskv1liststypeentriesOrderInformation(); var orderInformationAddress = new cybersourceRestApi.Riskv1liststypeentriesOrderInformationAddress(); - orderInformationAddress.address1 = '1234 Sample St.'; - orderInformationAddress.address2 = 'Mountain View'; - orderInformationAddress.locality = 'California'; + orderInformationAddress.address1 = faker.location.streetAddress(); + orderInformationAddress.address2 = faker.location.secondaryAddress(); + orderInformationAddress.locality = faker.location.city(); orderInformationAddress.country = 'US'; - orderInformationAddress.administrativeArea = 'CA'; - orderInformationAddress.postalCode = '94043'; + orderInformationAddress.administrativeArea = faker.location.state(); + orderInformationAddress.postalCode = faker.location.zipCode(); orderInformation.address = orderInformationAddress; var orderInformationBillTo = new cybersourceRestApi.Riskv1liststypeentriesOrderInformationBillTo(); - orderInformationBillTo.firstName = 'John'; - orderInformationBillTo.lastName = 'Doe'; - orderInformationBillTo.email = 'nobody@example.com'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/RiskManagement/DecisionManager/basic-dm-transaction.js b/Samples/RiskManagement/DecisionManager/basic-dm-transaction.js index 390d587..e8f1fa3 100644 --- a/Samples/RiskManagement/DecisionManager/basic-dm-transaction.js +++ b/Samples/RiskManagement/DecisionManager/basic-dm-transaction.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function basic_dm_transaction(callback) { try { @@ -23,9 +24,11 @@ function basic_dm_transaction(callback) { var paymentInformation = new cybersourceRestApi.Riskv1decisionsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1decisionsPaymentInformationCard(); - paymentInformationCard.number = '4444444444444448'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -33,19 +36,21 @@ function basic_dm_transaction(callback) { var orderInformation = new cybersourceRestApi.Riskv1decisionsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1decisionsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '144.14'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Riskv1decisionsOrderInformationBillTo(); - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.administrativeArea = 'NH'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.phoneNumber = '7606160717'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.postalCode = '03055'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/RiskManagement/DecisionManager/dm-with-buyer-information.js b/Samples/RiskManagement/DecisionManager/dm-with-buyer-information.js index 958193b..d671471 100644 --- a/Samples/RiskManagement/DecisionManager/dm-with-buyer-information.js +++ b/Samples/RiskManagement/DecisionManager/dm-with-buyer-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function dm_with_buyer_information(callback) { try { @@ -12,14 +13,16 @@ function dm_with_buyer_information(callback) { var requestObj = new cybersourceRestApi.CreateBundledDecisionManagerCaseRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1decisionsClientReferenceInformation(); - clientReferenceInformation.code = '54323007'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Riskv1decisionsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1decisionsPaymentInformationCard(); - paymentInformationCard.number = '4444444444444448'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -27,19 +30,21 @@ function dm_with_buyer_information(callback) { var orderInformation = new cybersourceRestApi.Riskv1decisionsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1decisionsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '144.14'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Riskv1decisionsOrderInformationBillTo(); - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.administrativeArea = 'NH'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.phoneNumber = '7606160717'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.postalCode = '03055'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/RiskManagement/DecisionManager/dm-with-decisionprofilereject-response.js b/Samples/RiskManagement/DecisionManager/dm-with-decisionprofilereject-response.js index 6b8797f..dc63014 100644 --- a/Samples/RiskManagement/DecisionManager/dm-with-decisionprofilereject-response.js +++ b/Samples/RiskManagement/DecisionManager/dm-with-decisionprofilereject-response.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function dm_with_decision_profile_reject_response(callback) { try { @@ -12,14 +13,16 @@ function dm_with_decision_profile_reject_response(callback) { var requestObj = new cybersourceRestApi.CreateBundledDecisionManagerCaseRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1decisionsClientReferenceInformation(); - clientReferenceInformation.code = '54323007'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Riskv1decisionsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1decisionsPaymentInformationCard(); - paymentInformationCard.number = '4444444444444448'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -27,19 +30,21 @@ function dm_with_decision_profile_reject_response(callback) { var orderInformation = new cybersourceRestApi.Riskv1decisionsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1decisionsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '144.14'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Riskv1decisionsOrderInformationBillTo(); - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.administrativeArea = 'NH'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.phoneNumber = '7606160717'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.postalCode = '03055'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; diff --git a/Samples/RiskManagement/DecisionManager/dm-with-device-information.js b/Samples/RiskManagement/DecisionManager/dm-with-device-information.js index 516a4a3..d8fb69b 100644 --- a/Samples/RiskManagement/DecisionManager/dm-with-device-information.js +++ b/Samples/RiskManagement/DecisionManager/dm-with-device-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function dm_with_device_information(callback) { try { @@ -12,14 +13,16 @@ function dm_with_device_information(callback) { var requestObj = new cybersourceRestApi.CreateBundledDecisionManagerCaseRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1decisionsClientReferenceInformation(); - clientReferenceInformation.code = '54323007'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Riskv1decisionsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1decisionsPaymentInformationCard(); - paymentInformationCard.number = '4444444444444448'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -27,26 +30,28 @@ function dm_with_device_information(callback) { var orderInformation = new cybersourceRestApi.Riskv1decisionsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1decisionsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '144.14'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Riskv1decisionsOrderInformationBillTo(); - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.administrativeArea = 'NH'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.phoneNumber = '7606160717'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.postalCode = '03055'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var deviceInformation = new cybersourceRestApi.Riskv1decisionsDeviceInformation(); deviceInformation.cookiesAccepted = 'yes'; - deviceInformation.ipAddress = '64.124.61.215'; + deviceInformation.ipAddress = faker.internet.ipv4(); deviceInformation.hostName = 'host.com'; deviceInformation.httpBrowserEmail = 'xyz@gmail.com'; deviceInformation.userAgent = 'Chrome'; diff --git a/Samples/RiskManagement/DecisionManager/dm-with-merchant-defined-information.js b/Samples/RiskManagement/DecisionManager/dm-with-merchant-defined-information.js index 1456e64..bf0c1b6 100644 --- a/Samples/RiskManagement/DecisionManager/dm-with-merchant-defined-information.js +++ b/Samples/RiskManagement/DecisionManager/dm-with-merchant-defined-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function dm_with_merchant_defined_information(callback) { try { @@ -12,14 +13,16 @@ function dm_with_merchant_defined_information(callback) { var requestObj = new cybersourceRestApi.CreateBundledDecisionManagerCaseRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1decisionsClientReferenceInformation(); - clientReferenceInformation.code = '54323007'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Riskv1decisionsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1decisionsPaymentInformationCard(); - paymentInformationCard.number = '4444444444444448'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -27,19 +30,21 @@ function dm_with_merchant_defined_information(callback) { var orderInformation = new cybersourceRestApi.Riskv1decisionsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1decisionsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '144.14'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Riskv1decisionsOrderInformationBillTo(); - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.administrativeArea = 'NH'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.phoneNumber = '7606160717'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.postalCode = '03055'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; @@ -48,12 +53,12 @@ function dm_with_merchant_defined_information(callback) { var merchantDefinedInformation = new Array(); var merchantDefinedInformation1 = new cybersourceRestApi.Riskv1decisionsMerchantDefinedInformation(); merchantDefinedInformation1.key = '1'; - merchantDefinedInformation1.value = 'Test'; + merchantDefinedInformation1.value = faker.word.noun(); merchantDefinedInformation.push(merchantDefinedInformation1); var merchantDefinedInformation2 = new cybersourceRestApi.Riskv1decisionsMerchantDefinedInformation(); merchantDefinedInformation2.key = '2'; - merchantDefinedInformation2.value = 'Test2'; + merchantDefinedInformation2.value = faker.word.verb(); merchantDefinedInformation.push(merchantDefinedInformation2); requestObj.merchantDefinedInformation = merchantDefinedInformation; diff --git a/Samples/RiskManagement/DecisionManager/dm-with-scoreexceedsthreshold-response.js b/Samples/RiskManagement/DecisionManager/dm-with-scoreexceedsthreshold-response.js index eab4b1f..1acdfe1 100644 --- a/Samples/RiskManagement/DecisionManager/dm-with-scoreexceedsthreshold-response.js +++ b/Samples/RiskManagement/DecisionManager/dm-with-scoreexceedsthreshold-response.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function dm_with_score_exceeds_threshold_response(callback) { try { @@ -12,14 +13,17 @@ function dm_with_score_exceeds_threshold_response(callback) { var requestObj = new cybersourceRestApi.CreateBundledDecisionManagerCaseRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1decisionsClientReferenceInformation(); - clientReferenceInformation.code = '54323007'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Riskv1decisionsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1decisionsPaymentInformationCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; + // test card `4444444444444448` produces excessive score paymentInformationCard.number = '4444444444444448'; paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -27,34 +31,36 @@ function dm_with_score_exceeds_threshold_response(callback) { var orderInformation = new cybersourceRestApi.Riskv1decisionsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1decisionsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '144.14'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; - var orderInformationShipTo = new cybersourceRestApi.Riskv1decisionsOrderInformationShipTo(); - orderInformationShipTo.address1 = '96, powers street'; - orderInformationShipTo.address2 = ''; - orderInformationShipTo.administrativeArea = 'KA'; - orderInformationShipTo.country = 'IN'; - orderInformationShipTo.locality = 'Clearwater milford'; - orderInformationShipTo.firstName = 'James'; - orderInformationShipTo.lastName = 'Smith'; - orderInformationShipTo.phoneNumber = '7606160717'; - orderInformationShipTo.postalCode = '560056'; - orderInformation.shipTo = orderInformationShipTo; - var orderInformationBillTo = new cybersourceRestApi.Riskv1decisionsOrderInformationBillTo(); - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.administrativeArea = 'NH'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.phoneNumber = '7606160717'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.postalCode = '03055'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; + var orderInformationShipTo = new cybersourceRestApi.Riskv1decisionsOrderInformationShipTo(); + orderInformationShipTo.address1 = faker.location.streetAddress(); + orderInformationShipTo.address2 = faker.location.secondaryAddress(); + orderInformationShipTo.administrativeArea = faker.location.state(); + orderInformationShipTo.country = 'IN'; + orderInformationShipTo.locality = faker.location.city(); + orderInformationShipTo.firstName = fName; + orderInformationShipTo.lastName = lName; + orderInformationShipTo.phoneNumber = faker.string.numeric(10); + orderInformationShipTo.postalCode = faker.location.zipCode(); + orderInformation.shipTo = orderInformationShipTo; + var instance = new cybersourceRestApi.DecisionManagerApi(configObject, apiClient); diff --git a/Samples/RiskManagement/DecisionManager/dm-with-shipping-information.js b/Samples/RiskManagement/DecisionManager/dm-with-shipping-information.js index 5c7375e..d25e976 100644 --- a/Samples/RiskManagement/DecisionManager/dm-with-shipping-information.js +++ b/Samples/RiskManagement/DecisionManager/dm-with-shipping-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function dm_with_shipping_information(callback) { try { @@ -12,14 +13,16 @@ function dm_with_shipping_information(callback) { var requestObj = new cybersourceRestApi.CreateBundledDecisionManagerCaseRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1decisionsClientReferenceInformation(); - clientReferenceInformation.code = '54323007'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Riskv1decisionsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1decisionsPaymentInformationCard(); - paymentInformationCard.number = '4444444444444448'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -27,34 +30,35 @@ function dm_with_shipping_information(callback) { var orderInformation = new cybersourceRestApi.Riskv1decisionsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1decisionsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '144.14'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; - var orderInformationShipTo = new cybersourceRestApi.Riskv1decisionsOrderInformationShipTo(); - orderInformationShipTo.address1 = '96, powers street'; - orderInformationShipTo.address2 = ''; - orderInformationShipTo.administrativeArea = 'KA'; - orderInformationShipTo.country = 'IN'; - orderInformationShipTo.locality = 'Clearwater milford'; - orderInformationShipTo.firstName = 'James'; - orderInformationShipTo.lastName = 'Smith'; - orderInformationShipTo.phoneNumber = '7606160717'; - orderInformationShipTo.postalCode = '560056'; - orderInformation.shipTo = orderInformationShipTo; - var orderInformationBillTo = new cybersourceRestApi.Riskv1decisionsOrderInformationBillTo(); - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.administrativeArea = 'NH'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.phoneNumber = '7606160717'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.postalCode = '03055'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; + var orderInformationShipTo = new cybersourceRestApi.Riskv1decisionsOrderInformationShipTo(); + orderInformationShipTo.address1 = faker.location.streetAddress(); + orderInformationShipTo.address2 = faker.location.secondaryAddress(); + orderInformationShipTo.administrativeArea = faker.location.state(); + orderInformationShipTo.country = 'IN'; + orderInformationShipTo.locality = faker.location.city(); + orderInformationShipTo.firstName = fName; + orderInformationShipTo.lastName = lName; + orderInformationShipTo.phoneNumber = faker.string.numeric(10); + orderInformationShipTo.postalCode = faker.location.zipCode(); + orderInformation.shipTo = orderInformationShipTo; var instance = new cybersourceRestApi.DecisionManagerApi(configObject, apiClient); diff --git a/Samples/RiskManagement/DecisionManager/dm-with-travel-information.js b/Samples/RiskManagement/DecisionManager/dm-with-travel-information.js index 3b61ce9..3a9a64e 100644 --- a/Samples/RiskManagement/DecisionManager/dm-with-travel-information.js +++ b/Samples/RiskManagement/DecisionManager/dm-with-travel-information.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function dm_with_travel_information(callback) { try { @@ -12,14 +13,16 @@ function dm_with_travel_information(callback) { var requestObj = new cybersourceRestApi.CreateBundledDecisionManagerCaseRequest(); var clientReferenceInformation = new cybersourceRestApi.Riskv1decisionsClientReferenceInformation(); - clientReferenceInformation.code = '54323007'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var paymentInformation = new cybersourceRestApi.Riskv1decisionsPaymentInformation(); var paymentInformationCard = new cybersourceRestApi.Riskv1decisionsPaymentInformationCard(); - paymentInformationCard.number = '4444444444444448'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + paymentInformationCard.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); paymentInformationCard.expirationMonth = '12'; - paymentInformationCard.expirationYear = '2020'; + paymentInformationCard.expirationYear = expYear; paymentInformation.card = paymentInformationCard; requestObj.paymentInformation = paymentInformation; @@ -27,26 +30,31 @@ function dm_with_travel_information(callback) { var orderInformation = new cybersourceRestApi.Riskv1decisionsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Riskv1decisionsOrderInformationAmountDetails(); orderInformationAmountDetails.currency = 'USD'; - orderInformationAmountDetails.totalAmount = '144.14'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 500 }); orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Riskv1decisionsOrderInformationBillTo(); - orderInformationBillTo.address1 = '96, powers street'; - orderInformationBillTo.administrativeArea = 'NH'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; - orderInformationBillTo.locality = 'Clearwater milford'; - orderInformationBillTo.firstName = 'James'; - orderInformationBillTo.lastName = 'Smith'; - orderInformationBillTo.phoneNumber = '7606160717'; - orderInformationBillTo.email = 'test@visa.com'; - orderInformationBillTo.postalCode = '03055'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; requestObj.orderInformation = orderInformation; var travelInformation = new cybersourceRestApi.Riskv1decisionsTravelInformation(); + var month = dt.toLocaleString("default", { month: "2-digit" }); + var day = dt.toLocaleString("default", { day: "2-digit" }); + var depTime = dt.getFullYear()+'-'+month+'-'+day+' 11:30pm GMT'; travelInformation.completeRoute = 'SFO-JFK:JFK-BLR'; - travelInformation.departureTime = '2011-03-20 11:30pm GMT'; + travelInformation.departureTime = depTime; travelInformation.journeyType = 'One way'; var legs = new Array(); diff --git a/Samples/RiskManagement/DecisionManager/mark-as-suspect.js b/Samples/RiskManagement/DecisionManager/mark-as-suspect.js index 9459686..e4adf87 100644 --- a/Samples/RiskManagement/DecisionManager/mark-as-suspect.js +++ b/Samples/RiskManagement/DecisionManager/mark-as-suspect.js @@ -7,6 +7,7 @@ var configuration = require(filePath); function mark_as_suspect(callback) { try { + // Refresh id with an active value var id = "5825489395116729903003"; var configObject = new configuration(); var apiClient = new cybersourceRestApi.ApiClient(); diff --git a/Samples/RiskManagement/DecisionManager/remove-from-history.js b/Samples/RiskManagement/DecisionManager/remove-from-history.js index c203f74..bed4024 100644 --- a/Samples/RiskManagement/DecisionManager/remove-from-history.js +++ b/Samples/RiskManagement/DecisionManager/remove-from-history.js @@ -6,6 +6,7 @@ var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); function remove_from_history(callback) { + // Refresh id with an active value var id = "5825489395116729903003"; try { diff --git a/Samples/TokenManagement/Customer/create-customer.js b/Samples/TokenManagement/Customer/create-customer.js index 40d0a00..a401ae7 100644 --- a/Samples/TokenManagement/Customer/create-customer.js +++ b/Samples/TokenManagement/Customer/create-customer.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function create_customer(callback) { try { @@ -12,19 +13,19 @@ function create_customer(callback) { var requestObj = new cybersourceRestApi.PostCustomerRequest(); var buyerInformation = new cybersourceRestApi.Tmsv2customersBuyerInformation(); - buyerInformation.merchantCustomerID = 'Your customer identifier'; - buyerInformation.email = 'test@cybs.com'; + buyerInformation.merchantCustomerID = faker.string.ulid(); + buyerInformation.email = faker.internet.email(); requestObj.buyerInformation = buyerInformation; var clientReferenceInformation = new cybersourceRestApi.Tmsv2customersClientReferenceInformation(); - clientReferenceInformation.code = 'TC50171_3'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var merchantDefinedInformation = new Array(); var merchantDefinedInformation1 = new cybersourceRestApi.Tmsv2customersMerchantDefinedInformation(); merchantDefinedInformation1.name = 'data1'; - merchantDefinedInformation1.value = 'Your customer data'; + merchantDefinedInformation1.value = faker.company.catchPhrase(); merchantDefinedInformation.push(merchantDefinedInformation1); requestObj.merchantDefinedInformation = merchantDefinedInformation; diff --git a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-default-payment-instrument-card.js b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-default-payment-instrument-card.js index 19fb19c..7e3722c 100644 --- a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-default-payment-instrument-card.js +++ b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-default-payment-instrument-card.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function create_customer_default_payment_instrument_card(callback) { var customerTokenId = 'AB695DA801DD1BB6E05341588E0A3BDC'; @@ -14,22 +15,26 @@ function create_customer_default_payment_instrument_card(callback) { requestObj._default = true; var card = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; card.expirationMonth = '12'; - card.expirationYear = '2031'; + card.expirationYear = expYear; card.type = '001'; requestObj.card = card; var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); - billTo.firstName = 'John'; - billTo.lastName = 'Doe'; - billTo.company = 'CyberSource'; - billTo.address1 = '1 Market St'; - billTo.locality = 'San Francisco'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + billTo.firstName = fName; + billTo.lastName = lName; + billTo.company = faker.company.name(); + billTo.address1 = faker.location.streetAddress(); + billTo.locality = faker.location.city(); billTo.administrativeArea = 'CA'; - billTo.postalCode = '94105'; + billTo.postalCode = faker.location.zipCode(); billTo.country = 'US'; - billTo.email = 'test@cybs.com'; - billTo.phoneNumber = '4158880000'; + billTo.email = faker.internet.email({firstName:fName,lastName:lName}); + billTo.phoneNumber = faker.string.numeric(10); requestObj.billTo = billTo; var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); diff --git a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-non-default-payment-instrument-card.js b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-non-default-payment-instrument-card.js index 6f9d725..3e65e6d 100644 --- a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-non-default-payment-instrument-card.js +++ b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-non-default-payment-instrument-card.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function create_customer_non_default_payment_instrument_card(callback) { var customerTokenId = 'AB695DA801DD1BB6E05341588E0A3BDC'; @@ -14,22 +15,26 @@ function create_customer_non_default_payment_instrument_card(callback) { requestObj._default = false; var card = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; card.expirationMonth = '12'; - card.expirationYear = '2031'; + card.expirationYear = expYear; card.type = '001'; requestObj.card = card; var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); - billTo.firstName = 'John'; - billTo.lastName = 'Doe'; - billTo.company = 'CyberSource'; - billTo.address1 = '1 Market St'; - billTo.locality = 'San Francisco'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + billTo.firstName = fName; + billTo.lastName = lName; + billTo.company = faker.company.name(); + billTo.address1 = faker.location.streetAddress(); + billTo.locality = faker.location.city(); billTo.administrativeArea = 'CA'; - billTo.postalCode = '94105'; + billTo.postalCode = faker.location.zipCode(); billTo.country = 'US'; - billTo.email = 'test@cybs.com'; - billTo.phoneNumber = '4158880000'; + billTo.email = faker.internet.email({firstName:fName,lastName:lName}); + billTo.phoneNumber = faker.string.numeric(10); requestObj.billTo = billTo; var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); diff --git a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-bank-account.js b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-bank-account.js index d9298be..5d30b47 100644 --- a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-bank-account.js +++ b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-bank-account.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function create_customer_payment_instrument_bank_account(callback) { var customerTokenId = 'AB695DA801DD1BB6E05341588E0A3BDC'; @@ -36,16 +37,18 @@ function create_customer_payment_instrument_bank_account(callback) { requestObj.buyerInformation = buyerInformation; var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); - billTo.firstName = 'John'; - billTo.lastName = 'Doe'; - billTo.company = 'CyberSource'; - billTo.address1 = '1 Market St'; - billTo.locality = 'San Francisco'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + billTo.firstName = fName; + billTo.lastName = lName; + billTo.company = faker.company.name(); + billTo.address1 = faker.location.streetAddress(); + billTo.locality = faker.location.city(); billTo.administrativeArea = 'CA'; - billTo.postalCode = '94105'; + billTo.postalCode = faker.location.zipCode(); billTo.country = 'US'; - billTo.email = 'test@cybs.com'; - billTo.phoneNumber = '4158880000'; + billTo.email = faker.internet.email({firstName:fName,lastName:lName}); + billTo.phoneNumber = faker.string.numeric(10); requestObj.billTo = billTo; var processingInformation = new cybersourceRestApi.TmsPaymentInstrumentProcessingInfo(); diff --git a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-pinless-debit.js b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-pinless-debit.js index d76eaa9..719aa23 100644 --- a/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-pinless-debit.js +++ b/Samples/TokenManagement/CustomerPaymentInstrument/create-customer-payment-instrument-pinless-debit.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function create_customer_payment_instrument_pinless_debit(callback) { var customerTokenId = 'AB695DA801DD1BB6E05341588E0A3BDC'; @@ -13,8 +14,10 @@ function create_customer_payment_instrument_pinless_debit(callback) { var requestObj = new cybersourceRestApi.PostCustomerPaymentInstrumentRequest(); var card = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; card.expirationMonth = '12'; - card.expirationYear = '2031'; + card.expirationYear = expYear; card.type = '001'; card.issueNumber = '01'; card.startMonth = '01'; @@ -23,16 +26,18 @@ function create_customer_payment_instrument_pinless_debit(callback) { requestObj.card = card; var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); - billTo.firstName = 'John'; - billTo.lastName = 'Doe'; - billTo.company = 'CyberSource'; - billTo.address1 = '1 Market St'; - billTo.locality = 'San Francisco'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + billTo.firstName = fName; + billTo.lastName = lName; + billTo.company = faker.company.name(); + billTo.address1 = faker.location.streetAddress(); + billTo.locality = faker.location.city(); billTo.administrativeArea = 'CA'; - billTo.postalCode = '94105'; + billTo.postalCode = faker.location.zipCode(); billTo.country = 'US'; - billTo.email = 'test@cybs.com'; - billTo.phoneNumber = '4158880000'; + billTo.email = faker.internet.email({firstName:fName,lastName:lName}); + billTo.phoneNumber = faker.string.numeric(10); requestObj.billTo = billTo; var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); diff --git a/Samples/TokenManagement/CustomerShippingAddress/create-customer-default-shipping-address.js b/Samples/TokenManagement/CustomerShippingAddress/create-customer-default-shipping-address.js index 57625f0..f912530 100644 --- a/Samples/TokenManagement/CustomerShippingAddress/create-customer-default-shipping-address.js +++ b/Samples/TokenManagement/CustomerShippingAddress/create-customer-default-shipping-address.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function create_customer_default_shipping_address(callback) { var customerTokenId = 'AB695DA801DD1BB6E05341588E0A3BDC'; @@ -14,16 +15,18 @@ function create_customer_default_shipping_address(callback) { requestObj._default = true; var shipTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultShippingAddressShipTo(); - shipTo.firstName = 'John'; - shipTo.lastName = 'Doe'; - shipTo.company = 'CyberSource'; - shipTo.address1 = '1 Market St'; - shipTo.locality = 'San Francisco'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + shipTo.firstName = fName; + shipTo.lastName = lName; + shipTo.company = faker.company.name(); + shipTo.address1 = faker.location.streetAddress(); + shipTo.locality = faker.location.city(); shipTo.administrativeArea = 'CA'; - shipTo.postalCode = '94105'; + shipTo.postalCode = faker.location.zipCode(); shipTo.country = 'US'; - shipTo.email = 'test@cybs.com'; - shipTo.phoneNumber = '4158880000'; + shipTo.email = faker.internet.email({firstName:fName,lastName:lName}); + shipTo.phoneNumber = faker.string.numeric(10); requestObj.shipTo = shipTo; var opts = []; diff --git a/Samples/TokenManagement/CustomerShippingAddress/create-customer-non-default-shipping-address.js b/Samples/TokenManagement/CustomerShippingAddress/create-customer-non-default-shipping-address.js index bf22f9b..6c531c0 100644 --- a/Samples/TokenManagement/CustomerShippingAddress/create-customer-non-default-shipping-address.js +++ b/Samples/TokenManagement/CustomerShippingAddress/create-customer-non-default-shipping-address.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function create_customer_non_default_shipping_address(callback) { var customerTokenId = 'AB695DA801DD1BB6E05341588E0A3BDC'; @@ -14,16 +15,18 @@ function create_customer_non_default_shipping_address(callback) { requestObj._default = false; var shipTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultShippingAddressShipTo(); - shipTo.firstName = 'John'; - shipTo.lastName = 'Doe'; - shipTo.company = 'CyberSource'; - shipTo.address1 = '1 Market St'; - shipTo.locality = 'San Francisco'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + shipTo.firstName = fName; + shipTo.lastName = lName; + shipTo.company = faker.company.name(); + shipTo.address1 = faker.location.streetAddress(); + shipTo.locality = faker.location.city(); shipTo.administrativeArea = 'CA'; - shipTo.postalCode = '94105'; + shipTo.postalCode = faker.location.zipCode(); shipTo.country = 'US'; - shipTo.email = 'test@cybs.com'; - shipTo.phoneNumber = '4158880000'; + shipTo.email = faker.internet.email({firstName:fName,lastName:lName}); + shipTo.phoneNumber = faker.string.numeric(10); requestObj.shipTo = shipTo; var opts = []; diff --git a/Samples/TokenManagement/InstrumentIdentifier/create-instrument-identifier-bank-account.js b/Samples/TokenManagement/InstrumentIdentifier/create-instrument-identifier-bank-account.js index da5010f..664485e 100644 --- a/Samples/TokenManagement/InstrumentIdentifier/create-instrument-identifier-bank-account.js +++ b/Samples/TokenManagement/InstrumentIdentifier/create-instrument-identifier-bank-account.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function create_instrument_identifier_bank_account(callback) { var profileid = '93B32398-AD51-4CC2-A682-EA3E93614EB1'; @@ -14,8 +15,8 @@ function create_instrument_identifier_bank_account(callback) { var requestObj = new cybersourceRestApi.PostInstrumentIdentifierRequest(); var bankAccount = new cybersourceRestApi.TmsEmbeddedInstrumentIdentifierBankAccount(); - bankAccount.number = '4100'; - bankAccount.routingNumber = '071923284'; + bankAccount.number = faker.finance.accountNumber(9); + bankAccount.routingNumber = faker.finance.routingNumber(); requestObj.bankAccount = bankAccount; var opts = []; diff --git a/Samples/TokenManagement/InstrumentIdentifier/create-instrument-identifier-card-enroll-for-network-token.js b/Samples/TokenManagement/InstrumentIdentifier/create-instrument-identifier-card-enroll-for-network-token.js index a48af3c..b73ac0b 100644 --- a/Samples/TokenManagement/InstrumentIdentifier/create-instrument-identifier-card-enroll-for-network-token.js +++ b/Samples/TokenManagement/InstrumentIdentifier/create-instrument-identifier-card-enroll-for-network-token.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function create_instrument_identifier_card_enroll_for_network_token(callback) { var profileid = '93B32398-AD51-4CC2-A682-EA3E93614EB1'; @@ -15,17 +16,20 @@ function create_instrument_identifier_card_enroll_for_network_token(callback) { requestObj.type = 'enrollable card'; var card = new cybersourceRestApi.TmsEmbeddedInstrumentIdentifierCard(); - card.number = '4111111111111111'; + var dt = new Date(); + var expYear = dt.getFullYear()+4; + // test card specific to network token provisioning + card.number = '4622943123100662'; card.expirationMonth = '12'; - card.expirationYear = '2031'; + card.expirationYear = expYear; card.securityCode = '123'; requestObj.card = card; var billTo = new cybersourceRestApi.TmsEmbeddedInstrumentIdentifierBillTo(); - billTo.address1 = '1 Market St'; - billTo.locality = 'San Francisco'; + billTo.address1 = faker.location.streetAddress(); + billTo.locality = faker.location.city(); billTo.administrativeArea = 'CA'; - billTo.postalCode = '94105'; + billTo.postalCode = faker.location.zipCode(); billTo.country = 'US'; requestObj.billTo = billTo; diff --git a/Samples/TokenManagement/InstrumentIdentifier/create-instrument-identifier-card.js b/Samples/TokenManagement/InstrumentIdentifier/create-instrument-identifier-card.js index 04c181d..1e38059 100644 --- a/Samples/TokenManagement/InstrumentIdentifier/create-instrument-identifier-card.js +++ b/Samples/TokenManagement/InstrumentIdentifier/create-instrument-identifier-card.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function create_instrument_identifier_card(callback) { var profileid = '93B32398-AD51-4CC2-A682-EA3E93614EB1'; @@ -14,7 +15,7 @@ function create_instrument_identifier_card(callback) { var requestObj = new cybersourceRestApi.PostInstrumentIdentifierRequest(); var card = new cybersourceRestApi.TmsEmbeddedInstrumentIdentifierCard(); - card.number = '4111111111111111'; + card.number = faker.finance.creditCardNumber({issuer: '414720#########L'}); requestObj.card = card; var opts = []; diff --git a/Samples/TokenManagement/InstrumentIdentifier/enroll-instrument-identifier-for-network-tokenization.js b/Samples/TokenManagement/InstrumentIdentifier/enroll-instrument-identifier-for-network-tokenization.js index fcaf8c0..d3e7008 100644 --- a/Samples/TokenManagement/InstrumentIdentifier/enroll-instrument-identifier-for-network-tokenization.js +++ b/Samples/TokenManagement/InstrumentIdentifier/enroll-instrument-identifier-for-network-tokenization.js @@ -15,8 +15,10 @@ function enroll_instrument_identifier_for_network_tokenization(callback) { requestObj.type = 'enrollable card'; var card = new cybersourceRestApi.TmsEmbeddedInstrumentIdentifierCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; card.expirationMonth = '12'; - card.expirationYear = '2031'; + card.expirationYear = expYear; card.securityCode = '123'; requestObj.card = card; diff --git a/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-card.js b/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-card.js index dbdfdbe..3462d5a 100644 --- a/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-card.js +++ b/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-card.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function create_payment_instrument_card(callback) { var profileid = '93B32398-AD51-4CC2-A682-EA3E93614EB1'; @@ -14,22 +15,26 @@ function create_payment_instrument_card(callback) { var requestObj = new cybersourceRestApi.PostPaymentInstrumentRequest(); var card = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; card.expirationMonth = '12'; - card.expirationYear = '2031'; + card.expirationYear = expYear; card.type = 'visa'; requestObj.card = card; var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); - billTo.firstName = 'John'; - billTo.lastName = 'Doe'; - billTo.company = 'CyberSource'; - billTo.address1 = '1 Market St'; - billTo.locality = 'San Francisco'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + billTo.firstName = fName; + billTo.lastName = lName; + billTo.company = faker.company.name(); + billTo.address1 = faker.location.streetAddress(); + billTo.locality = faker.location.city(); billTo.administrativeArea = 'CA'; - billTo.postalCode = '94105'; + billTo.postalCode = faker.location.zipCode(); billTo.country = 'US'; - billTo.email = 'test@cybs.com'; - billTo.phoneNumber = '4158880000'; + billTo.email = faker.internet.email({firstName:fName,lastName:lName}); + billTo.phoneNumber = faker.string.numeric(10); requestObj.billTo = billTo; var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); diff --git a/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-pinless-debit.js b/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-pinless-debit.js index 2c7dab1..0e1dab7 100644 --- a/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-pinless-debit.js +++ b/Samples/TokenManagement/PaymentInstrument/create-payment-instrument-pinless-debit.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function create_payment_instrument_pinless_debit(callback) { var profileid = '93B32398-AD51-4CC2-A682-EA3E93614EB1'; @@ -14,8 +15,10 @@ function create_payment_instrument_pinless_debit(callback) { var requestObj = new cybersourceRestApi.PostPaymentInstrumentRequest(); var card = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentCard(); + var dt = new Date(); + var expYear = dt.getFullYear()+4; card.expirationMonth = '12'; - card.expirationYear = '2031'; + card.expirationYear = expYear; card.type = 'visa'; card.issueNumber = '01'; card.startMonth = '01'; @@ -24,16 +27,18 @@ function create_payment_instrument_pinless_debit(callback) { requestObj.card = card; var billTo = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentBillTo(); - billTo.firstName = 'John'; - billTo.lastName = 'Doe'; - billTo.company = 'CyberSource'; - billTo.address1 = '1 Market St'; - billTo.locality = 'San Francisco'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + billTo.firstName = fName; + billTo.lastName = lName; + billTo.company = faker.company.name(); + billTo.address1 = faker.location.streetAddress(); + billTo.locality = faker.location.city(); billTo.administrativeArea = 'CA'; - billTo.postalCode = '94105'; + billTo.postalCode = faker.location.zipCode(); billTo.country = 'US'; - billTo.email = 'test@cybs.com'; - billTo.phoneNumber = '4158880000'; + billTo.email = faker.internet.email({firstName:fName,lastName:lName}); + billTo.phoneNumber = faker.string.numeric(10); requestObj.billTo = billTo; var instrumentIdentifier = new cybersourceRestApi.Tmsv2customersEmbeddedDefaultPaymentInstrumentInstrumentIdentifier(); diff --git a/Samples/UnifiedCheckout/generate-unified-checkout-capture-context.js b/Samples/UnifiedCheckout/generate-unified-checkout-capture-context.js index 1f510e1..03139e1 100644 --- a/Samples/UnifiedCheckout/generate-unified-checkout-capture-context.js +++ b/Samples/UnifiedCheckout/generate-unified-checkout-capture-context.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function generate_unified_checkout_capture_context(callback) { try { @@ -23,7 +24,7 @@ function generate_unified_checkout_capture_context(callback) { var orderInformation = new cybersourceRestApi.Upv1capturecontextsOrderInformation(); var orderInformationAmountDetails = new cybersourceRestApi.Upv1capturecontextsOrderInformationAmountDetails(); - orderInformationAmountDetails.totalAmount = '50.00'; + orderInformationAmountDetails.totalAmount = faker.commerce.price({ min: 100, max: 500 }); orderInformationAmountDetails.currency = 'USD'; orderInformation.amountDetails = orderInformationAmountDetails; diff --git a/Samples/ValueAddedService/basic-tax-calculation-request.js b/Samples/ValueAddedService/basic-tax-calculation-request.js index 5f5c89f..28bb347 100644 --- a/Samples/ValueAddedService/basic-tax-calculation-request.js +++ b/Samples/ValueAddedService/basic-tax-calculation-request.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa } = require('@faker-js/faker'); function basic_tax_calculation_request(callback) { try { @@ -12,7 +13,7 @@ function basic_tax_calculation_request(callback) { var requestObj = new cybersourceRestApi.TaxRequest(); var clientReferenceInformation = new cybersourceRestApi.Vasv2taxClientReferenceInformation(); - clientReferenceInformation.code = 'TAX_TC001'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var taxInformation = new cybersourceRestApi.Vasv2taxTaxInformation(); @@ -25,37 +26,43 @@ function basic_tax_calculation_request(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Vasv2taxOrderInformationBillTo(); - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'San Francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; var lineItems = new Array(); var lineItems1 = new cybersourceRestApi.Vasv2taxOrderInformationLineItems(); - lineItems1.productSKU = '07-12-00657'; - lineItems1.productCode = '50161815'; + lineItems1.productSKU = faker.commerce.isbn(10); + lineItems1.productCode = faker.commerce.department(); lineItems1.quantity = 1; - lineItems1.productName = 'Chewing Gum'; - lineItems1.unitPrice = '1200'; + lineItems1.productName = faker.commerce.productName(); + lineItems1.unitPrice = faker.commerce.price({ min: 100, max: 1200 }); lineItems.push(lineItems1); var lineItems2 = new cybersourceRestApi.Vasv2taxOrderInformationLineItems(); - lineItems2.productSKU = '07-12-00659'; - lineItems2.productCode = '50181905'; - lineItems2.quantity = 1; - lineItems2.productName = 'Sugar Cookies'; - lineItems2.unitPrice = '1240'; + lineItems2.productSKU = faker.commerce.isbn(10); + lineItems2.productCode = faker.commerce.department(); + lineItems2.quantity = 1;5 + lineItems2.productName = faker.commerce.productName(); + lineItems2.unitPrice = faker.commerce.price({ min: 100, max: 1200 }); lineItems.push(lineItems2); var lineItems3 = new cybersourceRestApi.Vasv2taxOrderInformationLineItems(); - lineItems3.productSKU = '07-12-00658'; - lineItems3.productCode = '5020.11'; + lineItems3.productSKU = faker.commerce.isbn(10); + lineItems3.productCode = faker.commerce.department(); lineItems3.quantity = 1; - lineItems3.productName = 'Carbonated Water'; - lineItems3.unitPrice = '9001'; + lineItems3.productName = faker.commerce.productName(); + lineItems3.unitPrice = faker.commerce.price({ min: 100, max: 1200 }); lineItems.push(lineItems3); orderInformation.lineItems = lineItems; diff --git a/Samples/ValueAddedService/committed-tax-call-request.js b/Samples/ValueAddedService/committed-tax-call-request.js index cf5bb2d..75b7ff2 100644 --- a/Samples/ValueAddedService/committed-tax-call-request.js +++ b/Samples/ValueAddedService/committed-tax-call-request.js @@ -4,7 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); - +const { faker, fa, fakerEN_CA } = require('@faker-js/faker'); function committed_tax_call_request(callback) { try { var configObject = new configuration(); @@ -12,7 +12,7 @@ function committed_tax_call_request(callback) { var requestObj = new cybersourceRestApi.TaxRequest(); var clientReferenceInformation = new cybersourceRestApi.Vasv2taxClientReferenceInformation(); - clientReferenceInformation.code = 'TAX_TC001'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var taxInformation = new cybersourceRestApi.Vasv2taxTaxInformation(); @@ -26,52 +26,57 @@ function committed_tax_call_request(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Vasv2taxOrderInformationBillTo(); - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'San Francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; var orderInformationShippingDetails = new cybersourceRestApi.Vasv2taxOrderInformationShippingDetails(); - orderInformationShippingDetails.shipFromLocality = 'Cambridge Bay'; + orderInformationShippingDetails.shipFromLocality = faker.location.streetAddress(); orderInformationShippingDetails.shipFromCountry = 'CA'; - orderInformationShippingDetails.shipFromPostalCode = 'A0G 1T0'; - orderInformationShippingDetails.shipFromAdministrativeArea = 'NL'; + orderInformationShippingDetails.shipFromPostalCode = fakerEN_CA.location.zipCode(); + orderInformationShippingDetails.shipFromAdministrativeArea = fakerEN_CA.location.state(); orderInformation.shippingDetails = orderInformationShippingDetails; var orderInformationShipTo = new cybersourceRestApi.Vasv2taxOrderInformationShipTo(); orderInformationShipTo.country = 'US'; - orderInformationShipTo.administrativeArea = 'FL'; - orderInformationShipTo.locality = 'Panama City'; - orderInformationShipTo.postalCode = '32401'; - orderInformationShipTo.address1 = '123 Russel St.'; + orderInformationShipTo.administrativeArea = faker.location.state(); + orderInformationShipTo.locality = faker.location.city(); + orderInformationShipTo.postalCode = faker.location.zipCode(); + orderInformationShipTo.address1 = faker.location.streetAddress(); orderInformation.shipTo = orderInformationShipTo; - var lineItems = new Array(); var lineItems1 = new cybersourceRestApi.Vasv2taxOrderInformationLineItems(); - lineItems1.productSKU = '07-12-00657'; - lineItems1.productCode = '50161815'; + lineItems1.productSKU = faker.commerce.isbn(10); + lineItems1.productCode = faker.commerce.department(); lineItems1.quantity = 1; - lineItems1.productName = 'Chewing Gum'; - lineItems1.unitPrice = '1200'; + lineItems1.productName = faker.commerce.productName(); + lineItems1.unitPrice = faker.commerce.price({ min: 100, max: 1200 }); lineItems.push(lineItems1); var lineItems2 = new cybersourceRestApi.Vasv2taxOrderInformationLineItems(); - lineItems2.productSKU = '07-12-00659'; - lineItems2.productCode = '50181905'; - lineItems2.quantity = 1; - lineItems2.productName = 'Sugar Cookies'; - lineItems2.unitPrice = '1240'; + lineItems2.productSKU = faker.commerce.isbn(10); + lineItems2.productCode = faker.commerce.department(); + lineItems2.quantity = 1;5 + lineItems2.productName = faker.commerce.productName(); + lineItems2.unitPrice = faker.commerce.price({ min: 100, max: 1200 }); lineItems.push(lineItems2); var lineItems3 = new cybersourceRestApi.Vasv2taxOrderInformationLineItems(); - lineItems3.productSKU = '07-12-00658'; - lineItems3.productCode = '5020.11'; + lineItems3.productSKU = faker.commerce.isbn(10); + lineItems3.productCode = faker.commerce.department(); lineItems3.quantity = 1; - lineItems3.productName = 'Carbonated Water'; - lineItems3.unitPrice = '9001'; + lineItems3.productName = faker.commerce.productName(); + lineItems3.unitPrice = faker.commerce.price({ min: 100, max: 1200 }); lineItems.push(lineItems3); orderInformation.lineItems = lineItems; diff --git a/Samples/ValueAddedService/committed-tax-refund-call-request.js b/Samples/ValueAddedService/committed-tax-refund-call-request.js index b0869c2..ab485bf 100644 --- a/Samples/ValueAddedService/committed-tax-refund-call-request.js +++ b/Samples/ValueAddedService/committed-tax-refund-call-request.js @@ -4,6 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); +const { faker, fa, fakerEN_CA } = require('@faker-js/faker'); function committed_tax_refund_call_request(callback) { try { @@ -12,7 +13,7 @@ function committed_tax_refund_call_request(callback) { var requestObj = new cybersourceRestApi.TaxRequest(); var clientReferenceInformation = new cybersourceRestApi.Vasv2taxClientReferenceInformation(); - clientReferenceInformation.code = 'TAX_TC001'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var taxInformation = new cybersourceRestApi.Vasv2taxTaxInformation(); @@ -27,52 +28,57 @@ function committed_tax_refund_call_request(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Vasv2taxOrderInformationBillTo(); - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'San Francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; var orderInformationShippingDetails = new cybersourceRestApi.Vasv2taxOrderInformationShippingDetails(); - orderInformationShippingDetails.shipFromLocality = 'Cambridge Bay'; + orderInformationShippingDetails.shipFromLocality = faker.location.streetAddress(); orderInformationShippingDetails.shipFromCountry = 'CA'; - orderInformationShippingDetails.shipFromPostalCode = 'A0G 1T0'; - orderInformationShippingDetails.shipFromAdministrativeArea = 'NL'; + orderInformationShippingDetails.shipFromPostalCode = fakerEN_CA.location.zipCode(); + orderInformationShippingDetails.shipFromAdministrativeArea = fakerEN_CA.location.state(); orderInformation.shippingDetails = orderInformationShippingDetails; var orderInformationShipTo = new cybersourceRestApi.Vasv2taxOrderInformationShipTo(); orderInformationShipTo.country = 'US'; - orderInformationShipTo.administrativeArea = 'FL'; - orderInformationShipTo.locality = 'Panama City'; - orderInformationShipTo.postalCode = '32401'; - orderInformationShipTo.address1 = '123 Russel St.'; + orderInformationShipTo.administrativeArea = faker.location.state(); + orderInformationShipTo.locality = faker.location.city(); + orderInformationShipTo.postalCode = faker.location.zipCode(); + orderInformationShipTo.address1 = faker.location.streetAddress(); orderInformation.shipTo = orderInformationShipTo; - var lineItems = new Array(); var lineItems1 = new cybersourceRestApi.Vasv2taxOrderInformationLineItems(); - lineItems1.productSKU = '07-12-00657'; - lineItems1.productCode = '50161815'; + lineItems1.productSKU = faker.commerce.isbn(10); + lineItems1.productCode = faker.commerce.department(); lineItems1.quantity = 1; - lineItems1.productName = 'Chewing Gum'; - lineItems1.unitPrice = '1200'; + lineItems1.productName = faker.commerce.productName(); + lineItems1.unitPrice = faker.commerce.price({ min: 100, max: 1200 }); lineItems.push(lineItems1); var lineItems2 = new cybersourceRestApi.Vasv2taxOrderInformationLineItems(); - lineItems2.productSKU = '07-12-00659'; - lineItems2.productCode = '50181905'; - lineItems2.quantity = 1; - lineItems2.productName = 'Sugar Cookies'; - lineItems2.unitPrice = '1240'; + lineItems2.productSKU = faker.commerce.isbn(10); + lineItems2.productCode = faker.commerce.department(); + lineItems2.quantity = 1;5 + lineItems2.productName = faker.commerce.productName(); + lineItems2.unitPrice = faker.commerce.price({ min: 100, max: 1200 }); lineItems.push(lineItems2); var lineItems3 = new cybersourceRestApi.Vasv2taxOrderInformationLineItems(); - lineItems3.productSKU = '07-12-00658'; - lineItems3.productCode = '5020.11'; + lineItems3.productSKU = faker.commerce.isbn(10); + lineItems3.productCode = faker.commerce.department(); lineItems3.quantity = 1; - lineItems3.productName = 'Carbonated Water'; - lineItems3.unitPrice = '9001'; + lineItems3.productName = faker.commerce.productName(); + lineItems3.unitPrice = faker.commerce.price({ min: 100, max: 1200 }); lineItems.push(lineItems3); orderInformation.lineItems = lineItems; diff --git a/Samples/ValueAddedService/tax-refund-request.js b/Samples/ValueAddedService/tax-refund-request.js index 95f507e..e451e92 100644 --- a/Samples/ValueAddedService/tax-refund-request.js +++ b/Samples/ValueAddedService/tax-refund-request.js @@ -4,7 +4,7 @@ var cybersourceRestApi = require('cybersource-rest-client'); var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); - +const { faker, fa, fakerEN_CA } = require('@faker-js/faker'); function tax_refund_request(callback) { try { var configObject = new configuration(); @@ -12,7 +12,7 @@ function tax_refund_request(callback) { var requestObj = new cybersourceRestApi.TaxRequest(); var clientReferenceInformation = new cybersourceRestApi.Vasv2taxClientReferenceInformation(); - clientReferenceInformation.code = 'TAX_TC001'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var taxInformation = new cybersourceRestApi.Vasv2taxTaxInformation(); @@ -26,52 +26,57 @@ function tax_refund_request(callback) { orderInformation.amountDetails = orderInformationAmountDetails; var orderInformationBillTo = new cybersourceRestApi.Vasv2taxOrderInformationBillTo(); - orderInformationBillTo.address1 = '1 Market St'; - orderInformationBillTo.locality = 'San Francisco'; - orderInformationBillTo.administrativeArea = 'CA'; - orderInformationBillTo.postalCode = '94105'; + var fName = faker.person.firstName(); + var lName = faker.person.lastName(); + orderInformationBillTo.firstName = fName; + orderInformationBillTo.lastName = lName; + orderInformationBillTo.address1 = faker.location.streetAddress(); + orderInformationBillTo.locality = faker.location.city(); + orderInformationBillTo.administrativeArea = faker.location.state(); + orderInformationBillTo.postalCode = faker.location.zipCode(); orderInformationBillTo.country = 'US'; + orderInformationBillTo.email = faker.internet.email({firstName:fName,lastName:lName}); + orderInformationBillTo.phoneNumber = faker.string.numeric(10); orderInformation.billTo = orderInformationBillTo; var orderInformationShippingDetails = new cybersourceRestApi.Vasv2taxOrderInformationShippingDetails(); - orderInformationShippingDetails.shipFromLocality = 'Cambridge Bay'; + orderInformationShippingDetails.shipFromLocality = faker.location.streetAddress(); orderInformationShippingDetails.shipFromCountry = 'CA'; - orderInformationShippingDetails.shipFromPostalCode = 'A0G 1T0'; - orderInformationShippingDetails.shipFromAdministrativeArea = 'NL'; + orderInformationShippingDetails.shipFromPostalCode = fakerEN_CA.location.zipCode(); + orderInformationShippingDetails.shipFromAdministrativeArea = fakerEN_CA.location.state(); orderInformation.shippingDetails = orderInformationShippingDetails; var orderInformationShipTo = new cybersourceRestApi.Vasv2taxOrderInformationShipTo(); orderInformationShipTo.country = 'US'; - orderInformationShipTo.administrativeArea = 'FL'; - orderInformationShipTo.locality = 'Panama City'; - orderInformationShipTo.postalCode = '32401'; - orderInformationShipTo.address1 = '123 Russel St.'; + orderInformationShipTo.administrativeArea = faker.location.state(); + orderInformationShipTo.locality = faker.location.city(); + orderInformationShipTo.postalCode = faker.location.zipCode(); + orderInformationShipTo.address1 = faker.location.streetAddress(); orderInformation.shipTo = orderInformationShipTo; - var lineItems = new Array(); var lineItems1 = new cybersourceRestApi.Vasv2taxOrderInformationLineItems(); - lineItems1.productSKU = '07-12-00657'; - lineItems1.productCode = '50161815'; + lineItems1.productSKU = faker.commerce.isbn(10); + lineItems1.productCode = faker.commerce.department(); lineItems1.quantity = 1; - lineItems1.productName = 'Chewing Gum'; - lineItems1.unitPrice = '1200'; + lineItems1.productName = faker.commerce.productName(); + lineItems1.unitPrice = faker.commerce.price({ min: 100, max: 1200 }); lineItems.push(lineItems1); var lineItems2 = new cybersourceRestApi.Vasv2taxOrderInformationLineItems(); - lineItems2.productSKU = '07-12-00659'; - lineItems2.productCode = '50181905'; - lineItems2.quantity = 1; - lineItems2.productName = 'Sugar Cookies'; - lineItems2.unitPrice = '1240'; + lineItems2.productSKU = faker.commerce.isbn(10); + lineItems2.productCode = faker.commerce.department(); + lineItems2.quantity = 1;5 + lineItems2.productName = faker.commerce.productName(); + lineItems2.unitPrice = faker.commerce.price({ min: 100, max: 1200 }); lineItems.push(lineItems2); var lineItems3 = new cybersourceRestApi.Vasv2taxOrderInformationLineItems(); - lineItems3.productSKU = '07-12-00658'; - lineItems3.productCode = '5020.11'; + lineItems3.productSKU = faker.commerce.isbn(10); + lineItems3.productCode = faker.commerce.department(); lineItems3.quantity = 1; - lineItems3.productName = 'Carbonated Water'; - lineItems3.unitPrice = '9001'; + lineItems3.productName = faker.commerce.productName(); + lineItems3.unitPrice = faker.commerce.price({ min: 100, max: 1200 }); lineItems.push(lineItems3); orderInformation.lineItems = lineItems; diff --git a/Samples/ValueAddedService/void-committed-tax-call.js b/Samples/ValueAddedService/void-committed-tax-call.js index 60551da..c645bc4 100644 --- a/Samples/ValueAddedService/void-committed-tax-call.js +++ b/Samples/ValueAddedService/void-committed-tax-call.js @@ -5,7 +5,7 @@ var path = require('path'); var filePath = path.resolve('Data/Configuration.js'); var configuration = require(filePath); var committedTaxCallRequest = require('./committed-tax-call-request'); - +const { faker, fa } = require('@faker-js/faker'); function void_committed_tax_call(callback) { try { var configObject = new configuration(); @@ -13,7 +13,7 @@ function void_committed_tax_call(callback) { var requestObj = new cybersourceRestApi.VoidTaxRequest(); var clientReferenceInformation = new cybersourceRestApi.Vasv2taxidClientReferenceInformation(); - clientReferenceInformation.code = 'TAX_TC001'; + clientReferenceInformation.code = faker.string.uuid(); requestObj.clientReferenceInformation = clientReferenceInformation; var instance = new cybersourceRestApi.TaxesApi(configObject, apiClient); diff --git a/log/.908b0ba45c6af1b0d67ab0e4918966dae7ee1ee9-audit.json b/log/.908b0ba45c6af1b0d67ab0e4918966dae7ee1ee9-audit.json new file mode 100644 index 0000000..6b6c122 --- /dev/null +++ b/log/.908b0ba45c6af1b0d67ab0e4918966dae7ee1ee9-audit.json @@ -0,0 +1,25 @@ +{ + "keep": { + "days": true, + "amount": 10 + }, + "auditLog": "log/.908b0ba45c6af1b0d67ab0e4918966dae7ee1ee9-audit.json", + "files": [ + { + "date": 1736724519770, + "name": "log/cybs-2025-01-12.log", + "hash": "3f8de8d3b68b090e18e141623060ebdfdd5a5d0e09013d2bb88edb8525d99361" + }, + { + "date": 1736792578505, + "name": "log/cybs-2025-01-13.log", + "hash": "c6c157cdd6decb18014f9041033c5f65c106bec3049b6c6607283de08064a6d2" + }, + { + "date": 1736868087713, + "name": "log/cybs-2025-01-14.log", + "hash": "1cbf931bc58ca22978716844609675b74640fa5b1774e6dbd63eef146f9ffad1" + } + ], + "hashType": "sha256" +} \ No newline at end of file diff --git a/log/.b2cd0d48a6b8c94130b5eae2bd6063284e95d74e-audit.json b/log/.b2cd0d48a6b8c94130b5eae2bd6063284e95d74e-audit.json new file mode 100644 index 0000000..f0c8b26 --- /dev/null +++ b/log/.b2cd0d48a6b8c94130b5eae2bd6063284e95d74e-audit.json @@ -0,0 +1,15 @@ +{ + "keep": { + "days": true, + "amount": 10 + }, + "auditLog": "log/.b2cd0d48a6b8c94130b5eae2bd6063284e95d74e-audit.json", + "files": [ + { + "date": 1736724229793, + "name": "log/cybs-2025-01-12.log", + "hash": "0f86b879de64093f392de257b0953cb91d6f35a85481e96fd39e26d1fb6b826f" + } + ], + "hashType": "sha256" +} \ No newline at end of file From 39370e85fc9f5462e5273993b49f89740b61f28a Mon Sep 17 00:00:00 2001 From: gnongsie Date: Wed, 7 May 2025 11:21:47 +0530 Subject: [PATCH 3/5] Added disclaimer --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 643265d..4d167d5 100644 --- a/README.md +++ b/README.md @@ -141,3 +141,7 @@ with the following code: // For PRODUCTION use const RunEnvironment = "api.cybersource.com"; ``` + +## Disclaimer + +Cybersource may allow Customer to access, use, and/or test a Cybersource product or service that may still be in development or has not been market-tested (“Beta Product”) solely for the purpose of evaluating the functionality or marketability of the Beta Product (a “Beta Evaluation”). Notwithstanding any language to the contrary, the following terms shall apply with respect to Customer’s participation in any Beta Evaluation (and the Beta Product(s)) accessed thereunder): The Parties will enter into a separate form agreement detailing the scope of the Beta Evaluation, requirements, pricing, the length of the beta evaluation period (“Beta Product Form”). Beta Products are not, and may not become, Transaction Services and have not yet been publicly released and are offered for the sole purpose of internal testing and non-commercial evaluation. Customer’s use of the Beta Product shall be solely for the purpose of conducting the Beta Evaluation. Customer accepts all risks arising out of the access and use of the Beta Products. Cybersource may, in its sole discretion, at any time, terminate or discontinue the Beta Evaluation. Customer acknowledges and agrees that any Beta Product may still be in development and that Beta Product is provided “AS IS” and may not perform at the level of a commercially available service, may not operate as expected and may be modified prior to release. CYBERSOURCE SHALL NOT BE RESPONSIBLE OR LIABLE UNDER ANY CONTRACT, TORT (INCLUDING NEGLIGENCE), OR OTHERWISE RELATING TO A BETA PRODUCT OR THE BETA EVALUATION (A) FOR LOSS OR INACCURACY OF DATA OR COST OF PROCUREMENT OF SUBSTITUTE GOODS, SERVICES OR TECHNOLOGY, (B) ANY CLAIM, LOSSES, DAMAGES, OR CAUSE OF ACTION ARISING IN CONNECTION WITH THE BETA PRODUCT; OR (C) FOR ANY INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOSS OF REVENUES AND LOSS OF PROFITS. From 5865adfbbcf17f2d0d42beb1e4c1b99a9f9a569b Mon Sep 17 00:00:00 2001 From: gnongsie Date: Thu, 8 May 2025 11:18:13 +0530 Subject: [PATCH 4/5] Replaced license with appropriate document --- LICENSE | 21 -------------------- license.txt | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 21 deletions(-) delete mode 100644 LICENSE create mode 100644 license.txt diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 73ea250..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 CyberSource - -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/license.txt b/license.txt new file mode 100644 index 0000000..f264cdf --- /dev/null +++ b/license.txt @@ -0,0 +1,57 @@ + +CyberSource Software Development Kit (SDK) License Agreement +v. July 9, 2014 + +1 +SDK LICENSE AGREEMENT + +This Software Development Kit (“SDK”) License Agreement (“Agreement”) is between you (both the individual downloading the SDK and any legal entity on behalf of which such individual is acting) (“You” or “Your”) and CyberSource Corporation (“CyberSource’). +IT IS IMPORTANT THAT YOU READ CAREFULLY AND UNDERSTAND THIS AGREEMENT. BY CLICKING THE “I ACCEPT” BUTTON OR AN EQUIVALENT INDICATOR OR BY DOWNLOADING, INSTALLING OR USING THE SDK OR THE DOCUMENTATION, YOU AGREE TO BE BOUND BY THIS AGREEMENT. IF YOU DO NOT AGREE TO BE BOUND BY THIS AGREEMENT, YOU WILL NOT BE PERMITTED TO (AND YOU WILL HAVE NO RIGHT TO) DOWNLOAD, INSTALL OR USE THE SDK OR THE DOCUMENTATION. +1. DEFINITIONS +1.1 “Application(s)” means software programs that You develop to operate with the Gateway using components of the Software. +1.2 “Documentation” means the materials made available to You in connection with the Software by or on behalf of CyberSource pursuant to this Agreement. +1.3 “Gateway” means any electronic payment platform maintained and operated by CyberSource and any of its affiliates. +1.4 “Software” means all of the software included in the software development kit made available to You by or on behalf of CyberSource pursuant to this Agreement, including but not limited to sample source code, code snippets, software tools, code libraries, sample applications, Documentation and any upgrades, modified versions, updates, and/or additions thereto, if any, made available to You by or on behalf of CyberSource pursuant to this Agreement. +2. GRANT OF LICENSE; RESTRICTIONS +2.1 Limited License. Subject to and conditioned upon Your compliance with the terms of this Agreement, CyberSource hereby grants to You a limited, revocable, non-exclusive, non-transferable, royalty-free license during the term of this Agreement to: (a) in any country worldwide, use, reproduce, modify, and create derivative works of the components of the Software solely for the purpose of developing, testing and manufacturing Applications; (b) distribute, sell or otherwise provide Your Applications that include components of the Software to Your end users in all countries worldwide; and (c) use the Documentation in connection with the foregoing activities. The license to distribute Applications that include components of the Software as set forth in subsection (b) above includes the right to grant sublicenses to Your end users to use such components of the Software as incorporated into such Applications, subject to the limitations and restrictions set forth in this Agreement. +2.2 Restrictions. You shall not (and shall have no right to): (a) make or distribute copies of the Software or the Documentation, in whole or in part, except as expressly permitted pursuant to Section 2.1; (b) alter or remove any copyright, trademark, trade name or other proprietary notices, legends, symbols or labels appearing on or in the Software or Documentation; (c) sublicense (or purport to sublicense) the Software or the Documentation, in whole or in part, to any third party except as expressly permitted pursuant to Section 2.1; (d) engage in any activity with the Software, including the development or distribution of an Application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the Gateway or platform, servers, or systems of CyberSource, any of its affiliates, or any third party; (e) make any statements that Your Application is “certified” or otherwise endorsed, or that its performance is guaranteed, by CyberSource or any of its affiliates; or (f) otherwise use or exploit the Software or the Documentation for any purpose other than to develop and distribute Applications as expressly permitted by this Agreement. +2.3 Ownership. You shall retain ownership of Your Applications developed in accordance with this Agreement, subject to CyberSource’s ownership of the Software and Documentation (including CyberSource’s ownership of any portion of the Software or Documentation incorporated in Your Applications). You acknowledge and agree that all right, title and interest in and to the Software and Documentation shall, at all times, be and remain the exclusive property of CyberSource and that You do not have or acquire any rights, express or implied, in the Software or Documentation except those rights expressly granted under this Agreement. +2.4 No Support. CyberSource has no obligation to provide support, maintenance, upgrades, modifications or new releases of the Software. +2.5 Open Source Software. You hereby acknowledge that the Software may contain software that is distributed under “open source” +license terms (“Open Source Software”). You shall review the Documentation in order to determine which portions of the Software are Open Source Software and are licensed under such Open Source Software license terms. To the extent any such license requires that CyberSource provide You any rights with respect to such Open Source Software that are inconsistent with the limited rights granted to You in this Agreement, then such rights in the applicable Open Source Software license shall take precedence over the rights and restrictions granted in this Agreement, but solely with respect to such Open Source Software. You acknowledge that the Open Source Software license is solely between You and the applicable licensor of the Open Source Software and that Your use, reproduction and distribution of Open Source Software shall be in compliance with applicable Open Source Software license. You understand and agree that CyberSource is not liable for any loss or damage that You may experience as a result of Your use of Open Source Software and that You will look solely to the licensor of the Open Source Software in the event of any such loss or damage. +2.6 License to CyberSource. In the event You choose to submit any suggestions, feedback or other information or materials related to the Software or Documentation or Your use thereof (collectively, “Feedback”) to CyberSource, You hereby grant to CyberSource a worldwide, non-exclusive, royalty-free, transferable, sublicensable, perpetual and irrevocable license to use and otherwise exploit such Feedback in connection with the Software, Documentation, and other products and services. +2.7 Use. +(a) You represent, warrant and agree to use the Software and write Applications only for purposes permitted by (i) this Agreement; (ii) applicable law and regulation, including, without limitation, the Payment Card Industry Data Security Standard (PCI DSS); and (iii) generally accepted practices or guidelines in the relevant jurisdictions. +(b) You represent, warrant and agree that if You use the Software to develop Applications for general public end users, that You will protect the privacy and legal rights of those users. If the Application receives or stores personal or sensitive information provided by end users, it must do so securely and in compliance with all applicable laws and regulations, including card association regulations. If the Application receives CyberSource account information, the Application may only use that information to access the end user's CyberSource account. +(c) You represent, warrant and agree that You are solely responsible for (and that neither CyberSource nor its affiliates have any responsibility to You or to any third party for): (i) any data, content, or resources that You obtain, transmit or display through the Application; and (ii) any breach of Your obligations under this Agreement, any applicable third party license, or any applicable law or regulation, and for the consequences of any such breach. +3. WARRANTY DISCLAIMER; LIMITATION OF LIABILITY +3.1 Disclaimer. THE SOFTWARE AND THE DOCUMENTATION ARE PROVIDED ON AN “AS IS” AND “AS AVAILABLE” BASIS WITH NO WARRANTY. YOU AGREE THAT YOUR USE OF THE SOFTWARE AND THE DOCUMENTATION IS AT YOUR SOLE RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. TO THE FULLEST EXTENT PERMISSIBLE UNDER APPLICABLE LAW, CYBERSOURCE AND ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, WITH RESPECT TO THE SOFTWARE AND THE DOCUMENTATION, INCLUDING ALL WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, SATISFACTORY QUALITY, ACCURACY, TITLE AND NON-INFRINGEMENT, AND ANY +CyberSource Software Development Kit (SDK) License Agreement +v. July 9, 2014 + +2 +WARRANTIES THAT MAY ARISE OUT OF COURSE OF PERFORMANCE, COURSE OF DEALING OR USAGE OF TRADE. NEITHER CYBERSOURCE NOR ITS AFFILIATES WARRANT THAT THE FUNCTIONS OR INFORMATION CONTAINED IN THE SOFTWARE OR THE DOCUMENTATION WILL MEET ANY REQUIREMENTS OR NEEDS YOU MAY HAVE, OR THAT THE SOFTWARE OR DOCUMENTATION WILL OPERATE ERROR FREE, OR THAT THE SOFTWARE OR DOCUMENTATION IS COMPATIBLE WITH ANY PARTICULAR OPERATING SYSTEM. +3.2 Limitation of Liability. IN NO EVENT SHALL CYBERSOURCE AND ITS AFFILIATES BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR PUNITIVE DAMAGES, OR DAMAGES FOR LOSS OF PROFITS, REVENUE, BUSINESS, SAVINGS, DATA, USE OR COST OF SUBSTITUTE PROCUREMENT, INCURRED BY YOU OR ANY THIRD PARTY, WHETHER IN AN ACTION IN CONTRACT OR TORT, EVEN IF CYBERSOURCE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES OR IF SUCH DAMAGES ARE FORESEEABLE. IN NO EVENT SHALL THE ENTIRE LIABILITY OF CYBERSOURCE AND AFFILIATES ARISING FROM OR RELATING TO THIS AGREEMENT OR THE SUBJECT MATTER HEREOF EXCEED ONE HUNDRED U.S. DOLLARS ($100). THE PARTIES ACKNOWLEDGE THAT THE LIMITATIONS OF LIABILITY IN THIS SECTION 3.2 AND IN THE OTHER PROVISIONS OF THIS AGREEMENT AND THE ALLOCATION OF RISK HEREIN ARE AN ESSENTIAL ELEMENT OF THE BARGAIN BETWEEN THE PARTIES, WITHOUT WHICH CYBERSOURCE WOULD NOT HAVE ENTERED INTO THIS AGREEMENT. +4. INDEMNIFICATION +You shall indemnify, hold harmless and, at CyberSource’s request, defend CyberSource and its affiliates and their officers, directors, employees, and agents from and against any claim, suit or proceeding, and any associated liabilities, costs, damages and expenses, including reasonable attorneys’ fees, that arise out of relate to: (i) Your Applications or the use or distribution thereof and Your use or distribution of the Software or the Documentation (or any portion thereof including Open Source Software), including, but not limited to, any allegation that any such Application or any such use or distribution infringes, misappropriates or otherwise violates any intellectual property (including, without limitation, copyright, patent, and trademark), privacy, publicity or other rights of any third party, or has caused the death or injury of any person or damage to any property; (ii) Your alleged or actual breach of this Agreement; (iii) the alleged or actual breach of this Agreement by any party to whom you have provided Your Applications, the Software or the Documentation or (iii) Your alleged or actual violation of or non-compliance with any applicable laws, legislation, policies, rules, regulations or governmental requirements (including, without limitation, any laws, legislation, policies, rules, regulations or governmental requirements related to privacy and data collection). +5. TERMINATION +This Agreement and the licenses granted to you herein are effective until terminated. CyberSource may terminate this Agreement and the licenses granted to You at any time. Upon termination of this Agreement, You shall cease all use of the Software and the Documentation, return to CyberSource or destroy all copies of the Software and Documentation and related materials in Your possession, and so certify to CyberSource. Except for the license to You granted herein, the terms of this Agreement shall survive termination. +6. CONFIDENTIAL INFORMATION +a. You hereby agree (i) to hold CyberSource’s Confidential Information in strict confidence and to take reasonable precautions to protect such Confidential Information (including, without limitation, all precautions You employ with respect to Your own confidential materials), (ii) not to divulge any such Confidential Information to any third person; (iii) not to make any use whatsoever at any time of such Confidential Information except as strictly licensed hereunder, (iv) not to remove or export from the United States or re-export any such Confidential Information or any direct product thereof, except in compliance with, and with all licenses and approvals required under applicable U.S. and foreign export laws and regulations, including, without limitation, those of the U.S. Department of Commerce. +b. “Confidential Information” shall mean any data or information, oral or written, treated as confidential that relates to CyberSource’s past, present, or future research, development or business activities, including without limitation any unannounced products and services, any information relating to services, developments, inventions, processes, plans, financial information, customer data, revenue, transaction volume, forecasts, projections, application programming interfaces, Software and Documentation. +7. General Terms +7.1 Law. This Agreement and all matters arising out of or relating to this Agreement shall be governed by the internal laws of the State of California without giving effect to any choice of law rule. This Agreement shall not be governed by the United Nations Convention on Contracts for the International Sales of Goods, the application of which is expressly excluded. In the event of any controversy, claim or dispute between the parties arising out of or relating to this Agreement, such controversy, claim or dispute shall be resolved in the state or federal courts in Santa Clara County, California, and the parties hereby irrevocably consent to the jurisdiction and venue of such courts. +7.2 Logo License. CyberSource hereby grants to You the right to use, reproduce, publish, perform and display CyberSource logo solely in accordance with the current CyberSource brand guidelines. +7.3 Severability and Waiver. If any provision of this Agreement is held to be illegal, invalid or otherwise unenforceable, such provision shall be enforced to the extent possible consistent with the stated intention of the parties, or, if incapable of such enforcement, shall be deemed to be severed and deleted from this Agreement, while the remainder of this Agreement shall continue in full force and effect. The waiver by either party of any default or breach of this Agreement shall not constitute a waiver of any other or subsequent default or breach. +7.4 No Assignment. You may not assign, sell, transfer, delegate or otherwise dispose of, whether voluntarily or involuntarily, by operation of law or otherwise, this Agreement or any rights or obligations under this Agreement without the prior written consent of CyberSource, which may be withheld in CyberSource’s sole discretion. Any purported assignment, transfer or delegation by You shall be null and void. Subject to the foregoing, this Agreement shall be binding upon and shall inure to the benefit of the parties and their respective successors and assigns. +7.5 Government Rights. If You (or any person or entity to whom you provide the Software or Documentation) are an agency or instrumentality of the United States Government, the Software and Documentation are “commercial computer software” and “commercial computer software documentation,” and pursuant to FAR 12.212 or DFARS 227.7202, and their successors, as applicable, use, reproduction and disclosure of the Software and Documentation are governed by the terms of this Agreement. +7.6 Export Administration. You shall comply fully with all relevant export laws and regulations of the United States, including, without limitation, the U.S. Export Administration Regulations (collectively “Export Controls”). Without limiting the generality of the foregoing, You shall not, and You shall require Your representatives not to, export, direct or transfer the Software or the Documentation, or any direct product thereof, to any destination, person or entity restricted or prohibited by the Export Controls. +7.7 Privacy. In order to continually innovate and improve the Software, Licensee understands and agrees that CyberSource may collect certain usage statistics including but not limited to a unique identifier, associated IP address, version number of software, and information on which tools and/or services in the Software are being used and how they are being used. +7.8 Headings. The headings to the Sections and Subsections of this Agreement are included merely for convenience of reference and shall not affect the meaning of the language included therein. +7.9 Entire Agreement; Amendments. This Agreement constitutes the entire agreement between the parties and supersedes all prior or contemporaneous agreements or representations, written or oral, concerning the subject matter of this Agreement. CyberSource may make changes to this Agreement, Software or Documentation in its sole discretion. When these changes are made, CyberSource will make a new version of the Agreement, Software or Documentation available on the website where the + +CyberSource Software Development Kit (SDK) License Agreement +v. July 9, 2014 +3 +Software is available. This Agreement may not be modified or amended by You except in a writing signed by a duly authorized representative of each party. You acknowledge and agree that CyberSource has not made any representations, warranties or agreements of any kind, except as expressly set forth herein. +BY CLICKING “I ACCEPT,” “I AGREE” OR AN EQUIVALENT INDICATOR OR BY DOWNLOADING, INSTALLING OR USING THE SOFTWARE OR THE DOCUMENTATION, YOU ACKNOWLEDGE AND AGREE THAT (1) YOU HAVE READ AND REVIEWED THIS AGREEMENT IN ITS ENTIRETY, (2) YOU AGREE TO BE BOUND BY THIS AGREEMENT, (3) YOU HAVE THE POWER, AUTHORITY AND LEGAL RIGHT TO ENTER INTO THIS AGREEMENT ON BEHALF OF YOU AND, (4) THIS AGREEMENT CONSTITUTES BINDING AND ENFORCEABLE OBLIGATIONS OF YOU. From 732049ded3aed32c7469006ed1ab5645ab9a50d3 Mon Sep 17 00:00:00 2001 From: mahmishr Date: Wed, 14 May 2025 09:54:04 +0530 Subject: [PATCH 5/5] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 064af2c..1268f1d 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "author": "developer@cybersource.com", "license": "MIT", "dependencies": { - "cybersource-rest-client": "0.0.65", + "cybersource-rest-client": "0.0.67", "eslint": "^5.9.0", "jwk-to-pem": "^2.0.0", "node-forge": "^1.2.1",