Created
          May 17, 2022 15:33 
        
      - 
      
- 
        Save nloding/26d51a0fc2e15ff454e19080a819c464 to your computer and use it in GitHub Desktop. 
Revisions
- 
        nloding created this gist May 17, 2022 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ { "name": "Mask Data - Example", "description": "Mask custom data with a Reactor", "type": "private", "code": "module.exports = async function (req) {\n const mask = (str, mask, n = 1) => \n ('' + str).slice(0, -n)\n .replace(/./g, mask)\n + ('' + str).slice(-n)\n\n const { data } = req.args\n\n return {\n raw: mask(data)\n }\n}", "configuration": [ ], "request_parameters": [ { "name": "data", "description": "All fields in this object will be masked", "type": "string", "optional": false } ] } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ const formula = async function (req) { const mask = (str, mask, n = 1) => ('' + str).slice(0, -n) .replace(/./g, mask) + ('' + str).slice(-n) const { data } = req.args return { raw: mask(data) } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ return axios .post( `https://api.basistheory.com/${reactorId}/react`, { data: "{{token-id | $.bankAccountOne}}" }, { headers: { "BT-API-KEY": process.env.BASIS_THEORY_SERVER_APPLICATION }, } ) .then(async ({ data }) => { res.status(200).json({ data }); }) .catch((err) => { console.log(JSON.stringify(err)); });